Merge branch 'master-stander' into master-xlk
New file |
| | |
| | | # Compiled class file |
| | | *.class |
| | | |
| | | # Log file |
| | | *.log |
| | | |
| | | # BlueJ files |
| | | *.ctxt |
| | | |
| | | # Mobile Tools for Java (J2ME) |
| | | .mtj.tmp/ |
| | | |
| | | # Package Files # |
| | | *.jar |
| | | *.war |
| | | *.nar |
| | | *.ear |
| | | *.zip |
| | | *.tar.gz |
| | | *.rar |
| | | *.iml |
| | | |
| | | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
| | | hs_err_pid* |
| | | */target/ |
| | | /.idea/ |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>phi-synchro-common</artifactId> |
| | | <version>stander</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <parent> |
| | | <groupId>com.hx</groupId> |
| | | <artifactId>phi-synchro</artifactId> |
| | | <version>stander</version> |
| | | </parent> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-ribbon</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-ribbon</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
| | | </dependency> |
| | | |
| | | <!--spring cloud的支持--> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-bootstrap</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-context --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-context</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-commons --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-commons</artifactId> |
| | | </dependency> |
| | | |
| | | <!--openfeign的支持--> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-openfeign</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-loadbalancer</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.ulisesbocchio</groupId> |
| | | <artifactId>jasypt-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>hx-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>phi-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>guide-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>platform-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-mongodb</artifactId> |
| | | <!--排除使用logback日志--> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>logback-classic</artifactId> |
| | | <groupId>ch.qos.logback</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <!-- <finalName>cases_common</finalName>--> |
| | | <resources> |
| | | <resource> |
| | | <directory>src/main/java</directory> |
| | | <includes> |
| | | <include>**/*.xml</include> |
| | | </includes> |
| | | <filtering>false</filtering> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | <includes> |
| | | <include>**/*.xml</include> |
| | | </includes> |
| | | </resource> |
| | | </resources> |
| | | |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package cn.linkedcare.charites.his.domain; |
| | | |
| | | import net.sf.json.JSONArray; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | @Document(collection="his-device")//集合名 |
| | | public class Device { |
| | | |
| | | private String id; |
| | | private String deviceNo; |
| | | private String deviceName; |
| | | private JSONArray parameters; |
| | | private Object access; |
| | | private Object metadata; |
| | | |
| | | public Device() { |
| | | } |
| | | |
| | | public Device(String id, String deviceNo, String deviceName, JSONArray parameters, Object access, Object metadata) { |
| | | this.id = id; |
| | | this.deviceNo = deviceNo; |
| | | this.deviceName = deviceName; |
| | | this.parameters = parameters; |
| | | this.access = access; |
| | | this.metadata = metadata; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public JSONArray getParameters() { |
| | | return parameters; |
| | | } |
| | | |
| | | public void setParameters(JSONArray parameters) { |
| | | this.parameters = parameters; |
| | | } |
| | | |
| | | public String getDeviceNo() { |
| | | return deviceNo; |
| | | } |
| | | |
| | | public void setDeviceNo(String deviceNo) { |
| | | this.deviceNo = deviceNo; |
| | | } |
| | | |
| | | public String getDeviceName() { |
| | | return deviceName; |
| | | } |
| | | |
| | | public void setDeviceName(String deviceName) { |
| | | this.deviceName = deviceName; |
| | | } |
| | | |
| | | |
| | | |
| | | public Object getAccess() { |
| | | return access; |
| | | } |
| | | |
| | | public void setAccess(Object access) { |
| | | this.access = access; |
| | | } |
| | | |
| | | public Object getMetadata() { |
| | | return metadata; |
| | | } |
| | | |
| | | public void setMetadata(Object metadata) { |
| | | this.metadata = metadata; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | public class CodeConstans { |
| | | |
| | | /**编码-融创*/ |
| | | public static final String SUNAC = "sunac"; |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | |
| | | public class DeductionSingleConstants { |
| | | |
| | | /**划扣类型-自增*/ |
| | | public static final String TYPE_SELF_ADD = "self_add"; |
| | | /**划扣类型-预约订单*/ |
| | | public static final String TYPE_PRE_ORDER = "pre_order"; |
| | | |
| | | /**划扣清单状态-待执行*/ |
| | | public static final Integer STATUS_WAIT_EXECUTE = 0; |
| | | /**划扣清单状态-已执行*/ |
| | | public static final Integer STATUS_DONE_EXECUTE = 1; |
| | | /**划扣清单状态-已撤销*/ |
| | | public static final Integer STATUS_RESCINDED = 2; |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | public class ErpUrl { |
| | | |
| | | /**ERP请求路径-查询所有产品信息*/ |
| | | public static final String SELECT_PRODUCT_ALL = "/ckapi/api/1/v2/select_Product_All.jsp"; |
| | | |
| | | /**ERP请求路径-产品的所有库存批次信息*/ |
| | | public static final String SELECT_STOCK = "/ckapi/api/1/v2/select_stock.jsp"; |
| | | /**ERP请求路径- 更改库存批次表单*/ |
| | | public static final String UPDATE_BATCH = "/ckapi/api/1/v2/update_batch.jsp"; |
| | | /**ERP请求路径- 更改库存批次表单*/ |
| | | public static final String INSERT_RECORD = "/ckapi/api/1/v2/insert_record.jsp"; |
| | | /**ERP请求路径- 更改库存批次表单*/ |
| | | public static final String UPDATE_INVENTORY_TABLE = "/ckapi/api/1/v2/update_inventory_table.jsp"; |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | public class HisUrl { |
| | | /**His请求路径-Token*/ |
| | | // public static final String BILLING_TOKEN = "/public/v1/token"; |
| | | public static final String BILLING_TOKEN = "/api/v1/auth/login"; |
| | | |
| | | |
| | | /**His请求路径-同步授权机构下的销售订单摘要数据 - 订单摘要信息*/ |
| | | /** 主动同步创建订单到his - 订单摘要信息*/ |
| | | // public static final String BILLING_SALES_ORDER = "/phiskin/v1/billing/sales-order"; |
| | | public static final String BILLING_SALES_ORDER = "/api/v1/billing/sales-order"; |
| | | |
| | | /** 销售订单支付,支付后为已支付订单,忽略所有审批流程 - userid替换成用户对应的hisid*/ |
| | | // public static final String BILLING_SALES_ORDER_PAYMENT = "/phiskin/v1/billing/sales-order/orderId/payment"; |
| | | public static final String BILLING_SALES_ORDER_PAYMENT = "/api/v1/billing/sales-order/orderId/payment"; |
| | | |
| | | /** 订单退款,忽略审批流程 - userid替换成用户对应的hisid*/ |
| | | public static final String BILLING_SALES_ORDER_REFUND = "/api/v1/billing/order/orderId/refund"; |
| | | |
| | | /**销售订单废弃,未支付订单可废弃,废弃后订单不可操作*/ |
| | | public static final String BILLING_SALES_ORDER_TOVOID = "/api/v1/billing/sales-order/"; |
| | | |
| | | |
| | | /** 主动同步创建订单到his - 订单摘要信息*/ |
| | | public static final String SALES_ORDER_PAYMENT = "/phiskin/v1/billing/sales-order/{id}/payment"; |
| | | |
| | | |
| | | /** 获取授权机构下的预约数据-列表*/ |
| | | // public static final String WORKFLOW_APPOINTMENT = "/phiskin/v1/workflow/appointment"; |
| | | public static final String WORKFLOW_APPOINTMENT = "/api/v1/workflow/appointment"; |
| | | /** 取消预约*/ |
| | | public static final String WORKFLOW_APPOINTMENT_CANCEL = "/api/v1/workflow/appointment/{id}/cancel"; |
| | | /** 确认预约*/ |
| | | public static final String WORKFLOW_APPOINTMENT_CONFIRM = "/api/v1/workflow/appointment/{id}/confirm"; |
| | | /** 修改预约*/ |
| | | public static final String WORKFLOW_APPOINTMENT_PARTIAL = "/api/v1/workflow/appointment/{id}/partial"; |
| | | /** 获取用户到访专属token*/ |
| | | public static final String WORKFLOW_APPOINTMENT_VISIT_TOKEN = "/api/v1/workflow/visit/{customerId}/operation/token"; |
| | | /** 获取用户到访专属token*/ |
| | | public static final String WORKFLOW_APPOINTMENT_VISIT = "/api/v1/workflow/visit"; |
| | | |
| | | /** 在授权机构下创建项目执行记录数据*/ |
| | | // public static final String CREATED_EXECUTION_RECORD = "/phiskin/v1/billing/created-execution-record"; |
| | | public static final String CREATED_EXECUTION_RECORD = "/api/v1/billing/execution-record"; |
| | | /** 获取授权机构下的可执行条目信息 - 订单中的项目条目*/ |
| | | // public static final String EXECUTION_ITEM = "/phiskin/v1/billing/execution-item"; |
| | | public static final String EXECUTION_ITEM = "/api/v1/billing/execution-item"; |
| | | /** 获取授权机构下的客户项目执行数据*/ |
| | | // public static final String EXECUTION_RECORD = "/phiskin/v1/billing/execution-record"; |
| | | public static final String EXECUTION_RECORD = "/api/v1/billing/execution-record"; |
| | | |
| | | |
| | | /** His请求路径-获取授权机构下的服务类项目分类(树状结构)*/ |
| | | // public static final String CATALOG_CATEGORY_SERVICE_TREE = "/phiskin/v1/catalog/category/service/tree"; |
| | | public static final String CATALOG_CATEGORY_SERVICE_TREE = "/api/v1/catalog/category/service/tree"; |
| | | /** His请求路径-获取授权机构下的服务类项目数据 - 服务项目*/ |
| | | // public static final String CATALOG_product_service = "/phiskin/v1/catalog/product/service"; |
| | | public static final String CATALOG_product_service = "/api/v1/catalog/product/service"; |
| | | |
| | | /** His请求路径-获取授权机构下的物料类数据分类(树状结构)*/ |
| | | // public static final String CATALOG_CATEGORY_GOODS_TREE = "/phiskin/v1/catalog/category/goods/tree"; |
| | | public static final String CATALOG_CATEGORY_GOODS_TREE = "/api/v1/catalog/category/goods/tree"; |
| | | |
| | | /** His请求路径-获取授权机构下的物料数据-耗材、药品、药妆等受库存管控条目*/ |
| | | // public static final String CATALOG_PRODUCT_GOODS = "/phiskin/v1/catalog/product/goods"; |
| | | public static final String CATALOG_PRODUCT_GOODS = "/api/v1/catalog/product/goods"; |
| | | |
| | | //指定类型下创建分类新节点 - 各类型通用 |
| | | public static final String CATALOG_CATEGORY = "/api/v1/catalog/category"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** His请求路径-获取供应商信息 - 翻页*/ |
| | | // public static final String INVENTORY_SUPPLIER = "/phiskin/v1/inventory/supplier"; |
| | | public static final String INVENTORY_SUPPLIER = "/api/v1/inventory/supplier"; |
| | | |
| | | |
| | | |
| | | |
| | | /** His请求路径-获取授权机构下的客户数据*/ |
| | | // public static final String CRM_CUSTOMER = "/phiskin/v1/crm/customer"; |
| | | public static final String CRM_CUSTOMER = "/api/v1/crm/customer"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** 商汤请求路径-商汤创建访客*/ |
| | | // public static final String SENSELINK_CUSTOMER = "/phiskin/v1/crm/senselink_customer"; |
| | | public static final String SENSELINK_CUSTOMER = "/api/v1/guest"; |
| | | /** His请求路径-商汤修改访客*/ |
| | | // public static final String SENSELINK_CUSTOMER_UPDATE = "/phiskin/v1/crm/senselink_customer_update"; |
| | | public static final String SENSELINK_CUSTOMER_UPDATE = "/api/v1/guest/update"; |
| | | /** His请求路径-根据客户Id获取授权机构下的账户余额 userid替换成用户对应的hisid */ |
| | | // public static final String USER_ACCOUNT = "/phiskin/v1/crm/customer/userid/account"; |
| | | public static final String USER_ACCOUNT = "/api/v1/crm/customer/userid/account"; |
| | | /** His请求路径-根据客户Id获取授权机构下的账户余额变动数据 userid替换成用户对应的hisid */ |
| | | // public static final String USER_ACCOUNT_JOURNAL = "/phiskin/v1/crm/customer/userid/account/journal"; |
| | | public static final String USER_ACCOUNT_JOURNAL = "/api/v1/crm/customer/userid/account/journal"; |
| | | /** His请求路径-根据客户ID进行积分增减操作 userid替换成用户对应的hisid */ |
| | | // public static final String ACCOUNT_CREDIT = "/phiskin/v1/crm/customer/userid/account/credit"; |
| | | public static final String ACCOUNT_CREDIT = "/api/v1/crm/customer/userid/account/credit"; |
| | | /** His请求路径-根据客户ID进行增值金调整 */ |
| | | // public static final String GIFT_ADD = "/phiskin/v1/crm/customer/gift/add"; |
| | | public static final String GIFT_ADD = "/api/v1/crm/customer/gift/add"; |
| | | /** His请求路径-获取前后对比照数据 */ |
| | | // public static final String SWORKFLOW_PHOTOCOMPARE = "/phiskin/v1/workflow/photoCompares"; |
| | | public static final String SWORKFLOW_PHOTOCOMPARE = "/api/v1/workflow/photoCompares"; |
| | | /** His请求路径-下载前后对比照片 */ |
| | | public static final String DOCUMENT_DOWNLOAD = "https://his.xxx.com/api/v1/document/download/"; |
| | | /** His请求路径-创建储值金与预定金订单 */ |
| | | // public static final String PREPAID_ORDER = "/phiskin/v1/billing/prepaid-order"; |
| | | public static final String PREPAID_ORDER = "/api/v1/billing/prepaid-order"; |
| | | |
| | | |
| | | /** His请求路径-获取授权机构下的诊所信息*/ |
| | | // public static final String FOUNDATION_CLINIC = "/phiskin/v1/foundation/clinic"; |
| | | public static final String FOUNDATION_CLINIC = "/api/v1/foundation/clinic"; |
| | | /** His请求路径-获取授权机构下医疗科室信息*/ |
| | | // public static final String MEDICAL_DEPARTMENT = "/phiskin/v1/foundation/medical-department"; |
| | | public static final String MEDICAL_DEPARTMENT = "/api/v1/foundation/medical-department"; |
| | | /** His请求路径-查找指定诊所的治疗房间,手术房间 shopId替换成门店对应的hisid*/ |
| | | // public static final String CLINIC_ROOM = "/phiskin/v1/foundation/clinic/shopId/room"; |
| | | public static final String CLINIC_ROOM = "/api/v1/foundation/clinic/shopId/room"; |
| | | |
| | | |
| | | |
| | | /** His请求路径-获取授权机构下的员工信息*/ |
| | | // public static final String FOUNDATION_EMPLOYEE = "/phiskin/v1/foundation/employee"; |
| | | public static final String FOUNDATION_EMPLOYEE = "/api/v1/foundation/employee"; |
| | | |
| | | /** His请求路径-获取授权机构下的客户渠道信息*/ |
| | | // public static final String FOUNDATION_CHANNEL = "/phiskin/v1/foundation/channel"; |
| | | public static final String FOUNDATION_CHANNEL = "/api/v1/foundation/channel"; |
| | | |
| | | |
| | | /** His请求路径-获取授权机构下的所有库房信息*/ |
| | | // public static final String INVENTORY_WAREHOUSE = "/phiskin/v1/inventory/warehouse"; |
| | | public static final String INVENTORY_WAREHOUSE = "/api/v1/inventory/warehouse"; |
| | | /** His请求路径-获取授权机构下的所有库存条目信息*/ |
| | | // public static final String INVENTORY_STOCK_ITEM = "/phiskin/v1/inventory/stock_item"; |
| | | public static final String INVENTORY_STOCK_ITEM = "/api/v1/inventory/stock-item"; |
| | | |
| | | /** His请求路径-获取授权机构下出/入库类别,bizType参数: stock-in(入库), stock-out(出库)*/ |
| | | // public static final String INVENTORY_CHANGE_TYPE = "/phiskin/v1/inventory/change-type/{bizType}"; |
| | | public static final String INVENTORY_CHANGE_TYPE = "/api/v1/inventory/change-type/{bizType}"; |
| | | /** His请求路径-物料入库操作*/ |
| | | // public static final String INVENTORY_STOCK_IN = "/phiskin/v1/inventory/stock_in"; |
| | | public static final String INVENTORY_STOCK_IN = "/api/v1/inventory/stock-item/stock-in"; |
| | | /** His请求路径-作废物料入库记录*/ |
| | | // public static final String INVENTORY_STOCK_IN_ID = "/phiskin/v1/inventory/stock_in_d/{id}"; |
| | | public static final String INVENTORY_STOCK_IN_ID = "/api/v1/inventory/stock-item/stock-in/{id}"; |
| | | /** His请求路径-物料出库操作*/ |
| | | // public static final String INVENTORY_STOCK_OUT = "/phiskin/v1/inventory/stock_out"; |
| | | public static final String INVENTORY_STOCK_OUT = "/api/v1/inventory/stock-item/stock-out"; |
| | | /** His请求路径-作废物料出库记录*/ |
| | | public static final String INVENTORY_STOCK_OUT_ID = "/phiskin/v1/inventory/stock_out_d/{id}"; |
| | | /** His请求路径-物料调拨操作*/ |
| | | // public static final String INVENTORY_TRANSFER = "/phiskin/v1/inventory/transfer"; |
| | | public static final String INVENTORY_TRANSFER = "/api/v1/inventory/stock-item/transfer"; |
| | | /** His请求路径-作废物料挑拨记录*/ |
| | | // public static final String INVENTORY_TRANSFER_D = "/phiskin/v1/inventory/transfer_d/{id}"; |
| | | public static final String INVENTORY_TRANSFER_D = "/api/v1/inventory/stock-item/transfer/{id}"; |
| | | |
| | | |
| | | |
| | | /** His请求路径-获取标签信息*/ |
| | | public static final String FOUNDATION_TAGSETS = "/api/v1/foundation/tagSets"; |
| | | |
| | | |
| | | |
| | | /** His请求路径-获取授权机构下的咨询数据,创建咨询*/ |
| | | public static final String WORKFLOW_CONSULTATION = "/api/v1/workflow/consultation"; |
| | | |
| | | |
| | | /** His请求路径-获取授权机构下的咨询数据,创建咨询*/ |
| | | public static final String API_V1_BILLING_PAYMENT = "/api/v1/billing/payment"; |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | public class KoapUrl { |
| | | |
| | | //获取Token |
| | | public static final String OBTAIN_TOKEN = "/authserver/oauth/token"; |
| | | |
| | | //获取患者信息 |
| | | public static final String BASE_PATIENT_LIST = "/api/base/patient/list"; |
| | | //创建患者信息 |
| | | public static final String BASE_PATIENT_CREATE = "/api/base/patient/create"; |
| | | //修改患者信息 |
| | | public static final String BASE_PATIENT_MPDIFY = "/api/base/patient/modify"; |
| | | |
| | | //用visitNo查询当前当前就诊的未缴费信息 |
| | | public static final String FEE_CHARGE_UNPAID_VISIT_LIST = "/api/fee/charge/unpaid/visit/list"; |
| | | //查询当前患者一段内未缴费信息 |
| | | public static final String FEE_CHARGE_UNPAID_PATIENT_LIST = "/api/fee/charge/unpaid/patient/list"; |
| | | //创建患者缴费账单信息 |
| | | public static final String FEE_RECEIPT_PAY= "/api/fee/receipt/pay"; |
| | | //创建患者缴费账单信息 |
| | | public static final String FEE_RECEIPT_REFUND= "/api/fee/receipt/refund"; |
| | | |
| | | //获取科室信息 |
| | | public static final String BASE_SPECIALTY_LIST = "/api/base/specialty/list"; |
| | | //获取医生信息 |
| | | public static final String BASE_DOCTOR_LIST = "/api/base/doctor/list"; |
| | | //获取排班信息 |
| | | public static final String APPOINTMENT_VISIT_SCHEMA_LIST = "/api/appointment/visit/schema/list"; |
| | | //获取排班信息 |
| | | public static final String APPOINTMENT_VISIT_INTERVAL_LIST = "/api/appointment/visit/interval/list"; |
| | | //新建患者预约信息 |
| | | public static final String APPOINTMENT_VISIT_CREATE = "/api/appointment/visit/create"; |
| | | //修改患者预约信息 |
| | | public static final String APPOINTMENT_VISIT_MODIFY = "/api/appointment/visit/modify"; |
| | | //作废患者预约信息 |
| | | public static final String APPOINTMENT_VISIT_CANCEL = "/api/appointment/visit/cancel"; |
| | | |
| | | public static final String APPOINTMENT_VISIT_LIST = "/api/appointment/visit/list"; |
| | | |
| | | //获取患者账单信息 |
| | | public static final String FEE_RECEIPT_LIST = "/api/fee/receipt/list"; |
| | | //获取患者检验记录信息 |
| | | //用VisitNo查询当前患者检验记录信息 |
| | | public static final String EXECUTION_LAB_RECORD_VISIT_LIST = "/api/execution/lab/record/visit/list"; |
| | | //查询当前患者一段时间的检验记录信息 |
| | | public static final String EXECUTION_LAB_RECORD_PATIENT_LIST = "/api/execution/lab/record/patient/list"; |
| | | //获取患者检验报告信息 |
| | | public static final String EXECUTION_LAB_REPORT_GET = "/api/execution/lab/report/get"; |
| | | //获取患者检查记录信息 |
| | | //用VisitNo查询当前患者检查信息 |
| | | public static final String EXECUTION_EXAM_RECORD_VISIT_LIST = "/api/execution/exam/record/visit/list"; |
| | | public static final String EXECUTION_EXAM_RECORD_PATIENT_LIST = "/api/execution/exam/record/patient/list"; |
| | | //获取患者检查报告信息 |
| | | public static final String EXECUTION_EXAM_REPORT_GET = "/api/execution/exam/report/get"; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | public class OrderDeveloperConstants { |
| | | /**开发人类型-美容师(最多20字符)*/ |
| | | public static final String TYPE_PROJECT = "beautician"; |
| | | /**开发人类型-医生(最多20字符)*/ |
| | | public static final String TYPE_RETAIL = "doctor"; |
| | | /**开发人类型-咨询师(最多20字符)*/ |
| | | public static final String TYPE_CONSULTANT = "consultant"; |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | public class OrderGoodsConstants { |
| | | /**订单商品类型-项目(最多20字符)*/ |
| | | public static final String TYPE_PROJECT = "project"; |
| | | /**订单商品类型-商品/项目(最多20字符)*/ |
| | | public static final String TYPE_RETAIL = "goods"; |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | public class OrderItemConstants { |
| | | |
| | | /**商品类型-项目*/ |
| | | public static final String TYPE_PROJECT = "project"; |
| | | /**商品类型-商品/药品*/ |
| | | public static final String TYPE_RETAIL = "retail"; |
| | | /**商品类型-套餐*/ |
| | | public static final String TYPE_MEAL = "meal"; |
| | | /**商品类型-卡项*/ |
| | | public static final String TYPE_CARD = "card"; |
| | | /**商品类型-促销*/ |
| | | public static final String TYPE_PROMOTION = "promotion"; |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | public class OrderTotalConstants { |
| | | |
| | | |
| | | /**订单类型-项目(最多20字符)*/ |
| | | public static final String TYPE_PROJECT = "project"; |
| | | /**订单类型-零售(最多20字符)*/ |
| | | public static final String TYPE_RETAIL = "retail"; |
| | | |
| | | /**支付状态-待支付*/ |
| | | public static final int PAY_STATUS_WAIT = 0; |
| | | /**支付状态-支付中,待回调*/ |
| | | public static final int PAY_STATUS_LOADING = 1; |
| | | /**支付状态-部分支付支付*/ |
| | | public static final int PAY_STATUS_PART = 2; |
| | | /**支付状态-已支付*/ |
| | | public static final int PAY_STATUS_SUC = 3; |
| | | |
| | | |
| | | /**订单状态-待支付*/ |
| | | public static final int STATUS_WAIT_PAY= 0; |
| | | /**订单状态-已支付/待发货*/ |
| | | public static final int STATUS_PAY = 1; |
| | | /**订单状态-已完成*/ |
| | | public static final int STATUS_DONE = 6; |
| | | /**订单状态-已取消*/ |
| | | public static final int STATUS_CANCEL = 9; |
| | | /**订单状态-草稿*/ |
| | | public static final int STATUS_DRAFT = 10; |
| | | /**订单状态-欠费*/ |
| | | public static final int STATUS_ARREARS = 11; |
| | | /**订单状态-待审批*/ |
| | | public static final int STATUS_WAIT_PENDING = 12; |
| | | /**订单状态-已审核*/ |
| | | public static final int STATUS_PASS_PENDING = 13; |
| | | |
| | | |
| | | /**退款状态-申请退款*/ |
| | | public static final int STATUS_APPLY_REFUND = 0; |
| | | /**退款状态-待退款*/ |
| | | public static final int STATUS_WAIT_REFUND = 1; |
| | | /**退款状态-部分退款*/ |
| | | public static final int STATUS_REFUND_PART = 2; |
| | | /**退款状态-已退款*/ |
| | | public static final int STATUS_REFUND = 3; |
| | | |
| | | |
| | | /**订单渠道来源类型-无渠道*/ |
| | | public static final String CHANNEL_TYPE_NOTHING = "nothing"; |
| | | |
| | | /**订单渠道来源类型-用户渠道*/ |
| | | public static final String CHANNEL_TYPE_USER = "user"; |
| | | /**订单渠道来源类型-渠道联动*/ |
| | | public static final String CHANNEL_TYPE_CHANNEL = "channel"; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.common; |
| | | |
| | | /** |
| | | * author:fhx |
| | | * Date:2021/8/9 17:14 |
| | | */ |
| | | public class RoleType { |
| | | |
| | | /**角色-顾问组长*/ |
| | | public static final String UNIQUE_STR_ADVISER_LEADER = "adviser_leader"; |
| | | /**角色-顾问助理*/ |
| | | public static final String UNIQUE_STR_ADVISER_ASSISTANT = "adviser_assistant"; |
| | | /**角色-MIC*/ |
| | | public static final String UNIQUE_STR_MIC = "mic"; |
| | | /**角色-医生*/ |
| | | public static final String UNIQUE_STR_DOCTOR = "doctor"; |
| | | /**角色-护士*/ |
| | | public static final String UNIQUE_STR_NURSE = "nurse"; |
| | | /**角色-前台*/ |
| | | public static final String UNIQUE_STR_RECEPTION = "reception"; |
| | | /**角色-店长*/ |
| | | public static final String UNIQUE_STR_SHOPOWNER = "shopowner"; |
| | | /**角色-护士助理*/ |
| | | public static final String UNIQUE_STR_NURSE_ASSISTANT = "nurse_assistant"; |
| | | /**角色-医生助理*/ |
| | | public static final String UNIQUE_STR_DOCTOR_ASSISTANT = "doctor_assistant"; |
| | | /**角色-TMK顾问*/ |
| | | public static final String UNIQUE_STR_TMK_ADVISER = "tmk_adviser"; |
| | | /**角色-SBU总监*/ |
| | | public static final String UNIQUE_STR_SBU_DIRECTOR = "sbu_director"; |
| | | /**角色-CEO*/ |
| | | public static final String UNIQUE_STR_CEO = "ceo"; |
| | | /**角色-CHO*/ |
| | | public static final String UNIQUE_STR_CHO = "cho"; |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.HisAccountJournal; |
| | | |
| | | public interface HisAccountJournalMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(HisAccountJournal hisAccountJournal); |
| | | /**新增,返回主键*/ |
| | | int insertById(HisAccountJournal hisAccountJournal); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<HisAccountJournal> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | HisAccountJournal selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | HisAccountJournal selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | HisAccountJournal selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(HisAccountJournal hisAccountJournal); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.HisExecutionRecord; |
| | | |
| | | public interface HisExecutionRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(HisExecutionRecord hisExecutionRecord); |
| | | /**新增,返回主键*/ |
| | | int insertById(HisExecutionRecord hisExecutionRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<HisExecutionRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | HisExecutionRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | HisExecutionRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | HisExecutionRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(HisExecutionRecord hisExecutionRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.HisOrderItem; |
| | | |
| | | public interface HisOrderItemMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(HisOrderItem hisOrderItem); |
| | | /**新增,返回主键*/ |
| | | int insertById(HisOrderItem hisOrderItem); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<HisOrderItem> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | HisOrderItem selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | HisOrderItem selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | HisOrderItem selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(HisOrderItem hisOrderItem); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.HisOrderItemRecord; |
| | | |
| | | public interface HisOrderItemRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(HisOrderItemRecord hisOrderItemRecord); |
| | | /**新增,返回主键*/ |
| | | int insertById(HisOrderItemRecord hisOrderItemRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<HisOrderItemRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | HisOrderItemRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | HisOrderItemRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | HisOrderItemRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(HisOrderItemRecord hisOrderItemRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.HisVisitRecord; |
| | | |
| | | public interface HisVisitRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(HisVisitRecord hisVisitRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<HisVisitRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | HisVisitRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | HisVisitRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | HisVisitRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(HisVisitRecord hisVisitRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncAppointmentRecord; |
| | | |
| | | public interface SyncAppointmentRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncAppointmentRecord syncAppointmentRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncAppointmentRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncAppointmentRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncAppointmentRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncAppointmentRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncAppointmentRecord syncAppointmentRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | |
| | | public interface SyncBasicInformationRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncBasicInformationRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncBasicInformationRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncBasicInformationRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncBasicInformationRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncExecutionRecord; |
| | | |
| | | public interface SyncExecutionRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncExecutionRecord syncExecutionRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncExecutionRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncExecutionRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncExecutionRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncExecutionRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncExecutionRecord syncExecutionRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncKoapAppointmentRecord; |
| | | |
| | | public interface SyncKoapAppointmentRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncKoapAppointmentRecord syncKoapAppointmentRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncKoapAppointmentRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncKoapAppointmentRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncKoapAppointmentRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncKoapAppointmentRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncKoapAppointmentRecord syncKoapAppointmentRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncOrderTotal; |
| | | import com.hx.phip.model.SyncOrderTotal; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | public interface SyncOrderTotalMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncOrderTotal SyncOrderTotal); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncOrderTotal> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncOrderTotal selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncOrderTotal selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncOrderTotal selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncOrderTotal SyncOrderTotal); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncProjectRecord; |
| | | |
| | | public interface SyncProjectRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncProjectRecord syncProjectRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncProjectRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncProjectRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncProjectRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncProjectRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncProjectRecord syncProjectRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncUserAccountRecord; |
| | | |
| | | public interface SyncUserAccountRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncUserAccountRecord syncUserAccountRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncUserAccountRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncUserAccountRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncUserAccountRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncUserAccountRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncUserAccountRecord syncUserAccountRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncUserCardRecord; |
| | | |
| | | public interface SyncUserCardRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncUserCardRecord syncUserCardRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncUserCardRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncUserCardRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncUserCardRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncUserCardRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncUserCardRecord syncUserCardRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncUserPictureRcord; |
| | | |
| | | public interface SyncUserPictureMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncUserPictureRcord syncUserPictureRcord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncUserPictureRcord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncUserPictureRcord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncUserPictureRcord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncUserPictureRcord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncUserPictureRcord syncUserPictureRcord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.dao.mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncUserPictureRcord; |
| | | |
| | | public interface SyncUserPictureRcordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(SyncUserPictureRcord syncUserPictureRcord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<SyncUserPictureRcord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | SyncUserPictureRcord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | SyncUserPictureRcord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | SyncUserPictureRcord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(SyncUserPictureRcord syncUserPictureRcord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | package com.hx.phip.feign; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.sync.HeartbeatReceive; |
| | | import com.hx.phiappt.model.sync.ShangTangUser; |
| | | import com.hx.phiappt.model.sync.SyncUserRecord; |
| | | import com.hx.phiappt.model.sync.UserArriveVisit; |
| | | import com.hx.phip.model.*; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @FeignClient(name="p-synchro-service",path = "/his_synchro_sys",contextId = "log") |
| | | public interface LogService { |
| | | |
| | | @PostMapping(value = "/feign/test1") |
| | | Result test1(@RequestParam("name") String name); |
| | | |
| | | |
| | | /** |
| | | * 新增心跳日志接口 |
| | | * @param heartbeatReceive |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/heartbeatReceive") |
| | | <T extends Serializable> int addHeartbeatReceive(@RequestBody HeartbeatReceive heartbeatReceive); |
| | | |
| | | |
| | | /** |
| | | * 商汤同步去重记录 |
| | | * @param shangTangUser |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/shangTangUser") |
| | | <T extends Serializable> int addShangTangUser(@RequestBody ShangTangUser shangTangUser); |
| | | |
| | | /** |
| | | * 新增同步预约日志接口 |
| | | * @param SyncAppointmentRecord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/appointmentRecord") |
| | | <T extends Serializable> int addAppointmentRecord(@RequestBody SyncAppointmentRecord SyncAppointmentRecord); |
| | | |
| | | /** |
| | | * 新增同步基础数据日志接口 |
| | | * @param syncBasicInformationRecord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/basicInformation") |
| | | <T extends Serializable> int addBasicInformation(@RequestBody SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | /** |
| | | * 记录划扣日志 |
| | | * @param syncExecutionRecord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/executionRecord") |
| | | <T extends Serializable> int addExecutionRecord(@RequestBody SyncExecutionRecord syncExecutionRecord); |
| | | |
| | | /** |
| | | * 记录同步康博嘉预约日志接口 |
| | | * @param syncKoapAppointmentRecord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/koapAppointment") |
| | | <T extends Serializable> int addKoapAppointment(@RequestBody SyncKoapAppointmentRecord syncKoapAppointmentRecord); |
| | | |
| | | /** |
| | | * 记录同步订单日志接口 |
| | | * @param syncOrderTotal |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/orderTotal") |
| | | <T extends Serializable> int addOrderTotal(@RequestBody SyncOrderTotal syncOrderTotal); |
| | | |
| | | /** |
| | | * 记录同步项目日志接口 |
| | | * @param syncProjectRecord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/project") |
| | | <T extends Serializable> int addProject(@RequestBody SyncProjectRecord syncProjectRecord); |
| | | |
| | | /** |
| | | * 记录同步用户余额日志接口 |
| | | * @param syncUserAccountRecord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/userAccount") |
| | | <T extends Serializable> int addUserAccount(@RequestBody SyncUserAccountRecord syncUserAccountRecord); |
| | | |
| | | |
| | | /** |
| | | * 新增同步用户卡包日志接口 |
| | | * @param syncUserCardRecord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/addUserCrad") |
| | | <T extends Serializable> int addUserCrad(@RequestBody SyncUserCardRecord syncUserCardRecord); |
| | | |
| | | /** |
| | | * 记录同步用户对比照日志接口 |
| | | * @param syncUserPictureRcord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/userPicture") |
| | | <T extends Serializable> int addUserPicture(@RequestBody SyncUserPictureRcord syncUserPictureRcord); |
| | | |
| | | /** |
| | | * 记录同步用户日志接口 |
| | | * @param syncUserRecord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/user") |
| | | <T extends Serializable> int addUser(@RequestBody SyncUserRecord syncUserRecord); |
| | | |
| | | /** |
| | | * 记录到访日志接口 |
| | | * @param userArriveVisit |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/userArriveVisit") |
| | | <T extends Serializable> int adduserArriveVisit(@RequestBody UserArriveVisit userArriveVisit); |
| | | |
| | | /** |
| | | * 修改记录到访日志接口 |
| | | * @param userArriveVisit |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/update/userArriveVisit") |
| | | <T extends Serializable> int updateuserArriveVisit(@RequestBody UserArriveVisit userArriveVisit); |
| | | |
| | | |
| | | /** |
| | | * 新增his到访记录 |
| | | * @param hisVisitRecord |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/visitRecord") |
| | | <T extends Serializable> int addVisitRecord(@RequestBody HisVisitRecord hisVisitRecord); |
| | | |
| | | /** |
| | | * 查询his到访记录 |
| | | * @param sqlSentence |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/query/visitRecord") |
| | | HisVisitRecord queryVisitRecord(@RequestBody SqlSentence sqlSentence); |
| | | |
| | | /** |
| | | * 查询his到访记录集合 |
| | | * @param sqlSentence |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/selectList/visitRecord") |
| | | List<HisVisitRecord> selectListVisitRecord(@RequestBody SqlSentence sqlSentence); |
| | | |
| | | /** |
| | | * 修改his到访记录 |
| | | * @param hisVisitRecord |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/update/visitRecord") |
| | | <T extends Serializable> int updateVisitRecord(@RequestBody HisVisitRecord hisVisitRecord); |
| | | |
| | | |
| | | /** |
| | | * 新增his未执行记录 |
| | | * @param hisOrderItem |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/hisOrderItem") |
| | | <T extends Serializable> int addHisOrderItem(@RequestBody HisOrderItem hisOrderItem); |
| | | |
| | | /** |
| | | * 查询his未执行记录 |
| | | * @param sqlSentence |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/query/hisOrderItem") |
| | | HisOrderItem queryHisOrderItem(@RequestBody SqlSentence sqlSentence); |
| | | |
| | | /** |
| | | * 查询his未执行记录 |
| | | * @param sqlSentence |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/selectList/hisOrderItem") |
| | | List<HisOrderItem> selectListHisOrderItem(@RequestBody SqlSentence sqlSentence); |
| | | /** |
| | | * 修改his未执行记录 |
| | | * @param hisOrderItem |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/update/hisOrderItem") |
| | | <T extends Serializable> int updateHisOrderItem(@RequestBody HisOrderItem hisOrderItem); |
| | | |
| | | |
| | | /** |
| | | * 新增his执行记录 |
| | | * @param hisExecutionRecord |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/hisExecutionRecord") |
| | | <T extends Serializable> int addHisExecutionRecord(@RequestBody HisExecutionRecord hisExecutionRecord); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询his执行记录 |
| | | * @param sqlSentence |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/query/hisExecutionRecord") |
| | | HisExecutionRecord queryHisExecutionRecord(@RequestBody SqlSentence sqlSentence); |
| | | /** |
| | | * 查询his执行记录 |
| | | * @param sqlSentence |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/selectList/hisExecutionRecord") |
| | | List<HisExecutionRecord> selectListHisExecutionRecord(@RequestBody SqlSentence sqlSentence); |
| | | /** |
| | | * 修改his执行记录 |
| | | * @param hisExecutionRecord |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/update/hisExecutionRecord") |
| | | <T extends Serializable> int updateHisExecutionRecord(@RequestBody HisExecutionRecord hisExecutionRecord); |
| | | |
| | | |
| | | /** |
| | | * 新增转换his未执行记录 |
| | | * @param hisOrderItemRecord |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/hisOrderItemRecord") |
| | | <T extends Serializable> int addHisOrderItemRecord(@RequestBody HisOrderItemRecord hisOrderItemRecord); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询his资金记录 |
| | | * @param sqlSentence |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/query/accountJournal") |
| | | HisAccountJournal queryAccountJournal(@RequestBody SqlSentence sqlSentence); |
| | | /** |
| | | * 查询his资金记录 |
| | | * @param sqlSentence |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/selectList/accountJournal") |
| | | List<HisAccountJournal> selectListAccountJournal(@RequestBody SqlSentence sqlSentence); |
| | | |
| | | /** |
| | | * 新增转换his资金记录 |
| | | * @param hisAccountJournal |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/add/accountJournal") |
| | | <T extends Serializable> int addAccountJournal(@RequestBody HisAccountJournal hisAccountJournal); |
| | | |
| | | /** |
| | | * 修改转换his资金记录 |
| | | * @param hisAccountJournal |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/feign/update/accountJournal") |
| | | <T extends Serializable> int updateAccountJournal(@RequestBody HisAccountJournal hisAccountJournal); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.feign; |
| | | |
| | | import com.hx.phiappt.model.order.OrdersTotal; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @FeignClient(name="synchro-service",path = "/his_synchro",contextId = "orderFeign") |
| | | public interface OrderFeignService { |
| | | |
| | | @PostMapping(value = "/sync/order/getToken") |
| | | String getToken(); |
| | | |
| | | @PostMapping(value = "/sync/order/getOrdersTotal") |
| | | OrdersTotal selectOrdersTotal(@RequestBody String orderId); |
| | | |
| | | @PostMapping(value = "/sync/order/updateOrdersTotal") |
| | | void updateOrdersTotal(@RequestBody OrdersTotal ordersTotal); |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @Author |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "his_account_journal") |
| | | @Data |
| | | public class HisAccountJournal extends BaseEntity { |
| | | |
| | | //_id |
| | | @Column(comment = "领建id", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String hisId; |
| | | |
| | | //customerId |
| | | @Column(comment = "用户id", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String customerId; |
| | | |
| | | //metadata.createTimestamp |
| | | @Column(comment = "创建时间" , length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String createTimestamp; |
| | | //debit.type.displayText 或者 credit.type.displayText |
| | | @Column(comment = "操作的金额类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private String type; |
| | | //type.displayText |
| | | @Column(comment = "业务类型", length = 4, type = MySqlTypeConstant.TINYINT) |
| | | private String recordType; |
| | | // debit credit |
| | | @Column(comment = "操作类型,增或者减", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer opType; |
| | | //debit.amount 或者 credit.amount |
| | | @Column(comment = "操作数值",length = 28,type = MySqlTypeConstant.DECIMAL) |
| | | private BigDecimal opNumber=BigDecimal.ZERO; |
| | | //opAfterNumber+-opNumber |
| | | @Column(comment = "操作之前数值" ,length = 28,type = MySqlTypeConstant.DECIMAL) |
| | | private BigDecimal opBeforeNumber=BigDecimal.ZERO; |
| | | //balance.amount |
| | | @Column(comment = "操作之后数值" ,length = 28,type = MySqlTypeConstant.DECIMAL) |
| | | private BigDecimal opAfterNumber=BigDecimal.ZERO; |
| | | |
| | | /****操作人数据****/ |
| | | //metadata.createBy |
| | | @Column(comment = "操作人Id", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String operatorId; |
| | | //note |
| | | @Column(comment = "操作备注", type = MySqlTypeConstant.TEXT) |
| | | private String remarks; |
| | | |
| | | @Column(comment = "是否处理 (0:待处理 1 处理完成 2 处理失败)", length = 1, type = MySqlTypeConstant.INT) |
| | | private Integer whetherToHandle=NO; |
| | | |
| | | |
| | | |
| | | /**操作类型-增加*/ |
| | | public static final int OP_TYPE_INCREASE = 1; |
| | | /**操作类型-减少*/ |
| | | public static final int OP_TYPE_REDUCE = 2; |
| | | |
| | | public HisAccountJournal() { |
| | | } |
| | | |
| | | public HisAccountJournal(String hisId, String customerId, String createTimestamp, String type, String recordType, Integer opType, BigDecimal opNumber, BigDecimal opBeforeNumber, BigDecimal opAfterNumber, String operatorId, String remarks) { |
| | | this.hisId = hisId; |
| | | this.customerId = customerId; |
| | | this.createTimestamp = createTimestamp; |
| | | this.type = type; |
| | | this.recordType = recordType; |
| | | this.opType = opType; |
| | | this.opNumber = opNumber; |
| | | this.opBeforeNumber = opBeforeNumber; |
| | | this.opAfterNumber = opAfterNumber; |
| | | this.operatorId = operatorId; |
| | | this.remarks = remarks; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "his_execution_record") |
| | | @Data |
| | | public class HisExecutionRecord extends BaseEntity { |
| | | |
| | | //_id |
| | | @Column(comment = "领建id", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String hisId; |
| | | //items.itemId |
| | | @Column(comment = "可执行条目ID", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String itemId; |
| | | //number |
| | | @Column(comment = "编号", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String number; |
| | | |
| | | //items service payments amount 之和 单位元 |
| | | @Column(comment = "划扣金额", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String amount; |
| | | |
| | | //metadata.createTimestamp |
| | | @Column(comment = "开单时间" , length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String executedDate; |
| | | //note |
| | | @Column(comment = "备注", type = MySqlTypeConstant.TEXT) |
| | | private String note; |
| | | |
| | | //customer |
| | | @Column(comment = "客户信息", type = MySqlTypeConstant.TEXT) |
| | | private String customer; |
| | | |
| | | //organization |
| | | @Column(comment = "执行门店", type = MySqlTypeConstant.TEXT) |
| | | private String clinic; |
| | | |
| | | //metadata.state |
| | | @Column(comment = "是否作废(-1作废,1正常)", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String cancelled; |
| | | |
| | | //cancelledAt |
| | | @Column(comment = "作废时间" , length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String cancelledDate; |
| | | |
| | | //metadata.createBy 只有创建人id,万一找不到只填找不到对应的操作人 |
| | | @Column(comment = "操作人", type = MySqlTypeConstant.TEXT) |
| | | private String creator; |
| | | |
| | | //items service quantity |
| | | @Column(comment = "执行数量" , length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String quantity; |
| | | |
| | | //medicalDepartment |
| | | @Column(comment = "医疗科室", type = MySqlTypeConstant.TEXT) |
| | | private String medicalDepartment; |
| | | |
| | | //operators |
| | | @Column(comment = "参与人信息", type = MySqlTypeConstant.TEXT) |
| | | private String participants; |
| | | |
| | | //costs |
| | | @Column(comment = "耗用品", type = MySqlTypeConstant.TEXT) |
| | | private String costItems; |
| | | //devices |
| | | @Column(comment = "治疗参数", type = MySqlTypeConstant.TEXT) |
| | | private String devices; |
| | | |
| | | @Column(comment = "是否处理 (0:待处理 1 处理完成 2 处理失败)", length = 1, type = MySqlTypeConstant.INT) |
| | | private Integer whetherToHandle=NO; |
| | | |
| | | public HisExecutionRecord() { |
| | | } |
| | | |
| | | public HisExecutionRecord(String hisId, String itemId, String number, String amount, String executedDate, String note, String customer, String clinic, String cancelled, String cancelledDate, String creator, String quantity, String medicalDepartment, String participants, String costItems, String devices) { |
| | | this.hisId = hisId; |
| | | this.itemId = itemId; |
| | | this.number = number; |
| | | this.amount = amount; |
| | | this.executedDate = executedDate; |
| | | this.note = note; |
| | | this.customer = customer; |
| | | this.clinic = clinic; |
| | | this.cancelled = cancelled; |
| | | this.cancelledDate = cancelledDate; |
| | | this.creator = creator; |
| | | this.quantity = quantity; |
| | | this.medicalDepartment = medicalDepartment; |
| | | this.participants = participants; |
| | | this.costItems = costItems; |
| | | this.devices = devices; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "his_order_item") |
| | | @Data |
| | | public class HisOrderItem extends BaseEntity { |
| | | |
| | | @Column(comment = "领建id", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String itemId; |
| | | |
| | | //orderId |
| | | @Column(comment = "领建订单id", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String orderId; |
| | | //transferId |
| | | @Column(comment = "转增id", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String transferId; |
| | | |
| | | //item |
| | | @Column(comment = "条目信息", type = MySqlTypeConstant.TEXT) |
| | | private String item; |
| | | |
| | | //skuId,skuName |
| | | @Column(comment = "订单行SKU", type = MySqlTypeConstant.TEXT) |
| | | private String skuInfo; |
| | | |
| | | //totalTransactionPrice 后续记得除100 领建存的是分 |
| | | @Column(comment = "执行总金额", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String amount; |
| | | //amortization payment amount之和 后续记得除100 领建存的是分 |
| | | @Column(comment = "未执行划扣金额", type = MySqlTypeConstant.TEXT) |
| | | private String remain; |
| | | |
| | | //organization |
| | | @Column(comment = "执行门店", type = MySqlTypeConstant.TEXT) |
| | | private String clinic; |
| | | |
| | | //customer |
| | | @Column(comment = "客户信息", type = MySqlTypeConstant.TEXT) |
| | | private String customer; |
| | | |
| | | //executableNumber |
| | | @Column(comment = "可执行总次数", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String totalTimes; |
| | | |
| | | //quantity |
| | | @Column(comment = "可执行总次数(冗余)", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String quantity; |
| | | |
| | | //refunded |
| | | @Column(comment = "退款次数", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String refunded; |
| | | |
| | | //executedNumber |
| | | @Column(comment = "已执行次数", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String executedNumber; |
| | | |
| | | //总数 - refunded-executedNumber |
| | | @Column(comment = "剩余可执行次数", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String leftTimes; |
| | | |
| | | //status 里面的value |
| | | @Column(comment = "状态", type = MySqlTypeConstant.TEXT) |
| | | private String status; |
| | | |
| | | //item.type |
| | | @Column(comment = "项目类型", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String type; |
| | | |
| | | //orderTime |
| | | @Column(comment = "创建时间", type = MySqlTypeConstant.TEXT) |
| | | private String createdAt; |
| | | @Column(comment = "是否处理 (0:待处理 1 处理完成 2 处理失败)", length = 1, type = MySqlTypeConstant.INT) |
| | | private Integer whetherToHandle=NO; |
| | | |
| | | public HisOrderItem() { |
| | | } |
| | | |
| | | public HisOrderItem(String itemId, String orderId, String transferId, String item, String skuInfo, String amount, String remain, String clinic, String customer, String totalTimes, String quantity, String refunded, String executedNumber, String leftTimes, String status, String type, String createdAt) { |
| | | this.itemId = itemId; |
| | | this.orderId = orderId; |
| | | this.transferId = transferId; |
| | | this.item = item; |
| | | this.skuInfo = skuInfo; |
| | | this.amount = amount; |
| | | this.remain = remain; |
| | | this.clinic = clinic; |
| | | this.customer = customer; |
| | | this.totalTimes = totalTimes; |
| | | this.quantity = quantity; |
| | | this.refunded = refunded; |
| | | this.executedNumber = executedNumber; |
| | | this.leftTimes = leftTimes; |
| | | this.status = status; |
| | | this.type = type; |
| | | this.createdAt = createdAt; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "his_order_item_record") |
| | | @Data |
| | | public class HisOrderItemRecord extends BaseEntity { |
| | | |
| | | @Column(comment = "领建id", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String itemId; |
| | | |
| | | @Column(comment = "转换表id(HisOrderItem)", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String hisOrderItemId; |
| | | |
| | | @Column(comment = "用户id(User)", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String userId; |
| | | |
| | | @Column(comment = "操作类型 0:新增 1:修改 ", length = 1, type = MySqlTypeConstant.VARCHAR) |
| | | private Integer operationType; |
| | | |
| | | public HisOrderItemRecord() { |
| | | } |
| | | |
| | | public HisOrderItemRecord(String itemId, String hisOrderItemId, String userId, Integer operationType) { |
| | | this.itemId = itemId; |
| | | this.hisOrderItemId = hisOrderItemId; |
| | | this.userId = userId; |
| | | this.operationType = operationType; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Index; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "his_v_visit_record") |
| | | @Data |
| | | public class HisVisitRecord extends BaseEntity { |
| | | |
| | | @Column(comment = "领建到访id", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String hisId; |
| | | //customer._id |
| | | @Column(comment = "用户标识", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String userId; |
| | | @Column(comment = "用户姓名", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String userName; |
| | | //organization._id |
| | | @Column(comment = "门店标识", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String shopId; |
| | | @Column(comment = "门店名称", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String shopName; |
| | | //arriveTime |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="到店时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date arrivalTime; |
| | | //receptTime |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="接待时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date receptTime; |
| | | //leaveTime |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="离开时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date leaveTime; |
| | | |
| | | @Column(comment = "是否处理 (0:待处理 1 处理完成 2 处理失败)", length = 1, type = MySqlTypeConstant.INT) |
| | | private Integer whetherToHandle=NO; |
| | | |
| | | |
| | | public HisVisitRecord() { |
| | | } |
| | | |
| | | public HisVisitRecord(String hisId, String userId, String userName, String shopId, String shopName, Date arrivalTime, Integer whetherToHandle) { |
| | | this.hisId = hisId; |
| | | this.userId = userId; |
| | | this.userName = userName; |
| | | this.shopId = shopId; |
| | | this.shopName = shopName; |
| | | this.arrivalTime = arrivalTime; |
| | | this.whetherToHandle = whetherToHandle; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | /**发送企业服务小心实体类*/ |
| | | public class ReturnModel { |
| | | |
| | | /**返回码:0的时候发送成功*/ |
| | | private int errcode = 9999; |
| | | /**错误信息,成功的时候返回:ok*/ |
| | | private String errmsg; |
| | | |
| | | /**无法接收的用户*/ |
| | | private String invaliduser; |
| | | /**无法接收的部门*/ |
| | | private String invalidparty; |
| | | /**无法接收的标签*/ |
| | | private String invalidtag; |
| | | |
| | | public ReturnModel() { |
| | | } |
| | | |
| | | public int getErrcode() { |
| | | return errcode; |
| | | } |
| | | |
| | | public void setErrcode(int errcode) { |
| | | this.errcode = errcode; |
| | | } |
| | | |
| | | public String getErrmsg() { |
| | | return errmsg; |
| | | } |
| | | |
| | | public void setErrmsg(String errmsg) { |
| | | this.errmsg = errmsg; |
| | | } |
| | | |
| | | public String getInvaliduser() { |
| | | return invaliduser; |
| | | } |
| | | |
| | | public void setInvaliduser(String invaliduser) { |
| | | this.invaliduser = invaliduser; |
| | | } |
| | | |
| | | public String getInvalidparty() { |
| | | return invalidparty; |
| | | } |
| | | |
| | | public void setInvalidparty(String invalidparty) { |
| | | this.invalidparty = invalidparty; |
| | | } |
| | | |
| | | public String getInvalidtag() { |
| | | return invalidtag; |
| | | } |
| | | |
| | | public void setInvalidtag(String invalidtag) { |
| | | this.invalidtag = invalidtag; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ReturnModel{" + |
| | | "errcode=" + errcode + |
| | | ", errmsg='" + errmsg + '\'' + |
| | | ", invaliduser='" + invaliduser + '\'' + |
| | | ", invalidparty='" + invalidparty + '\'' + |
| | | ", invalidtag='" + invalidtag + '\'' + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author 预约日志 |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "sync_appointment") |
| | | public class SyncAppointmentRecord extends BaseEntity { |
| | | |
| | | @Column(comment = "请求参数", type = MySqlTypeConstant.TEXT) |
| | | private String requestParameters; |
| | | @Column(comment = "返回参数", type = MySqlTypeConstant.TEXT) |
| | | private String returnParameters; |
| | | @Column(comment = "外键id (OrderTotal)", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String foreignKeyId; |
| | | |
| | | // 同步类型 1 初始化 2定时 3 场景触发 4心跳 |
| | | @Column(comment = "同步类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer type; |
| | | //操作类型 1 创建预约 2 取消预约 3 确认预约 4修改预约 5到访 |
| | | @Column(comment = "操作类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer operationType; |
| | | // 请求状态 1成功 2失败 创建,取消,确认,修改预约的时候才会有值用来重新发送 |
| | | @Column(comment = "请求状态", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer status; |
| | | @Column(comment = "成功次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer successNumber; |
| | | |
| | | @Column(comment = "失败次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer failNumber; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="开始时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="结束时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date endTime; |
| | | |
| | | public SyncAppointmentRecord(String requestParameters, String returnParameters, String foreignKeyId, Integer type, Integer operationType, Integer status, Integer successNumber, Integer failNumber, Date startTime, Date endTime) { |
| | | this.requestParameters = requestParameters; |
| | | this.returnParameters = returnParameters; |
| | | this.foreignKeyId = foreignKeyId; |
| | | this.type = type; |
| | | this.operationType = operationType; |
| | | this.status = status; |
| | | this.successNumber = successNumber; |
| | | this.failNumber = failNumber; |
| | | this.startTime = startTime; |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public SyncAppointmentRecord() { |
| | | } |
| | | |
| | | public String getRequestParameters() { |
| | | return requestParameters; |
| | | } |
| | | |
| | | public void setRequestParameters(String requestParameters) { |
| | | this.requestParameters = requestParameters; |
| | | } |
| | | |
| | | public String getReturnParameters() { |
| | | return returnParameters; |
| | | } |
| | | |
| | | public void setReturnParameters(String returnParameters) { |
| | | this.returnParameters = returnParameters; |
| | | } |
| | | |
| | | public String getForeignKeyId() { |
| | | return foreignKeyId; |
| | | } |
| | | |
| | | public void setForeignKeyId(String foreignKeyId) { |
| | | this.foreignKeyId = foreignKeyId; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getOperationType() { |
| | | return operationType; |
| | | } |
| | | |
| | | public void setOperationType(Integer operationType) { |
| | | this.operationType = operationType; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Integer getSuccessNumber() { |
| | | return successNumber; |
| | | } |
| | | |
| | | public void setSuccessNumber(Integer successNumber) { |
| | | this.successNumber = successNumber; |
| | | } |
| | | |
| | | public Integer getFailNumber() { |
| | | return failNumber; |
| | | } |
| | | |
| | | public void setFailNumber(Integer failNumber) { |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author 张旭 基础信息同步日志 |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "sync_basic_information") |
| | | public class SyncBasicInformationRecord extends BaseEntity { |
| | | |
| | | //请求参数 |
| | | @Column(comment = "请求参数", type = MySqlTypeConstant.TEXT) |
| | | private String requestParameters; |
| | | //返回参数 |
| | | @Column(comment = "返回参数", type = MySqlTypeConstant.TEXT) |
| | | private String returnParameters; |
| | | //1 初始化 2定时 3 场景触发 4心跳 |
| | | @Column(comment = "同步类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer type; |
| | | //1 渠道 2 设备参数 3 员工 4 物料分类 5 商品 6 门店 7 科室 8诊所的治疗房间,手术房间 9标签 10 仓库 11 库存 12:咨询记录 13:病例模板 14:病例 15:处方模板 16:处方 17:会员等级变更记录 |
| | | @Column(comment = "模块", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer modular; |
| | | |
| | | @Column(comment = "成功次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer successNumber; |
| | | |
| | | @Column(comment = "失败次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer failNumber; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="开始时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="结束时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date endTime; |
| | | |
| | | |
| | | public SyncBasicInformationRecord() { |
| | | } |
| | | |
| | | public SyncBasicInformationRecord(Integer type, Integer modular, Integer successNumber, Integer failNumber) { |
| | | this.type = type; |
| | | this.modular = modular; |
| | | this.successNumber = successNumber; |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public String getRequestParameters() { |
| | | return requestParameters; |
| | | } |
| | | |
| | | public void setRequestParameters(String requestParameters) { |
| | | this.requestParameters = requestParameters; |
| | | } |
| | | |
| | | public String getReturnParameters() { |
| | | return returnParameters; |
| | | } |
| | | |
| | | public void setReturnParameters(String returnParameters) { |
| | | this.returnParameters = returnParameters; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getModular() { |
| | | return modular; |
| | | } |
| | | |
| | | public void setModular(Integer modular) { |
| | | this.modular = modular; |
| | | } |
| | | |
| | | public Integer getSuccessNumber() { |
| | | return successNumber; |
| | | } |
| | | |
| | | public void setSuccessNumber(Integer successNumber) { |
| | | this.successNumber = successNumber; |
| | | } |
| | | |
| | | public Integer getFailNumber() { |
| | | return failNumber; |
| | | } |
| | | |
| | | public void setFailNumber(Integer failNumber) { |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 同步划扣日志表 |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "sync_executable_record") |
| | | public class SyncExecutionRecord extends BaseEntity { |
| | | |
| | | |
| | | @Column(comment = "请求参数", type = MySqlTypeConstant.TEXT) |
| | | private String requestParameters; |
| | | @Column(comment = "返回参数", type = MySqlTypeConstant.TEXT) |
| | | private String returnParameters; |
| | | @Column(comment = "外键id (DeductionSingle)", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String foreignKeyId; |
| | | |
| | | // 同步类型 1 初始化 2定时 3 场景触发 4心跳 |
| | | @Column(comment = "同步类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer type; |
| | | |
| | | //操作类型 1 主动划扣 2 同步可划扣 3 同步已划扣 4 修改划扣 5 修改已划扣 6 作废已划扣 |
| | | @Column(comment = "操作类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer operationType; |
| | | |
| | | @Column(comment = "成功次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer successNumber; |
| | | |
| | | @Column(comment = "失败次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer failNumber; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="开始时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="结束时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date endTime; |
| | | |
| | | public SyncExecutionRecord() { |
| | | } |
| | | |
| | | public SyncExecutionRecord(String requestParameters, String returnParameters, Integer type, Integer operationType, Integer successNumber, Integer failNumber, Date startTime) { |
| | | this.requestParameters = requestParameters; |
| | | this.returnParameters = returnParameters; |
| | | this.type = type; |
| | | this.operationType = operationType; |
| | | this.successNumber = successNumber; |
| | | this.failNumber = failNumber; |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getRequestParameters() { |
| | | return requestParameters; |
| | | } |
| | | |
| | | public void setRequestParameters(String requestParameters) { |
| | | this.requestParameters = requestParameters; |
| | | } |
| | | |
| | | public String getReturnParameters() { |
| | | return returnParameters; |
| | | } |
| | | |
| | | public void setReturnParameters(String returnParameters) { |
| | | this.returnParameters = returnParameters; |
| | | } |
| | | |
| | | public String getForeignKeyId() { |
| | | return foreignKeyId; |
| | | } |
| | | |
| | | public void setForeignKeyId(String foreignKeyId) { |
| | | this.foreignKeyId = foreignKeyId; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getOperationType() { |
| | | return operationType; |
| | | } |
| | | |
| | | public void setOperationType(Integer operationType) { |
| | | this.operationType = operationType; |
| | | } |
| | | |
| | | public Integer getSuccessNumber() { |
| | | return successNumber; |
| | | } |
| | | |
| | | public void setSuccessNumber(Integer successNumber) { |
| | | this.successNumber = successNumber; |
| | | } |
| | | |
| | | public Integer getFailNumber() { |
| | | return failNumber; |
| | | } |
| | | |
| | | public void setFailNumber(Integer failNumber) { |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author 康博嘉预约日志 |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "sync_koap_appointment") |
| | | public class SyncKoapAppointmentRecord extends BaseEntity { |
| | | @Column(comment = "请求参数", type = MySqlTypeConstant.TEXT) |
| | | private String requestParameters; |
| | | @Column(comment = "返回参数", type = MySqlTypeConstant.TEXT) |
| | | private String returnParameters; |
| | | |
| | | //操作类型 1 创建预约 2 修改预约 3 作废预约 |
| | | @Column(comment = "操作类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer operationType; |
| | | |
| | | @Column(comment = "成功次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer successNumber; |
| | | |
| | | @Column(comment = "失败次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer failNumber; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="开始时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="结束时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date endTime; |
| | | |
| | | public SyncKoapAppointmentRecord() { |
| | | } |
| | | |
| | | public SyncKoapAppointmentRecord(String requestParameters, String returnParameters, Integer operationType, Integer successNumber, Integer failNumber, Date startTime) { |
| | | this.requestParameters = requestParameters; |
| | | this.returnParameters = returnParameters; |
| | | this.operationType = operationType; |
| | | this.successNumber = successNumber; |
| | | this.failNumber = failNumber; |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getRequestParameters() { |
| | | return requestParameters; |
| | | } |
| | | |
| | | public void setRequestParameters(String requestParameters) { |
| | | this.requestParameters = requestParameters; |
| | | } |
| | | |
| | | public String getReturnParameters() { |
| | | return returnParameters; |
| | | } |
| | | |
| | | public void setReturnParameters(String returnParameters) { |
| | | this.returnParameters = returnParameters; |
| | | } |
| | | |
| | | public Integer getOperationType() { |
| | | return operationType; |
| | | } |
| | | |
| | | public void setOperationType(Integer operationType) { |
| | | this.operationType = operationType; |
| | | } |
| | | |
| | | public Integer getSuccessNumber() { |
| | | return successNumber; |
| | | } |
| | | |
| | | public void setSuccessNumber(Integer successNumber) { |
| | | this.successNumber = successNumber; |
| | | } |
| | | |
| | | public Integer getFailNumber() { |
| | | return failNumber; |
| | | } |
| | | |
| | | public void setFailNumber(Integer failNumber) { |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 同步订单日志表 |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "sync_orders_total") |
| | | public class SyncOrderTotal extends BaseEntity { |
| | | |
| | | @Column(comment = "请求参数", type = MySqlTypeConstant.TEXT) |
| | | private String requestParameters; |
| | | @Column(comment = "返回参数", type = MySqlTypeConstant.TEXT) |
| | | private String returnParameters; |
| | | @Column(comment = "外键id (OrderTotal)", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String foreignKeyId; |
| | | // 同步类型 1 初始化 2定时 3 场景触发 4心跳 |
| | | @Column(comment = "同步类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer type; |
| | | |
| | | //操作类型 1 订单 2 结账 3 部分退款 4全退款 5 作废 |
| | | @Column(comment = "操作类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer operationType; |
| | | |
| | | //请求次数 创建订单,支付,退款的时候才会有值用来重新发送 |
| | | @Column(comment = "请求次数", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer sendingQuantity; |
| | | // 请求状态 1成功 2失败 创建订单,支付,退款的时候才会有值用来重新发送 |
| | | @Column(comment = "请求状态", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer status; |
| | | |
| | | @Column(comment = "成功次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer successNumber; |
| | | |
| | | @Column(comment = "失败次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer failNumber; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="开始时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="结束时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date endTime; |
| | | |
| | | public SyncOrderTotal() { |
| | | } |
| | | |
| | | public SyncOrderTotal(Integer type, Integer operationType, Integer successNumber, Integer failNumber) { |
| | | this.type = type; |
| | | this.operationType = operationType; |
| | | this.successNumber = successNumber; |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public String getRequestParameters() { |
| | | return requestParameters; |
| | | } |
| | | |
| | | public void setRequestParameters(String requestParameters) { |
| | | this.requestParameters = requestParameters; |
| | | } |
| | | |
| | | public String getReturnParameters() { |
| | | return returnParameters; |
| | | } |
| | | |
| | | public void setReturnParameters(String returnParameters) { |
| | | this.returnParameters = returnParameters; |
| | | } |
| | | |
| | | public String getForeignKeyId() { |
| | | return foreignKeyId; |
| | | } |
| | | |
| | | public void setForeignKeyId(String foreignKeyId) { |
| | | this.foreignKeyId = foreignKeyId; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getOperationType() { |
| | | return operationType; |
| | | } |
| | | |
| | | public void setOperationType(Integer operationType) { |
| | | this.operationType = operationType; |
| | | } |
| | | |
| | | public Integer getSendingQuantity() { |
| | | return sendingQuantity; |
| | | } |
| | | |
| | | public void setSendingQuantity(Integer sendingQuantity) { |
| | | this.sendingQuantity = sendingQuantity; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Integer getSuccessNumber() { |
| | | return successNumber; |
| | | } |
| | | |
| | | public void setSuccessNumber(Integer successNumber) { |
| | | this.successNumber = successNumber; |
| | | } |
| | | |
| | | public Integer getFailNumber() { |
| | | return failNumber; |
| | | } |
| | | |
| | | public void setFailNumber(Integer failNumber) { |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author 同步项目,卡项,促销相关日志 |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "sync_project") |
| | | public class SyncProjectRecord extends BaseEntity { |
| | | //请求参数 |
| | | @Column(comment = "请求参数", type = MySqlTypeConstant.TEXT) |
| | | private String requestParameters; |
| | | //返回参数 |
| | | @Column(comment = "返回参数", type = MySqlTypeConstant.TEXT) |
| | | private String returnParameters; |
| | | //1 初始化 2定时 3 场景触发 4心跳 |
| | | @Column(comment = "同步类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer type; |
| | | //操作类型 1 新增 2 修改 |
| | | @Column(comment = "操作类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer operationType; |
| | | //1 项目分类 2 项目 3 卡项 4 促销 |
| | | @Column(comment = "模块", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer modular; |
| | | @Column(comment = "成功次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer successNumber; |
| | | |
| | | @Column(comment = "失败次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer failNumber; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="开始时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="结束时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date endTime; |
| | | |
| | | public SyncProjectRecord() { |
| | | } |
| | | |
| | | public SyncProjectRecord(Integer type, Integer modular, Integer successNumber, Integer failNumber) { |
| | | this.type = type; |
| | | this.modular = modular; |
| | | this.successNumber = successNumber; |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public String getRequestParameters() { |
| | | return requestParameters; |
| | | } |
| | | |
| | | public void setRequestParameters(String requestParameters) { |
| | | this.requestParameters = requestParameters; |
| | | } |
| | | |
| | | public String getReturnParameters() { |
| | | return returnParameters; |
| | | } |
| | | |
| | | public void setReturnParameters(String returnParameters) { |
| | | this.returnParameters = returnParameters; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getModular() { |
| | | return modular; |
| | | } |
| | | |
| | | public void setModular(Integer modular) { |
| | | this.modular = modular; |
| | | } |
| | | |
| | | public Integer getSuccessNumber() { |
| | | return successNumber; |
| | | } |
| | | |
| | | public void setSuccessNumber(Integer successNumber) { |
| | | this.successNumber = successNumber; |
| | | } |
| | | |
| | | public Integer getFailNumber() { |
| | | return failNumber; |
| | | } |
| | | |
| | | public void setFailNumber(Integer failNumber) { |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public Integer getOperationType() { |
| | | return operationType; |
| | | } |
| | | |
| | | public void setOperationType(Integer operationType) { |
| | | this.operationType = operationType; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 同步用户账号增值金,储值金,积分日志表 |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "sync_user_account") |
| | | public class SyncUserAccountRecord extends BaseEntity { |
| | | //请求参数 |
| | | @Column(comment = "请求参数", type = MySqlTypeConstant.TEXT) |
| | | private String requestParameters; |
| | | //返回参数 |
| | | @Column(comment = "返回参数", type = MySqlTypeConstant.TEXT) |
| | | private String returnParameters; |
| | | //外键id user表id |
| | | @Column(comment = "外键id (user)", length = 64, type = MySqlTypeConstant.VARCHAR) |
| | | private String foreignKeyId; |
| | | //1 初始化 2定时 3 场景触发 4心跳 |
| | | @Column(comment = "同步类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer type; |
| | | //操作类型,1积分 2增值金 (只有场景触发的时候这才有值) |
| | | @Column(comment = "操作类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer operationType; |
| | | @Column(comment = "成功次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer successNumber; |
| | | //次数 |
| | | @Column(comment = "失败次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer failNumber; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="开始时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="结束时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date endTime; |
| | | |
| | | public SyncUserAccountRecord() { |
| | | } |
| | | |
| | | public SyncUserAccountRecord(String requestParameters, String returnParameters, String foreignKeyId, Integer type, Integer successNumber, Integer failNumber) { |
| | | this.requestParameters = requestParameters; |
| | | this.returnParameters = returnParameters; |
| | | this.foreignKeyId = foreignKeyId; |
| | | this.type = type; |
| | | this.successNumber = successNumber; |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Integer getOperationType() { |
| | | return operationType; |
| | | } |
| | | |
| | | public void setOperationType(Integer operationType) { |
| | | this.operationType = operationType; |
| | | } |
| | | |
| | | public String getRequestParameters() { |
| | | return requestParameters; |
| | | } |
| | | |
| | | public void setRequestParameters(String requestParameters) { |
| | | this.requestParameters = requestParameters; |
| | | } |
| | | |
| | | public String getReturnParameters() { |
| | | return returnParameters; |
| | | } |
| | | |
| | | public void setReturnParameters(String returnParameters) { |
| | | this.returnParameters = returnParameters; |
| | | } |
| | | |
| | | public String getForeignKeyId() { |
| | | return foreignKeyId; |
| | | } |
| | | |
| | | public void setForeignKeyId(String foreignKeyId) { |
| | | this.foreignKeyId = foreignKeyId; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getSuccessNumber() { |
| | | return successNumber; |
| | | } |
| | | |
| | | public void setSuccessNumber(Integer successNumber) { |
| | | this.successNumber = successNumber; |
| | | } |
| | | |
| | | public Integer getFailNumber() { |
| | | return failNumber; |
| | | } |
| | | |
| | | public void setFailNumber(Integer failNumber) { |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 同步用户卡包日志表 |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "sync_user_card") |
| | | public class SyncUserCardRecord extends BaseEntity { |
| | | //请求参数 |
| | | @Column(comment = "请求参数", type = MySqlTypeConstant.TEXT) |
| | | private String requestParameters; |
| | | //返回参数 |
| | | @Column(comment = "返回参数", type = MySqlTypeConstant.TEXT) |
| | | private String returnParameters; |
| | | |
| | | //1 初始化 2定时 3 场景触发 4心跳 |
| | | @Column(comment = "同步类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer type; |
| | | |
| | | @Column(comment = "成功次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer successNumber; |
| | | //次数 |
| | | @Column(comment = "失败次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer failNumber; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="开始时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="结束时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date endTime; |
| | | |
| | | public SyncUserCardRecord() { |
| | | } |
| | | |
| | | public SyncUserCardRecord(String requestParameters, Integer type, Integer successNumber, Integer failNumber, Date startTime) { |
| | | this.requestParameters = requestParameters; |
| | | this.type = type; |
| | | this.successNumber = successNumber; |
| | | this.failNumber = failNumber; |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getRequestParameters() { |
| | | return requestParameters; |
| | | } |
| | | |
| | | public void setRequestParameters(String requestParameters) { |
| | | this.requestParameters = requestParameters; |
| | | } |
| | | |
| | | public String getReturnParameters() { |
| | | return returnParameters; |
| | | } |
| | | |
| | | public void setReturnParameters(String returnParameters) { |
| | | this.returnParameters = returnParameters; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getSuccessNumber() { |
| | | return successNumber; |
| | | } |
| | | |
| | | public void setSuccessNumber(Integer successNumber) { |
| | | this.successNumber = successNumber; |
| | | } |
| | | |
| | | public Integer getFailNumber() { |
| | | return failNumber; |
| | | } |
| | | |
| | | public void setFailNumber(Integer failNumber) { |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Column; |
| | | import com.gitee.sunchenbin.mybatis.actable.annotation.Table; |
| | | import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author 张旭 |
| | | * 2024-04-24 废弃该表 |
| | | */ |
| | | //@Table(name = "sync_user_picture") |
| | | public class SyncUserPictureRcord extends BaseEntity { |
| | | |
| | | //请求参数 |
| | | @Column(comment = "请求参数", type = MySqlTypeConstant.TEXT) |
| | | private String requestParameters; |
| | | |
| | | //1 初始化 2定时 3 场景触发 4心跳 |
| | | @Column(comment = "同步类型", length = 2, type = MySqlTypeConstant.TINYINT) |
| | | private Integer type; |
| | | |
| | | @Column(comment = "成功次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer successNumber; |
| | | //次数 |
| | | @Column(comment = "失败次数", length = 8, type = MySqlTypeConstant.INT) |
| | | private Integer failNumber; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="开始时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @Column(comment="结束时间",type = MySqlTypeConstant.DATETIME) |
| | | private Date endTime; |
| | | |
| | | public SyncUserPictureRcord() { |
| | | } |
| | | |
| | | public String getRequestParameters() { |
| | | return requestParameters; |
| | | } |
| | | |
| | | public void setRequestParameters(String requestParameters) { |
| | | this.requestParameters = requestParameters; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getSuccessNumber() { |
| | | return successNumber; |
| | | } |
| | | |
| | | public void setSuccessNumber(Integer successNumber) { |
| | | this.successNumber = successNumber; |
| | | } |
| | | |
| | | public Integer getFailNumber() { |
| | | return failNumber; |
| | | } |
| | | |
| | | public void setFailNumber(Integer failNumber) { |
| | | this.failNumber = failNumber; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.uti; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import com.hx.phiappt.model.SystemParameter; |
| | | import com.hx.phip.common.HisUrl; |
| | | import com.hx.phip.common.KoapUrl; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.util.HttpMethodUtil; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 同步接口工具 |
| | | */ |
| | | public class ApiUtil { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ApiUtil.class); |
| | | |
| | | /** |
| | | * 获取PoiAPI访问token |
| | | * @param service |
| | | * @param appId |
| | | * @param code |
| | | * @param secret |
| | | * @return |
| | | */ |
| | | public static String getPoiApiAccessToken(SystemParameterMapper service |
| | | , String appId, String code, String secret |
| | | , String baseUrl) { |
| | | |
| | | SqlSentence ss = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("isDel", BaseEntity.NO); |
| | | map.put("paramName", appId); |
| | | ss.sqlSentence("SELECT * FROM system_parameter WHERE isDel = #{m.isDel} and paramName = #{m.paramName}",map); |
| | | SystemParameter sp = service.selectOne(ss); |
| | | |
| | | int needGetAgain = 1; |
| | | if(sp != null && !StringUtils.isEmpty(sp.getParamValue1())) { |
| | | //需要判断一下是否过期 |
| | | Calendar ca = Calendar.getInstance(); |
| | | long curTime = ca.getTimeInMillis(); |
| | | curTime=curTime/1000;//注意换数据到token换成永久有效那个 有效时间设置长一点 |
| | | if(curTime < Long.parseLong(sp.getParamValue1()) ) { |
| | | needGetAgain = 0; |
| | | } |
| | | } |
| | | |
| | | if(needGetAgain == 1) { |
| | | |
| | | String result = getToken(appId, code, secret, baseUrl); |
| | | if(!StringUtils.isEmpty(result)) |
| | | { |
| | | JSONObject reObj = JSONObject.fromObject(result); |
| | | if(reObj != null) { |
| | | reObj = reObj.getJSONObject("data"); |
| | | } |
| | | |
| | | if(reObj != null) |
| | | { |
| | | String at = reObj.optString("accessToken"); |
| | | String ea = reObj.optString("expireAt"); |
| | | if(!StringUtils.isEmpty(at)) |
| | | { |
| | | if(sp == null) { |
| | | sp = new SystemParameter(); |
| | | } |
| | | |
| | | sp.setCreateTime(new Date()); |
| | | sp.setParamName(appId); |
| | | sp.setParamValue(at); |
| | | sp.setParamValue1(ea); |
| | | |
| | | if(StringUtils.isEmpty(sp.getId())) { |
| | | service.insert(sp); |
| | | }else{ |
| | | service.updateAll(sp); |
| | | } |
| | | }else{ |
| | | logger.error("获取token,返回没有token:" + reObj.toString()); |
| | | } |
| | | }else{ |
| | | logger.error("获取token,返回没有:" + result); |
| | | } |
| | | }else{ |
| | | logger.error("获取token,返回没有"); |
| | | } |
| | | } |
| | | |
| | | if(sp != null) { |
| | | return sp.getParamValue(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | /** |
| | | * 获取poi token |
| | | * @param appId |
| | | * @param code |
| | | * @param secret |
| | | */ |
| | | public static String getToken( String appId, String code, String secret, String baseUrl) { |
| | | JSONObject param = new JSONObject(); |
| | | param.put("appId", appId); |
| | | param.put("code", code); |
| | | param.put("secret", secret); |
| | | String datas = HttpMethodUtil.HttpURLUtilJson(baseUrl+ HisUrl.BILLING_TOKEN, null, param, null, "POST"); |
| | | return datas; |
| | | } |
| | | /** |
| | | * 获取OpenAPI访问token |
| | | * @param service |
| | | * @param appId |
| | | * @param code |
| | | * @param secret |
| | | * @return |
| | | */ |
| | | public synchronized static String getOpenApiAccessToken(SystemParameterMapper service |
| | | , String appId, String code, String secret |
| | | , String baseUrl) { |
| | | |
| | | SqlSentence ss = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("isDel", BaseEntity.NO); |
| | | map.put("paramName","sync_"+appId); |
| | | ss.sqlSentence("SELECT * FROM system_parameter WHERE isDel = #{m.isDel} and paramName = #{m.paramName}",map); |
| | | SystemParameter sp = service.selectOne(ss); |
| | | |
| | | int needGetAgain = 1; |
| | | if(sp != null && !StringUtils.isEmpty(sp.getParamValue1())) { |
| | | //需要判断一下是否过期 |
| | | Calendar ca = Calendar.getInstance(); |
| | | //提前1分钟过期 |
| | | long curTime = ca.getTimeInMillis()+60000; |
| | | if(curTime < Long.parseLong(sp.getParamValue1()) ) { |
| | | needGetAgain = 0; |
| | | } |
| | | } |
| | | |
| | | if(needGetAgain == 1) { |
| | | |
| | | String result = getOpenToken(appId, code, secret, baseUrl); |
| | | if(!StringUtils.isEmpty(result)) |
| | | { |
| | | JSONObject reObj = JSONObject.fromObject(result); |
| | | |
| | | if(reObj != null) |
| | | { |
| | | String at = reObj.optString("accessToken"); |
| | | String ea = reObj.optString("expireAt"); |
| | | if(!StringUtils.isEmpty(at)) |
| | | { |
| | | if(sp == null) { |
| | | sp = new SystemParameter(); |
| | | } |
| | | |
| | | sp.setCreateTime(new Date()); |
| | | sp.setParamName("sync_"+appId); |
| | | sp.setParamValue(at); |
| | | sp.setParamValue1(ea); |
| | | synchronized (SystemParameterMapper.class) { |
| | | if (StringUtils.isEmpty(sp.getId())) { |
| | | service.insert(sp); |
| | | } else { |
| | | service.updateAll(sp); |
| | | } |
| | | } |
| | | }else{ |
| | | logger.error("获取token,返回没有token:" + reObj.toString()); |
| | | } |
| | | }else{ |
| | | logger.error("获取token,返回没有:" + result); |
| | | } |
| | | }else{ |
| | | logger.error("获取token,返回没有"); |
| | | } |
| | | } |
| | | |
| | | if(sp != null) { |
| | | return sp.getParamValue(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | /** |
| | | * 获取领健 token |
| | | * @param appId |
| | | * @param code |
| | | * @param secret |
| | | */ |
| | | public static String getOpenToken( String appId, String code, String secret, String baseUrl) { |
| | | JSONObject param = new JSONObject(); |
| | | param.put("appId", appId); |
| | | param.put("code", code); |
| | | param.put("secret", secret); |
| | | String datas = HisHttpUtil.HttpURLUtilJson(baseUrl+ HisUrl.BILLING_TOKEN, param.toString(), null, null, "POST"); |
| | | return datas; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取KOAP访问token |
| | | * @param service |
| | | * @param appId |
| | | * @param code |
| | | * @param secret |
| | | * @return |
| | | */ |
| | | public static String getKoapApiAccessToken(SystemParameterMapper service |
| | | , String appId, String code, String secret |
| | | , String baseUrl) { |
| | | |
| | | SqlSentence ss = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("isDel", BaseEntity.NO); |
| | | map.put("paramName", appId); |
| | | ss.sqlSentence("SELECT * FROM system_parameter WHERE isDel = #{m.isDel} and paramName = #{m.paramName}",map); |
| | | SystemParameter sp = service.selectOne(ss); |
| | | |
| | | int needGetAgain = 1; |
| | | Calendar ca = Calendar.getInstance(); |
| | | long curTime = ca.getTimeInMillis(); |
| | | if(sp != null && !StringUtils.isEmpty(sp.getParamValue1())) { |
| | | //需要判断一下是否过期 |
| | | if(curTime < Long.parseLong(sp.getParamValue1()) ) { |
| | | needGetAgain = 0; |
| | | } |
| | | } |
| | | |
| | | if(needGetAgain == 1) { |
| | | |
| | | String result = getKoapToken(appId, code, secret, baseUrl); |
| | | if(!StringUtils.isEmpty(result)) |
| | | { |
| | | JSONObject reObj = JSONObject.fromObject(result); |
| | | |
| | | if(reObj != null) |
| | | { |
| | | String at = reObj.optString("access_token"); |
| | | long ea = reObj.optLong("expires_in"); |
| | | if(!StringUtils.isEmpty(at)) |
| | | { |
| | | if(sp == null) { |
| | | sp = new SystemParameter(); |
| | | } |
| | | |
| | | sp.setCreateTime(new Date()); |
| | | sp.setParamName(appId); |
| | | sp.setParamValue(at); |
| | | sp.setParamValue1( String.valueOf(curTime+(ea*1000))); |
| | | |
| | | if(StringUtils.isEmpty(sp.getId())) { |
| | | service.insert(sp); |
| | | }else{ |
| | | service.updateAll(sp); |
| | | } |
| | | }else{ |
| | | logger.error("获取token,返回没有token:" + reObj.toString()); |
| | | } |
| | | }else{ |
| | | logger.error("获取token,返回没有:" + result); |
| | | } |
| | | }else{ |
| | | logger.error("获取token,返回没有"); |
| | | } |
| | | } |
| | | |
| | | if(sp != null) { |
| | | return sp.getParamValue(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | /** |
| | | * 获取领健 token |
| | | * @param appId |
| | | * @param code |
| | | * @param secret |
| | | */ |
| | | public static String getKoapToken( String appId, String code, String secret, String baseUrl) { |
| | | JSONObject param = new JSONObject(); |
| | | param.put("client_id", appId); |
| | | param.put("client_secret", secret); |
| | | param.put("grant_type", code); |
| | | String datas = HisHttpUtil.HttpURLUtilJson(baseUrl+ KoapUrl.OBTAIN_TOKEN, null, param, null, "POST"); |
| | | return datas; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.uti; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.SystemParameter; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.util.DateUtil; |
| | | import com.hx.util.SimpleTool; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | |
| | | public class CreateNo { |
| | | |
| | | private static final String[] COLOR_ARR = new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}; |
| | | |
| | | /** |
| | | * 创建随机16位进制字符 |
| | | * @param num |
| | | * @return |
| | | */ |
| | | public static String createHex(int num) |
| | | { |
| | | String str = ""; |
| | | Random random = new Random(); |
| | | for(int i = 0;i < num;i ++) |
| | | { |
| | | str += COLOR_ARR[random.nextInt(16)]; |
| | | } |
| | | |
| | | return str; |
| | | } |
| | | |
| | | /**创建含时间的订单号 |
| | | * |
| | | * @param mapper mapper |
| | | * @param key 唯一前缀 |
| | | * @param length 数字长度 |
| | | * @param format 时间格式 |
| | | * @return yyyy |
| | | */ |
| | | public static synchronized String createTimeNo(SystemParameterMapper mapper, String key, |
| | | int length, String format) { |
| | | if (!SimpleTool.checkNotNull(key)) { |
| | | throw new RuntimeException("no keyNo"); |
| | | } |
| | | if(!SimpleTool.checkNotNull(length)){ |
| | | length = 7; |
| | | } |
| | | if(!SimpleTool.checkNotNull(format)){ |
| | | format = "yyyyMMddHHmmSS"; |
| | | } |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("paramName",key); |
| | | sqlSentence.sqlSentence("SELECT * FROM system_parameter WHERE paramName = #{m.paramName}",map); |
| | | SystemParameter parameter = mapper.selectOne(sqlSentence); |
| | | if (parameter == null) { |
| | | parameter = new SystemParameter(); |
| | | parameter.setParamName(key); |
| | | parameter.setParamValue(SystemParameter.paramValueData(key)); |
| | | parameter.setParamValue1("1"); |
| | | mapper.insert(parameter); |
| | | } |
| | | |
| | | String value = parameter.getParamValue1(); |
| | | |
| | | //判断位数 |
| | | int no; |
| | | no = Integer.parseInt(value); |
| | | if(value.length()>length){ |
| | | value = "1"; |
| | | no = 1; |
| | | }else{ |
| | | no += 1; |
| | | } |
| | | |
| | | StringBuilder s = new StringBuilder(); |
| | | for (int i = value.length(); i < length; i++) { |
| | | s.append("0"); |
| | | } |
| | | s.append(value); |
| | | |
| | | parameter.setParamValue1(Integer.toString(no)); |
| | | mapper.updateAll(parameter); |
| | | |
| | | String prefix = DateUtil.dateFormat(new Date(),format); |
| | | return parameter.getParamName()+prefix+s; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.uti; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.concurrent.LinkedBlockingQueue; |
| | | import java.util.concurrent.ThreadPoolExecutor; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | |
| | | /** |
| | | * 创建线程池的,主要避免线程队列超,导致服务器爆了 |
| | | */ |
| | | public class ExecutorServiceTool { |
| | | |
| | | /**log4j日志*/ |
| | | private static Logger logger = LoggerFactory.getLogger(ExecutorServiceTool.class.getName()); |
| | | |
| | | /**线程池-获取队列的*/ |
| | | private ThreadPoolExecutor threadPool; |
| | | /**最大队列*/ |
| | | private int maxQueue; |
| | | |
| | | public ExecutorServiceTool() { |
| | | } |
| | | |
| | | public ExecutorServiceTool(int initTread, int maxQueue) { |
| | | createThread(initTread,maxQueue); |
| | | } |
| | | |
| | | /**创建线程池 |
| | | * @param initTread 初始化线程池 |
| | | * @param maxQueue 最大队列新增队列,注意:这里只做传值,不限制真对 |
| | | * 线程池限制队列,因为限制了会报错,导致数据丢失 |
| | | * @return |
| | | */ |
| | | public ThreadPoolExecutor createThread(int initTread,int maxQueue){ |
| | | this.threadPool = new ThreadPoolExecutor(initTread, initTread, |
| | | 0L, TimeUnit.MILLISECONDS, |
| | | new LinkedBlockingQueue<Runnable>()); |
| | | this.maxQueue = maxQueue; |
| | | return this.threadPool; |
| | | } |
| | | |
| | | /**针对最大的队列,如果没有超过返回是false的,超过就返回是true的 |
| | | * 单返回true的时候,就不要传入队列了 |
| | | * @param sleepMillisecond 睡眠,毫秒秒,如果是空的,那么直接返回 |
| | | * @return |
| | | */ |
| | | public boolean noRund(Integer sleepMillisecond){ |
| | | if(threadPool.getQueue().size() > maxQueue){ |
| | | if(sleepMillisecond != null && sleepMillisecond > 0){ |
| | | try{ |
| | | Thread.sleep(sleepMillisecond); |
| | | }catch (Exception e){ |
| | | logger.error("线程池开启睡眠失败!"); |
| | | } |
| | | } |
| | | return true; |
| | | }else{ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /**关闭*/ |
| | | public void shutdown(){ |
| | | this.threadPool.shutdown(); |
| | | } |
| | | |
| | | /****************************************************************************************/ |
| | | |
| | | public int getMaxQueue() { |
| | | return maxQueue; |
| | | } |
| | | |
| | | public void setMaxQueue(int maxQueue) { |
| | | this.maxQueue = maxQueue; |
| | | } |
| | | |
| | | public ThreadPoolExecutor getThreadPool() { |
| | | return threadPool; |
| | | } |
| | | |
| | | public void setThreadPool(ThreadPoolExecutor threadPool) { |
| | | this.threadPool = threadPool; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.uti; |
| | | |
| | | import com.hx.util.StringUtils; |
| | | import okhttp3.*; |
| | | import org.apache.commons.io.IOUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * his http 工具类 |
| | | */ |
| | | public class HisHttpUtil { |
| | | |
| | | /** 请求http协议 获取信息工具 |
| | | * @param url 请求链接 |
| | | * @param data 请求数据(body) |
| | | * @param keyValues form表单数据 key参数名称,value参数值 |
| | | * @param header 请求头 |
| | | * @param requestMethod 请求头方法,默认POST |
| | | * @return |
| | | */ |
| | | public static String HttpURLUtilJson(String url, String data, Map<String,Object> keyValues, Map<String,String> header, String requestMethod) { |
| | | HttpURLConnection con = null; |
| | | URL u = null; |
| | | String wxMsgXml = null; |
| | | try { |
| | | StringBuilder dataP = new StringBuilder(); |
| | | if (keyValues != null && !keyValues.isEmpty()) { |
| | | for (Map.Entry<String, Object> entry : keyValues.entrySet()) { |
| | | dataP.append((String)entry.getKey()).append("="); |
| | | dataP.append(entry.getValue()); |
| | | dataP.append("&"); |
| | | } |
| | | System.out.println("dataP:"+dataP.toString()); |
| | | dataP.deleteCharAt(dataP.length() - 1); |
| | | url = url+"?"+dataP; |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(requestMethod)){ |
| | | requestMethod = "POST"; |
| | | } |
| | | u = new URL(url); |
| | | con = (HttpURLConnection) u.openConnection(); |
| | | con.setRequestMethod(requestMethod); |
| | | con.setDoOutput(true); |
| | | con.setDoInput(true); |
| | | con.setUseCaches(false); |
| | | con.setReadTimeout(300000); |
| | | con.setRequestProperty("Charset", "UTF-8"); |
| | | con.setRequestProperty("Content-Type", "application/json"); |
| | | if(header != null){ |
| | | for (Map.Entry<String, String> entry : header.entrySet()) { |
| | | con.setRequestProperty(entry.getKey(),entry.getValue()); |
| | | } |
| | | } |
| | | |
| | | if (data != null) { |
| | | OutputStream os = con.getOutputStream(); |
| | | os.write(data.getBytes("utf-8")); |
| | | } |
| | | if (con.getResponseCode() != 200 && con.getResponseCode() != 201&& con.getResponseCode() != 204){ |
| | | throw new RuntimeException("请求url失败:"+con.getResponseCode()); |
| | | } |
| | | // 读取返回内容 |
| | | wxMsgXml = IOUtils.toString(con.getInputStream(), "utf-8"); |
| | | // //System.out.println("HttpURLUtil:"+wxMsgXml); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (con != null) { |
| | | con.disconnect(); |
| | | } |
| | | } |
| | | return wxMsgXml; |
| | | } |
| | | /** 请求http协议 获取信息工具 |
| | | * @param url 请求链接 |
| | | * @param data 请求数据(body) |
| | | * @param token token |
| | | * @param requestMethod 请求头方法,默认POST |
| | | * @return |
| | | */ |
| | | public static Response postOkHttp(String url, String data,String token,String requestMethod) { |
| | | int timeout=300000;//设置请求响应时间 |
| | | OkHttpClient client = new OkHttpClient().newBuilder() |
| | | .connectTimeout(timeout, TimeUnit.SECONDS) |
| | | .readTimeout(timeout, TimeUnit.SECONDS) |
| | | .writeTimeout(timeout, TimeUnit.SECONDS) |
| | | .build(); |
| | | |
| | | |
| | | MediaType mediaType = MediaType.parse("application/json"); |
| | | RequestBody body = RequestBody.create(mediaType, data); |
| | | Request request = new Request.Builder() |
| | | .url(url) |
| | | .method(requestMethod, body) |
| | | .addHeader("x-access-token", token) |
| | | .addHeader("Content-Type", "application/json") |
| | | .build(); |
| | | Response response = null; |
| | | try { |
| | | response = client.newCall(request).execute(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return response; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.uti; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * mongodb 工具类 |
| | | */ |
| | | public class MongoDBUtil { |
| | | |
| | | /** |
| | | * 将date转成ISODate 以便mongo识别 |
| | | * |
| | | * @param date 时间 |
| | | * @return 返回时间 |
| | | */ |
| | | public static Date dateToISODate(Date date) { |
| | | Date parse = null; |
| | | try { |
| | | // 解析字符串时间 |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); |
| | | parse = format.parse(format.format(date)); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return parse; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.uti; |
| | | |
| | | |
| | | import com.hx.util.DateUtil; |
| | | import com.hx.util.StringUtils; |
| | | import org.apache.commons.lang3.RandomStringUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | | |
| | | /** |
| | | * 编号生成工具类 |
| | | * |
| | | * @author fwq |
| | | * Date: 2021-11-23 |
| | | */ |
| | | public class NumberNoUtil { |
| | | |
| | | |
| | | /** |
| | | * 生成带前缀的UUID |
| | | * |
| | | * @param length 生成长度 |
| | | * @param prefix 前缀 |
| | | */ |
| | | public static String prefixUuid(String prefix, Integer length) { |
| | | int uuidLength = length - prefix.length(); |
| | | if (uuidLength <= 0) { |
| | | return prefix.substring(0, length); |
| | | } else if (uuidLength <= 32) { |
| | | return prefix + UUID.randomUUID().toString().replaceAll("-", "").substring(0, uuidLength); |
| | | } else { |
| | | StringBuilder str = new StringBuilder(prefix); |
| | | for (int i = 0; i < (uuidLength / 32) - 1; i++) { |
| | | str.append(UUID.randomUUID().toString().replaceAll("-", "")); |
| | | } |
| | | str.append(UUID.randomUUID().toString().replaceAll("-", "").substring(0, (uuidLength % 32))); |
| | | return str.toString(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成随机位数UUID |
| | | * |
| | | * @param length 生成长度 |
| | | */ |
| | | public static String uuidNo(Integer length) { |
| | | if (length <= 0) { |
| | | return UUID.randomUUID().toString().replaceAll("-", "").substring(0, 16); |
| | | } else if (length > 32) { |
| | | StringBuilder str = new StringBuilder(UUID.randomUUID().toString().replaceAll("-", "")); |
| | | for (int i = 0; i < (length / 32) - 1; i++) { |
| | | str.append(UUID.randomUUID().toString().replaceAll("-", "")); |
| | | } |
| | | str.append(UUID.randomUUID().toString().replaceAll("-", "").substring(0, (length % 32))); |
| | | return str.toString(); |
| | | } else { |
| | | return UUID.randomUUID().toString().replaceAll("-", "").substring(0, length); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成无前缀含年月日的编号 |
| | | * 格式:8位年月日+随机数 |
| | | * @param length 总长度 |
| | | * */ |
| | | public static String getNum(Integer length) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (length != null && length >= 0){ |
| | | String date = DateUtil.dateFormat(new Date(), "yyyyMMdd"); |
| | | if (length <= 8){ |
| | | sb.append(date,0,length); |
| | | }else{ |
| | | sb.append(date); |
| | | sb.append(RandomStringUtils.randomAlphanumeric(length - 8)); |
| | | } |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 生成带前缀含年月日的编号 |
| | | * 格式:前缀+8位年月日+随机数 |
| | | * @param prefix 前缀 |
| | | * @param length 总长度 |
| | | * */ |
| | | public static String getPrefixNum(String prefix,Integer length) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (!StringUtils.isEmpty(prefix) && length >= 0){ |
| | | String date = DateUtil.dateFormat(new Date(), "yyyyMMdd"); |
| | | if (length <= prefix.length()){ |
| | | sb.append(prefix, 0, length); |
| | | }else if (length <= prefix.length()+8){ |
| | | sb.append(prefix); |
| | | sb.append(date, 0, length-prefix.length()); |
| | | }else { |
| | | sb.append(prefix); |
| | | sb.append(date); |
| | | sb.append(RandomStringUtils.randomAlphanumeric((length-prefix.length()-date.length()))); |
| | | } |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.uti; |
| | | |
| | | /** |
| | | * 分页参数工具类 |
| | | * |
| | | * @author fwq |
| | | * @date 2021-9-1 |
| | | */ |
| | | public class PageUtil { |
| | | |
| | | public static final int PAGE_NUMBER_INIT = 1; |
| | | public static final int PAGE_SIZE_INIT = 20; |
| | | public static final int MAX_PAGE_SIZE = 100; |
| | | |
| | | /** |
| | | * @param pageNum 页码 |
| | | */ |
| | | public static Integer getPageNum(Integer pageNum) { |
| | | if (pageNum == null || pageNum <= 0) { |
| | | return PAGE_NUMBER_INIT; |
| | | } |
| | | return pageNum; |
| | | } |
| | | |
| | | /** |
| | | * @param pageSize 每页数量 |
| | | */ |
| | | public static Integer getPageSize(Integer pageSize) { |
| | | if (pageSize == null || pageSize <= 0 || pageSize >= MAX_PAGE_SIZE) { |
| | | return MAX_PAGE_SIZE; |
| | | } |
| | | return pageSize; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.uti; |
| | | |
| | | import com.hx.exception.TipsException; |
| | | import com.hx.mp.util.CorpMpUtil; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.model.ReturnModel; |
| | | import com.hx.util.DateUtil; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class WeChatApiUtil { |
| | | private static Logger logger = LoggerFactory.getLogger(WeChatApiUtil.class); |
| | | /** |
| | | * 同步订单失败发送企业微信提醒 |
| | | * @return |
| | | */ |
| | | public static void sendAppointment(String at,String corpId, String appSecret,String appId,String touser,String source){ |
| | | net.sf.json.JSONObject datas = new net.sf.json.JSONObject(); |
| | | datas.put("touser",touser);//接收成员的手机号码,多个格式:id|id |
| | | datas.put("msgtype","miniprogram_notice"); |
| | | |
| | | JSONObject miniprogram_notice =new JSONObject(); |
| | | miniprogram_notice.put("appid",appId); |
| | | miniprogram_notice.put("title","订单同步失败"); |
| | | miniprogram_notice.put("description", DateUtil.formatDate(new Date(),"MM-dd HH:mm:ss")); |
| | | |
| | | //展示消息体 |
| | | JSONArray content_items = new JSONArray(); |
| | | |
| | | JSONObject content_item = new JSONObject(); |
| | | content_item.put("key","平台名称"); |
| | | content_item.put("value","同步中心"); |
| | | content_items.add(content_item); |
| | | |
| | | |
| | | content_item = new JSONObject(); |
| | | content_item.put("key","备注"); |
| | | content_item.put("value",source+"订单同步失败"); |
| | | content_items.add(content_item); |
| | | |
| | | miniprogram_notice.put("content_item",content_items); |
| | | |
| | | |
| | | datas.put("miniprogram_notice",miniprogram_notice); |
| | | |
| | | logger.info("发送信息:"+datas.toString()); |
| | | //企业小程序信息 |
| | | JSONObject returnData = CorpMpUtil.messageSend(at,datas.toString()); |
| | | ReturnModel returnModel = (ReturnModel) JSONObject.toBean(returnData,ReturnModel.class); |
| | | //errcode不为0的时候发送不成功 |
| | | if(returnModel.getErrcode()!=0){ |
| | | throw new TipsException("发送企业服务消息失败:"+returnModel.toString()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 同步订单失败发送企业微信提醒 |
| | | * @return |
| | | */ |
| | | public static void sendSyncAppointment(String at,String appId,String touser,String source){ |
| | | net.sf.json.JSONObject datas = new net.sf.json.JSONObject(); |
| | | datas.put("touser",touser);//接收成员的手机号码,多个格式:id|id |
| | | datas.put("msgtype","miniprogram_notice"); |
| | | |
| | | JSONObject miniprogram_notice =new JSONObject(); |
| | | miniprogram_notice.put("appid",appId); |
| | | miniprogram_notice.put("title","同步失败"); |
| | | miniprogram_notice.put("description", DateUtil.formatDate(new Date(),"MM-dd HH:mm:ss")); |
| | | |
| | | //展示消息体 |
| | | JSONArray content_items = new JSONArray(); |
| | | |
| | | JSONObject content_item = new JSONObject(); |
| | | content_item.put("key","平台名称"); |
| | | content_item.put("value","同步中心"); |
| | | content_items.add(content_item); |
| | | |
| | | |
| | | content_item = new JSONObject(); |
| | | content_item.put("key","备注"); |
| | | content_item.put("value",source); |
| | | content_items.add(content_item); |
| | | |
| | | miniprogram_notice.put("content_item",content_items); |
| | | |
| | | |
| | | datas.put("miniprogram_notice",miniprogram_notice); |
| | | |
| | | logger.info("发送信息:"+datas.toString()); |
| | | //企业小程序信息 |
| | | JSONObject returnData = CorpMpUtil.messageSend(at,datas.toString()); |
| | | ReturnModel returnModel = (ReturnModel) JSONObject.toBean(returnData,ReturnModel.class); |
| | | //errcode不为0的时候发送不成功 |
| | | if(returnModel.getErrcode()!=0){ |
| | | throw new TipsException("发送企业服务消息失败:"+returnModel.toString()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.uti; |
| | | |
| | | import com.hx.mp.util.CorpMpUtil; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import com.hx.phiappt.model.SystemParameter; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 微信小程序工具类 |
| | | */ |
| | | public class WeiXinCorpMpUtil { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(WeiXinCorpMpUtil.class); |
| | | |
| | | |
| | | /** |
| | | * 获取企业微信应用access_token |
| | | * @param service |
| | | * @param appId |
| | | * @param appSecret |
| | | * @return |
| | | */ |
| | | public static String getApplicationAccessToken(SystemParameterMapper service, String appId, String appSecret) { |
| | | |
| | | SqlSentence ss = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("isDel", BaseEntity.NO); |
| | | map.put("paramName", SystemParameter.KEY_MP_ACCESS_TOKEN + appSecret); |
| | | ss.sqlSentence("select * from system_parameter where isDel = #{m.isDel} and paramName = #{m.paramName}",map); |
| | | SystemParameter sp = service.selectOne(ss); |
| | | |
| | | int needGetAgain = 1; |
| | | if(sp != null) { |
| | | //需要判断一下是否过期 |
| | | Calendar ca = Calendar.getInstance(); |
| | | long curTime = ca.getTimeInMillis(); |
| | | ca.setTime(sp.getCreateTime()); |
| | | ca.add(Calendar.SECOND, Integer.parseInt(sp.getParamValue1())); |
| | | if(curTime < ca.getTimeInMillis()) { |
| | | needGetAgain = 0; |
| | | } |
| | | } |
| | | |
| | | if(needGetAgain == 1) { |
| | | //需要重新获取 |
| | | JSONObject reObj = CorpMpUtil.getApplicationAccessToken(appId, appSecret); |
| | | if(reObj != null) { |
| | | if(reObj.optInt("errcode", -1) == 0) { |
| | | if(sp == null) { |
| | | sp = new SystemParameter(); |
| | | } |
| | | sp.setCreateTime(new Date()); |
| | | sp.setParamName(SystemParameter.KEY_MP_ACCESS_TOKEN + appSecret); |
| | | sp.setParamValue(reObj.optString("access_token")); |
| | | sp.setParamValue1(reObj.optInt("expires_in",7200) + ""); |
| | | |
| | | if(StringUtils.isEmpty(sp.getId())) |
| | | { |
| | | service.insert(sp); |
| | | }else{ |
| | | service.updateAll(sp); |
| | | } |
| | | }else{ |
| | | logger.error("获取企业应用at失败:" + reObj.toString()); |
| | | } |
| | | }else{ |
| | | logger.error("获取企业应用at失败,没返回"); |
| | | } |
| | | } |
| | | |
| | | if(sp != null) |
| | | { |
| | | return sp.getParamValue(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** 获取扫码登陆的用户身份 */ |
| | | public static JSONObject getLoginUserInfo(String accessToken, String code){ |
| | | String url = MessageFormat.format("https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={0}&code={1}", accessToken, code); |
| | | JSONObject obj = CorpMpUtil.HttpURLUtil(url, (String)null); |
| | | return obj; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.phi.HisAccountJournalMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,hisId = #{hisId},customerId = #{customerId},createTimestamp = #{createTimestamp},type = #{type},recordType = #{recordType},opType = #{opType},opNumber = #{opNumber},opBeforeNumber = #{opBeforeNumber},opAfterNumber = #{opAfterNumber},operatorId = #{operatorId},remarks = #{remarks},whetherToHandle = #{whetherToHandle},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.HisAccountJournal"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into his_account_journal (id,hisId,customerId,createTimestamp,type,recordType,opType,opNumber,opBeforeNumber,opAfterNumber,operatorId,remarks,whetherToHandle,isDel,createTime,editTime) values (#{id},#{hisId},#{customerId},#{createTimestamp},#{type},#{recordType},#{opType},#{opNumber},#{opBeforeNumber},#{opAfterNumber},#{operatorId},#{remarks},#{whetherToHandle},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <insert id="insertById" parameterType="com.hx.phip.model.HisAccountJournal"> |
| | | insert into his_account_journal (id,hisId,customerId,createTimestamp,type,recordType,opType,opNumber,opBeforeNumber,opAfterNumber,operatorId,remarks,whetherToHandle,isDel,createTime,editTime) values (#{id},#{hisId},#{customerId},#{createTimestamp},#{type},#{recordType},#{opType},#{opNumber},#{opBeforeNumber},#{opAfterNumber},#{operatorId},#{remarks},#{whetherToHandle},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.HisAccountJournal" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.HisAccountJournal" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from his_account_journal |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.HisAccountJournal" parameterType="java.lang.Object" > |
| | | select |
| | | id,hisId,customerId,createTimestamp,type,recordType,opType,opNumber,opBeforeNumber,opAfterNumber,operatorId,remarks,whetherToHandle,isDel,createTime,editTime |
| | | from his_account_journal |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.HisAccountJournal" parameterType="java.lang.Object" > |
| | | select |
| | | id,hisId,customerId,createTimestamp,type,recordType,opType,opNumber,opBeforeNumber,opAfterNumber,operatorId,remarks,whetherToHandle,isDel,createTime,editTime |
| | | from his_account_journal |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | his_account_journal |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.HisAccountJournal"> |
| | | update his_account_journal |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from his_account_journal WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from his_account_journal WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.phi.HisExecutionRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,hisId = #{hisId},itemId = #{itemId},number = #{number},amount = #{amount},executedDate = #{executedDate},note = #{note},customer = #{customer},clinic = #{clinic},cancelled = #{cancelled},cancelledDate = #{cancelledDate},creator = #{creator},quantity = #{quantity},medicalDepartment = #{medicalDepartment},participants = #{participants},costItems = #{costItems},devices = #{devices},whetherToHandle = #{whetherToHandle},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.HisExecutionRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into his_execution_record (id,hisId,itemId,number,amount,executedDate,note,customer,clinic,cancelled,cancelledDate,creator,quantity,medicalDepartment,participants,costItems,devices,whetherToHandle,isDel,createTime,editTime) values (#{id},#{hisId},#{itemId},#{number},#{amount},#{executedDate},#{note},#{customer},#{clinic},#{cancelled},#{cancelledDate},#{creator},#{quantity},#{medicalDepartment},#{participants},#{costItems},#{devices},#{whetherToHandle},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <insert id="insertById" parameterType="com.hx.phip.model.HisExecutionRecord"> |
| | | insert into his_execution_record (id,hisId,itemId,number,amount,executedDate,note,customer,clinic,cancelled,cancelledDate,creator,quantity,medicalDepartment,participants,costItems,devices,whetherToHandle,isDel,createTime,editTime) values (#{id},#{hisId},#{itemId},#{number},#{amount},#{executedDate},#{note},#{customer},#{clinic},#{cancelled},#{cancelledDate},#{creator},#{quantity},#{medicalDepartment},#{participants},#{costItems},#{devices},#{whetherToHandle},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.HisExecutionRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.HisExecutionRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from his_execution_record |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.HisExecutionRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,hisId,itemId,number,amount,executedDate,note,customer,clinic,cancelled,cancelledDate,creator,quantity,medicalDepartment,participants,costItems,devices,whetherToHandle,isDel,createTime,editTime |
| | | from his_execution_record |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.HisExecutionRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,hisId,itemId,number,amount,executedDate,note,customer,clinic,cancelled,cancelledDate,creator,quantity,medicalDepartment,participants,costItems,devices,whetherToHandle,isDel,createTime,editTime |
| | | from his_execution_record |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | his_execution_record |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.HisExecutionRecord"> |
| | | update his_execution_record |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from his_execution_record WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from his_execution_record WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.phi.HisOrderItemMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,itemId = #{itemId},orderId = #{orderId},transferId = #{transferId},item = #{item},skuInfo = #{skuInfo},amount = #{amount},remain = #{remain},clinic = #{clinic},customer = #{customer},totalTimes = #{totalTimes},quantity = #{quantity},refunded = #{refunded},executedNumber = #{executedNumber},leftTimes = #{leftTimes},status = #{status},type = #{type},createdAt = #{createdAt},whetherToHandle = #{whetherToHandle},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.HisOrderItem"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into his_order_item (id,itemId,orderId,transferId,item,skuInfo,amount,remain,clinic,customer,totalTimes,quantity,refunded,executedNumber,leftTimes,status,type,createdAt,whetherToHandle,isDel,createTime,editTime) values (#{id},#{itemId},#{orderId},#{transferId},#{item},#{skuInfo},#{amount},#{remain},#{clinic},#{customer},#{totalTimes},#{quantity},#{refunded},#{executedNumber},#{leftTimes},#{status},#{type},#{createdAt},#{whetherToHandle},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <insert id="insertById" parameterType="com.hx.phip.model.HisOrderItem"> |
| | | insert into his_order_item (id,itemId,orderId,transferId,item,skuInfo,amount,remain,clinic,customer,totalTimes,quantity,refunded,executedNumber,leftTimes,status,type,createdAt,whetherToHandle,isDel,createTime,editTime) values (#{id},#{itemId},#{orderId},#{transferId},#{item},#{skuInfo},#{amount},#{remain},#{clinic},#{customer},#{totalTimes},#{quantity},#{refunded},#{executedNumber},#{leftTimes},#{status},#{type},#{createdAt},#{whetherToHandle},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.HisOrderItem" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.HisOrderItem" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from his_order_item |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.HisOrderItem" parameterType="java.lang.Object" > |
| | | select |
| | | id,itemId,orderId,transferId,item,skuInfo,amount,remain,clinic,customer,totalTimes,quantity,refunded,executedNumber,leftTimes,status,type,createdAt,whetherToHandle,isDel,createTime,editTime |
| | | from his_order_item |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.HisOrderItem" parameterType="java.lang.Object" > |
| | | select |
| | | id,itemId,orderId,transferId,item,skuInfo,amount,remain,clinic,customer,totalTimes,quantity,refunded,executedNumber,leftTimes,status,type,createdAt,whetherToHandle,isDel,createTime,editTime |
| | | from his_order_item |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | his_order_item |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.HisOrderItem"> |
| | | update his_order_item |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from his_order_item WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from his_order_item WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.phi.HisOrderItemRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,itemId = #{itemId},hisOrderItemId = #{hisOrderItemId},userId = #{userId},operationType = #{operationType},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.HisOrderItemRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into his_order_item_record (id,itemId,hisOrderItemId,userId,operationType,isDel,createTime,editTime) values (#{id},#{itemId},#{hisOrderItemId},#{userId},#{operationType},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <insert id="insertById" parameterType="com.hx.phip.model.HisOrderItemRecord"> |
| | | insert into his_order_item_record (id,itemId,hisOrderItemId,userId,operationType,isDel,createTime,editTime) values (#{id},#{itemId},#{hisOrderItemId},#{userId},#{operationType},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.HisOrderItemRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.HisOrderItemRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from his_order_item_record |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.HisOrderItemRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,itemId,hisOrderItemId,userId,operationType,isDel,createTime,editTime |
| | | from his_order_item_record |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.HisOrderItemRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,itemId,hisOrderItemId,userId,operationType,isDel,createTime,editTime |
| | | from his_order_item_record |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | his_order_item_record |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.HisOrderItemRecord"> |
| | | update his_order_item_record |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from his_order_item_record WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from his_order_item_record WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package mapper.syn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.HisVisitRecord; |
| | | |
| | | public interface HisVisitRecordMapper { |
| | | /**新增,返回主键*/ |
| | | int insert(HisVisitRecord hisVisitRecord); |
| | | /**查询条数*/ |
| | | int selectCount(SqlSentence sqlSentence); |
| | | /**查询条数*/ |
| | | int selectCountSql(SqlSentence sqlSentence); |
| | | /**查询列表,返回实体类的List*/ |
| | | List<HisVisitRecord> selectList(SqlSentence sqlSentence); |
| | | /**查询列表,返回Map的List*/ |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | /**查询,返回单个实体*/ |
| | | HisVisitRecord selectOne(SqlSentence sqlSentence); |
| | | /**查询,返回单个map*/ |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | /**查询,返回实体类没有大数据的*/ |
| | | HisVisitRecord selectOneByKey(Object object); |
| | | /**查询,返回实体类有大数据的*/ |
| | | HisVisitRecord selectOneByKeyBlob(Object object); |
| | | /**更新,返回更新数量*/ |
| | | int updateWhere(SqlSentence sqlSentence); |
| | | /**更新,返回更新数量*/ |
| | | int updateAll(HisVisitRecord hisVisitRecord); |
| | | /**删除,返回删除数量*/ |
| | | int deleteWhere(SqlSentence sqlSentence); |
| | | /**删除,返回删除数量*/ |
| | | int deleteById(Object object); |
| | | } |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.phi.HisVisitRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,hisId = #{hisId},userId = #{userId},userName = #{userName},shopId = #{shopId},shopName = #{shopName},arrivalTime = #{arrivalTime},receptTime = #{receptTime},leaveTime = #{leaveTime},whetherToHandle = #{whetherToHandle},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.HisVisitRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into his_v_visit_record (id,hisId,userId,userName,shopId,shopName,arrivalTime,receptTime,leaveTime,whetherToHandle,isDel,createTime,editTime) values (#{id},#{hisId},#{userId},#{userName},#{shopId},#{shopName},#{arrivalTime},#{receptTime},#{leaveTime},#{whetherToHandle},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <insert id="insertById" parameterType="com.hx.phip.model.HisVisitRecord"> |
| | | insert into his_v_visit_record (id,hisId,userId,userName,shopId,shopName,arrivalTime,receptTime,leaveTime,whetherToHandle,isDel,createTime,editTime) values (#{id},#{hisId},#{userId},#{userName},#{shopId},#{shopName},#{arrivalTime},#{receptTime},#{leaveTime},#{whetherToHandle},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.HisVisitRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.HisVisitRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from his_v_visit_record |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.HisVisitRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,hisId,userId,userName,shopId,shopName,arrivalTime,receptTime,leaveTime,whetherToHandle,isDel,createTime,editTime |
| | | from his_v_visit_record |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.HisVisitRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,hisId,userId,userName,shopId,shopName,arrivalTime,receptTime,leaveTime,whetherToHandle,isDel,createTime,editTime |
| | | from his_v_visit_record |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | his_v_visit_record |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.HisVisitRecord"> |
| | | update his_v_visit_record |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from his_v_visit_record WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from his_v_visit_record WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncAppointmentRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},returnParameters = #{returnParameters},foreignKeyId = #{foreignKeyId},type = #{type},operationType = #{operationType},status = #{status},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncAppointmentRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_appointment (id,requestParameters,returnParameters,foreignKeyId,type,operationType,status,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{returnParameters},#{foreignKeyId},#{type},#{operationType},#{status},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncAppointmentRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncAppointmentRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_appointment |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncAppointmentRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,foreignKeyId,type,operationType,status,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_appointment |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncAppointmentRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,foreignKeyId,type,operationType,status,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_appointment |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_appointment |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncAppointmentRecord"> |
| | | update sync_appointment |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_appointment WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_appointment WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncBasicInformationRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},returnParameters = #{returnParameters},type = #{type},modular = #{modular},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncBasicInformationRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_basic_information (id,requestParameters,returnParameters,type,modular,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{returnParameters},#{type},#{modular},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncBasicInformationRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncBasicInformationRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_basic_information |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncBasicInformationRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,type,modular,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_basic_information |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncBasicInformationRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,type,modular,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_basic_information |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_basic_information |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncBasicInformationRecord"> |
| | | update sync_basic_information |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_basic_information WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_basic_information WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncExecutionRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},returnParameters = #{returnParameters},foreignKeyId = #{foreignKeyId},type = #{type},operationType = #{operationType},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncExecutionRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_executable_record (id,requestParameters,returnParameters,foreignKeyId,type,operationType,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{returnParameters},#{foreignKeyId},#{type},#{operationType},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncExecutionRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncExecutionRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_executable_record |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncExecutionRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,foreignKeyId,type,operationType,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_executable_record |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncExecutionRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,foreignKeyId,type,operationType,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_executable_record |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_executable_record |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncExecutionRecord"> |
| | | update sync_executable_record |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_executable_record WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_executable_record WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncKoapAppointmentRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},returnParameters = #{returnParameters},operationType = #{operationType},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncKoapAppointmentRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_koap_appointment (id,requestParameters,returnParameters,operationType,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{returnParameters},#{operationType},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncKoapAppointmentRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncKoapAppointmentRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_koap_appointment |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncKoapAppointmentRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,operationType,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_koap_appointment |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncKoapAppointmentRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,operationType,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_koap_appointment |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_koap_appointment |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncKoapAppointmentRecord"> |
| | | update sync_koap_appointment |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_koap_appointment WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_koap_appointment WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncOrderTotalMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},returnParameters = #{returnParameters},foreignKeyId = #{foreignKeyId},type = #{type},operationType = #{operationType},sendingQuantity = #{sendingQuantity},status = #{status},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncOrderTotal"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_orders_total (id,requestParameters,returnParameters,foreignKeyId,type,operationType,sendingQuantity,status,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{returnParameters},#{foreignKeyId},#{type},#{operationType},#{sendingQuantity},#{status},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncOrderTotal" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncOrderTotal" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_orders_total |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncOrderTotal" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,foreignKeyId,type,operationType,sendingQuantity,status,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_orders_total |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncOrderTotal" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,foreignKeyId,type,operationType,sendingQuantity,status,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_orders_total |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_orders_total |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncOrderTotal"> |
| | | update sync_orders_total |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_orders_total WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_orders_total WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncProjectRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},returnParameters = #{returnParameters},type = #{type},modular = #{modular},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncProjectRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_project (id,requestParameters,returnParameters,type,modular,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{returnParameters},#{type},#{modular},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncProjectRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncProjectRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_project |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncProjectRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,type,modular,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_project |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncProjectRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,type,modular,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_project |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_project |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncProjectRecord"> |
| | | update sync_project |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_project WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_project WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncUserAccountRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},returnParameters = #{returnParameters},foreignKeyId = #{foreignKeyId},type = #{type},operationType = #{operationType},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncUserAccountRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_user_account (id,requestParameters,returnParameters,foreignKeyId,type,operationType,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{returnParameters},#{foreignKeyId},#{type},#{operationType},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncUserAccountRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncUserAccountRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_user_account |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncUserAccountRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,foreignKeyId,type,operationType,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_user_account |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncUserAccountRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,foreignKeyId,type,operationType,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_user_account |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_user_account |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncUserAccountRecord"> |
| | | update sync_user_account |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_user_account WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_user_account WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncUserCardRecordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},returnParameters = #{returnParameters},type = #{type},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncUserCardRecord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_user_card (id,requestParameters,returnParameters,type,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{returnParameters},#{type},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncUserCardRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncUserCardRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_user_card |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncUserCardRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,type,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_user_card |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncUserCardRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,returnParameters,type,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_user_card |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_user_card |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncUserCardRecord"> |
| | | update sync_user_card |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_user_card WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_user_card WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncUserPictureMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},type = #{type},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncUserPictureRcord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_user_picture (id,requestParameters,type,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{type},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncUserPictureRcord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncUserPictureRcord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_user_picture |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncUserPictureRcord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,type,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_user_picture |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncUserPictureRcord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,type,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_user_picture |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_user_picture |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncUserPictureRcord"> |
| | | update sync_user_picture |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_user_picture WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_user_picture WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- namespace:该mapper.xml映射文件的 唯一标识 --> |
| | | <mapper namespace="com.hx.phip.dao.mapper.syn.SyncUserPictureRcordMapper"> |
| | | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,requestParameters = #{requestParameters},type = #{type},successNumber = #{successNumber},failNumber = #{failNumber},startTime = #{startTime},endTime = #{endTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | | <!-- 后续通过 namespace.id--> |
| | | <!--parameterType:输入参数的类型 |
| | | resultType:查询返回结果值的类型 ,返回类型 --> |
| | | <insert id="insert" parameterType="com.hx.phip.model.SyncUserPictureRcord"> |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into sync_user_picture (id,requestParameters,type,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime) values (#{id},#{requestParameters},#{type},#{successNumber},#{failNumber},#{startTime},#{endTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phip.model.SyncUserPictureRcord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.hx.phip.model.SyncUserPictureRcord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | select |
| | | COUNT(*) |
| | | from sync_user_picture |
| | | WHERE ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | | ${sqlSentence} |
| | | </select> |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phip.model.SyncUserPictureRcord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,type,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_user_picture |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phip.model.SyncUserPictureRcord" parameterType="java.lang.Object" > |
| | | select |
| | | id,requestParameters,type,successNumber,failNumber,startTime,endTime,isDel,createTime,editTime |
| | | from sync_user_picture |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | update |
| | | sync_user_picture |
| | | SET ${sqlSentence} |
| | | </update> |
| | | |
| | | <update id="updateAll" parameterType="com.hx.phip.model.SyncUserPictureRcord"> |
| | | update sync_user_picture |
| | | SET <include refid="Update_Column_All"/> |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteWhere" parameterType="com.hx.mybatisTool.SqlSentence"> |
| | | delete from sync_user_picture WHERE ${sqlSentence} |
| | | </delete> |
| | | |
| | | <delete id="deleteById" parameterType="java.lang.Object"> |
| | | delete from sync_user_picture WHERE id = #{value} |
| | | </delete> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <properties> |
| | | <dist>target/build</dist> |
| | | <res>target/build/resources</res> |
| | | <dist-tmp>target/build/tmp</dist-tmp> |
| | | <app-name>${project.artifactId}-${project.version}</app-name> |
| | | <real-app-name>${project.artifactId}</real-app-name> |
| | | </properties> |
| | | |
| | | <parent> |
| | | <groupId>com.hx</groupId> |
| | | <artifactId>phi-synchro</artifactId> |
| | | <version>stander</version> |
| | | </parent> |
| | | |
| | | <artifactId>phi-synchro-his-sys</artifactId> |
| | | <version>stander</version> |
| | | |
| | | <dependencies> |
| | | <!--springCloud-nacos--> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-ribbon</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-ribbon</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
| | | </dependency> |
| | | |
| | | <!--spring cloud的支持--> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-bootstrap</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-context --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-context</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-commons --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-commons</artifactId> |
| | | </dependency> |
| | | |
| | | <!--openfeign的支持--> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-openfeign</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-loadbalancer</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-log4j2</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>hx-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>phi-synchro-common</artifactId> |
| | | <version>stander</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>phi-common</artifactId> |
| | | <version>stander</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>platform-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>hx-auto</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-tomcat</artifactId> |
| | | <!--<scope>provided</scope>--> |
| | | </dependency> |
| | | |
| | | <!--数据监控平台(sql)--> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- mybatis分页 --> |
| | | <dependency> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| | | <!--排除使用logback日志--> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>logback-classic</artifactId> |
| | | <groupId>ch.qos.logback</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-aop</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.aliyun.oss</groupId> |
| | | <artifactId>aliyun-sdk-oss</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.tomcat.embed</groupId> |
| | | <artifactId>tomcat-embed-jasper</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>javax.servlet.jsp.jstl</groupId> |
| | | <artifactId>jstl-api</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>servlet-api</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>jstl</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.junit.jupiter</groupId> |
| | | <artifactId>junit-jupiter-api</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </dependency> |
| | | |
| | | <!--rabbitmq--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-amqp</artifactId> |
| | | </dependency> |
| | | |
| | | <!--<dependency> |
| | | <groupId>net.sf.json-lib</groupId> |
| | | <artifactId>json-lib</artifactId> |
| | | </dependency>--> |
| | | |
| | | </dependencies> |
| | | |
| | | <profiles> |
| | | <profile> |
| | | <id>local</id> |
| | | <properties> |
| | | <!--使用${environment}获取值--> |
| | | <environment>local</environment> |
| | | </properties> |
| | | </profile> |
| | | <profile> |
| | | <id>prod</id> |
| | | <properties> |
| | | <environment>prod</environment> |
| | | </properties> |
| | | </profile> |
| | | </profiles> |
| | | |
| | | <build> |
| | | <resources> |
| | | <resource> |
| | | <directory>src/main/java</directory> |
| | | <includes> |
| | | <include>**/*.xml</include> |
| | | </includes> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | <excludes> |
| | | <exclude>application-*.properties</exclude> |
| | | <exclude>log4j2-*.xml</exclude> |
| | | </excludes> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | <includes> |
| | | <include>application-${environment}.properties</include> |
| | | <include>log4j2-${environment}.xml</include> |
| | | </includes> |
| | | </resource> |
| | | </resources> |
| | | |
| | | <plugins> |
| | | <!--**********分离资源文件及依赖包打包配置*************--> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-dependency-plugin</artifactId> |
| | | <executions> |
| | | <execution> |
| | | <id>copy-dependencies</id> |
| | | <phase>package</phase> |
| | | <goals> |
| | | <goal>copy-dependencies</goal> |
| | | </goals> |
| | | <configuration> |
| | | <outputDirectory>target/lib</outputDirectory> |
| | | <excludeTransitive>false</excludeTransitive> |
| | | <stripVersion>false</stripVersion> |
| | | <includeScope>runtime</includeScope> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-jar-plugin</artifactId> |
| | | <configuration> |
| | | <excludes> |
| | | <exclude>**/*.properties</exclude> |
| | | <exclude>**/log4j*.xml</exclude> |
| | | <exclude>static/**</exclude> |
| | | <exclude>templates/**</exclude> |
| | | </excludes> |
| | | </configuration> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <mainClass>com.hx.phip.SyncHisApplication</mainClass> |
| | | <layout>ZIP</layout> |
| | | <includes> |
| | | <include> |
| | | <groupId>non-exists</groupId> |
| | | <artifactId>non-exists</artifactId> |
| | | </include> |
| | | </includes> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | <configuration> |
| | | <classifier>classes</classifier> |
| | | <attach>false</attach> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | <executions> |
| | | <execution> |
| | | <phase>package</phase> |
| | | <goals> |
| | | <goal>run</goal> |
| | | </goals> |
| | | <configuration> |
| | | <target> |
| | | <delete dir="${dist}" /> |
| | | <mkdir dir="${dist}" /> |
| | | <mkdir dir="${dist-tmp}" /> |
| | | <mkdir dir="${res}" /> |
| | | <copy file="target/${app-name}.jar" tofile="${dist-tmp}/${app-name}.jar" /> |
| | | <unzip src="${dist-tmp}/${app-name}.jar" dest="${dist-tmp}" /> |
| | | <delete file="${dist-tmp}/${app-name}.jar" /> |
| | | <move file="target/${app-name}-classes.jar" tofile="${dist}/${real-app-name}.jar"/> |
| | | <move todir="${dist}/lib"> |
| | | <fileset dir="target/lib" /> |
| | | </move> |
| | | |
| | | <delete dir="${dist-tmp}" /> |
| | | |
| | | <copy todir="${res}"> |
| | | <fileset dir="target/classes"> |
| | | <include name="**/static/**" /> |
| | | <include name="**/templates/**" /> |
| | | </fileset> |
| | | </copy> |
| | | <copy todir="${res}"> |
| | | <fileset dir="target/classes"> |
| | | <include name="**/*.properties" /> |
| | | <include name="**/*.xml" /> |
| | | <include name="**/*.yml" /> |
| | | <exclude name="**/*Mapper.xml"/> |
| | | </fileset> |
| | | </copy> |
| | | </target> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.hx.phip; |
| | | |
| | | import com.hx.util.AesUtil; |
| | | import com.hx.util.rsa.RSAUtil; |
| | | import org.jasypt.util.text.BasicTextEncryptor; |
| | | |
| | | public class Rsa { |
| | | public static void main(String[] args) { |
| | | |
| | | System.out.println(AesUtil.aesEncryp("ev8i6tfy9Gg0eyaF6SDyvNHcsNGNeff8enwT_eLKf_0")); |
| | | |
| | | BasicTextEncryptor encryptor = new BasicTextEncryptor(); |
| | | encryptor.setPassword(AesUtil.SECRET); |
| | | String encrypted = encryptor.encrypt("99sdfa5454a4f5asd4f55saf4"); |
| | | System.out.println(encrypted); |
| | | |
| | | //配置文件数据加密 |
| | | /*BasicTextEncryptor encryptor = new BasicTextEncryptor(); |
| | | encryptor.setPassword(AesUtil.SECRET); |
| | | String encrypted = encryptor.encrypt("pis_rw:UYWoCz#4^@w5Soj*"); |
| | | System.out.println(encrypted);*/ |
| | | //解密 |
| | | //String decrypt = encryptor.decrypt("uFESkQwpAXSxg0SUR6BOlTujZqFC3pfIi3eTfuP0Lmrd0fqxG5XC4X0ho0Sp2FEV"); |
| | | //System.out.println("decrypt:"+decrypt); |
| | | |
| | | //RSAUtil.main(null); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip; |
| | | |
| | | import com.hx.util.AesUtil; |
| | | import com.hx.phip.config.UniqueNameGenerator; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.CommandLineRunner; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.ServletComponentScan; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | |
| | | @MapperScan({"com.hx.phip.dao.*"}) |
| | | @ComponentScan(basePackages = {"com.hx.phip.*","com.hx.redis","com.hx.common.*"},nameGenerator = UniqueNameGenerator.class) |
| | | @ServletComponentScan |
| | | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) |
| | | @EnableDiscoveryClient |
| | | @EnableScheduling |
| | | @EnableFeignClients |
| | | public class SyncHisApplication extends SpringBootServletInitializer implements CommandLineRunner { |
| | | |
| | | public static void main(String[] args) { |
| | | System.setProperty("jasypt.encryptor.password", AesUtil.SECRET); |
| | | SpringApplication.run(SyncHisApplication.class, args); |
| | | } |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
| | | return builder.sources(SyncHisApplication.class); |
| | | } |
| | | |
| | | @Override |
| | | public void run(String... args) { |
| | | System.out.println("SpringBoot is Running..."); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip; |
| | | |
| | | import com.hx.exception.ServiceException; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public class Test { |
| | | public static void main(String[] args) throws IOException { |
| | | List<String> apList = new ArrayList<>(); |
| | | apList.add("1"); |
| | | apList.add("2"); |
| | | String sss="ss"; |
| | | System.out.println(apList); |
| | | System.out.println(sss); |
| | | autoAssignDeviceNo(apList,sss); |
| | | System.out.println(apList); |
| | | System.out.println(sss); |
| | | } |
| | | |
| | | |
| | | public static String autoAssignDeviceNo(List<String> apList, String sss){ |
| | | apList.add("rr"); |
| | | System.out.println("11:"+apList); |
| | | sss="111"; |
| | | System.out.println("11:"+sss); |
| | | String projectNames = "2312312"; |
| | | return projectNames; |
| | | } |
| | | |
| | | public static Integer handlePageUser(int page,int num){ |
| | | |
| | | if("pool-1-thread-1".equals(Thread.currentThread().getName()) && page==1 && num<2){ |
| | | System.out.println(Thread.currentThread().getName()+" is running:"+page+" Rtime Out 第"+num+"次"); |
| | | throw new ServiceException("Rtime Out"); |
| | | } |
| | | if("pool-1-thread-2".equals(Thread.currentThread().getName()) && page==2 && num<22){ |
| | | System.out.println(Thread.currentThread().getName()+" is running:"+page+" Rtime Out 第"+num+"次"); |
| | | throw new ServiceException("Rtime Out"); |
| | | } |
| | | System.out.println(Thread.currentThread().getName()+" is running:"+page+"成功"); |
| | | return 20; |
| | | } |
| | | |
| | | public static Integer getDifMonth(Date startDate, Date endDate){ |
| | | Calendar start = Calendar.getInstance(); |
| | | Calendar end = Calendar.getInstance(); |
| | | start.setTime(startDate); |
| | | end.setTime(endDate); |
| | | int result = end.get(Calendar.MONTH) - start.get(Calendar.MONTH); |
| | | int month = (end.get(Calendar.YEAR) - start.get(Calendar.YEAR)) * 12; |
| | | return Math.abs(month + result); |
| | | } |
| | | public void download(HttpServletResponse response, String filePath){ |
| | | File file = new File(filePath); |
| | | // 取得文件名。 |
| | | String fileName = file.getName(); |
| | | InputStream fis = null; |
| | | try { |
| | | fis = new FileInputStream(file); |
| | | response.reset(); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("application/force-download");// 设置强制下载不打开 |
| | | response.addHeader("Content-Disposition", |
| | | "attachment;filename=" + new String(fileName.getBytes("utf-8"), "iso8859-1")); |
| | | response.setHeader("Content-Length", String.valueOf(file.length())); |
| | | |
| | | byte[] b = new byte[1024]; |
| | | int len; |
| | | while ((len = fis.read(b)) != -1) { |
| | | response.getOutputStream().write(b, 0, len); |
| | | } |
| | | response.flushBuffer(); |
| | | fis.close(); |
| | | }catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.PropertySource; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 企业微信和小程序配置 |
| | | */ |
| | | @Component |
| | | public class CustomParameter { |
| | | /**加解密密钥*/ |
| | | @Value("${mysql.hxe.aes.fixd.key:}") |
| | | private String aesFixedKey; |
| | | /**公共平台地址*/ |
| | | @Value("${public.platform.url:}") |
| | | private String url; |
| | | /**RSA账号*/ |
| | | @Value("${rsa.appId:}") |
| | | private String appId; |
| | | /**公共平台公钥*/ |
| | | @Value("${public.platform.publickey:}") |
| | | private String publicKey; |
| | | /**RSA秘钥*/ |
| | | @Value("${rsa.privatekey:}") |
| | | private String privatekey; |
| | | /**平台模式*/ |
| | | @Value("${platform.pattern:}") |
| | | private String platformPattern; |
| | | //----------------------------------------------------------------------- |
| | | /**第三方平台地址*/ |
| | | @Value("${common.baseUrl:}") |
| | | private String commonBaseUrl; |
| | | /**第三方平台公钥*/ |
| | | @Value("${platform.key.public:}") |
| | | private String platformPublicKey; |
| | | /**第三方平台appid*/ |
| | | @Value("${platform.key.appid:}") |
| | | private String platformAppId; |
| | | |
| | | public CustomParameter() { |
| | | |
| | | } |
| | | |
| | | public String getAesFixedKey() { |
| | | return aesFixedKey; |
| | | } |
| | | |
| | | public void setAesFixedKey(String aesFixedKey) { |
| | | this.aesFixedKey = aesFixedKey; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getPublicKey() { |
| | | return publicKey; |
| | | } |
| | | |
| | | public void setPublicKey(String publicKey) { |
| | | this.publicKey = publicKey; |
| | | } |
| | | |
| | | public String getPrivatekey() { |
| | | return privatekey; |
| | | } |
| | | |
| | | public void setPrivatekey(String privatekey) { |
| | | this.privatekey = privatekey; |
| | | } |
| | | |
| | | public String getPlatformPattern() { |
| | | return platformPattern; |
| | | } |
| | | |
| | | public void setPlatformPattern(String platformPattern) { |
| | | this.platformPattern = platformPattern; |
| | | } |
| | | |
| | | public String getPlatformPublicKey() { |
| | | return platformPublicKey; |
| | | } |
| | | |
| | | public void setPlatformPublicKey(String platformPublicKey) { |
| | | this.platformPublicKey = platformPublicKey; |
| | | } |
| | | |
| | | public String getCommonBaseUrl() { |
| | | return commonBaseUrl; |
| | | } |
| | | |
| | | public void setCommonBaseUrl(String commonBaseUrl) { |
| | | this.commonBaseUrl = commonBaseUrl; |
| | | } |
| | | |
| | | public String getPlatformAppId() { |
| | | return platformAppId; |
| | | } |
| | | |
| | | public void setPlatformAppId(String platformAppId) { |
| | | this.platformAppId = platformAppId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import org.apache.ibatis.session.SqlSessionFactory; |
| | | import org.mybatis.spring.SqlSessionFactoryBean; |
| | | import org.mybatis.spring.SqlSessionTemplate; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.boot.jdbc.DataSourceBuilder; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Primary; |
| | | import org.springframework.core.io.support.PathMatchingResourcePatternResolver; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * Druid配置类 |
| | | */ |
| | | //@Configuration |
| | | //@MapperScan(basePackages = "com.hx.phip.dao.mapper.phi", sqlSessionTemplateRef = "phiSqlSessionTemplate") |
| | | public class DataSourcePhiConfig { |
| | | |
| | | @Bean(name = "phiDataSource") |
| | | @ConfigurationProperties(prefix = "spring.datasource.phi") |
| | | @Primary |
| | | public DataSource testDataSource() { |
| | | return DataSourceBuilder.create().build(); |
| | | } |
| | | |
| | | @Bean(name = "phiSqlSessionFactory") |
| | | @Primary |
| | | public SqlSessionFactory testSqlSessionFactory(@Qualifier("phiDataSource") DataSource dataSource) throws Exception { |
| | | SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); |
| | | bean.setDataSource(dataSource); |
| | | bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:/mapper/phi/*.xml")); |
| | | return bean.getObject(); |
| | | } |
| | | |
| | | @Bean(name = "phiTransactionManager") |
| | | @Primary |
| | | public DataSourceTransactionManager testTransactionManager(@Qualifier("phiDataSource") DataSource dataSource) { |
| | | return new DataSourceTransactionManager(dataSource); |
| | | } |
| | | |
| | | @Bean(name = "phiSqlSessionTemplate") |
| | | @Primary |
| | | public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("phiSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { |
| | | return new SqlSessionTemplate(sqlSessionFactory); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import org.apache.ibatis.session.SqlSessionFactory; |
| | | import org.mybatis.spring.SqlSessionFactoryBean; |
| | | import org.mybatis.spring.SqlSessionTemplate; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.boot.jdbc.DataSourceBuilder; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Primary; |
| | | import org.springframework.core.io.support.PathMatchingResourcePatternResolver; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * Druid配置类 |
| | | */ |
| | | //@Configuration |
| | | //@MapperScan(basePackages = "com.hx.phip.dao.mapper.syn", sqlSessionTemplateRef = "synSqlSessionTemplate") |
| | | public class DataSourceSynConfig { |
| | | |
| | | @Bean(name = "synDataSource") |
| | | @ConfigurationProperties(prefix = "spring.datasource.syn") |
| | | |
| | | public DataSource testDataSource() { |
| | | return DataSourceBuilder.create().build(); |
| | | } |
| | | |
| | | @Bean(name = "synSqlSessionFactory") |
| | | public SqlSessionFactory testSqlSessionFactory(@Qualifier("synDataSource") DataSource dataSource) throws Exception { |
| | | SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); |
| | | bean.setDataSource(dataSource); |
| | | bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:/mapper/syn/*.xml")); |
| | | return bean.getObject(); |
| | | } |
| | | |
| | | @Bean(name = "synTransactionManager") |
| | | public DataSourceTransactionManager testTransactionManager(@Qualifier("synDataSource") DataSource dataSource) { |
| | | return new DataSourceTransactionManager(dataSource); |
| | | } |
| | | |
| | | @Bean(name = "synSqlSessionTemplate") |
| | | public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("synSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { |
| | | return new SqlSessionTemplate(sqlSessionFactory); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import feign.Logger; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | //@EnableFeignClients(basePackages = "com.hz.his.controller.*") |
| | | public class DiscoveryClientConfig { |
| | | |
| | | /** |
| | | * 日志级别 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | Logger.Level feignLoggerLevel() { |
| | | return Logger.Level.FULL; |
| | | } |
| | | /** |
| | | * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public FeignRequestInterceptor basicAuthRequestInterceptor() { |
| | | System.out.println("拦截啦"); |
| | | return new FeignRequestInterceptor(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * Druid配置类 |
| | | */ |
| | | //@Configuration |
| | | public class DruidConfig { |
| | | |
| | | |
| | | |
| | | @Bean |
| | | @ConfigurationProperties(prefix = "spring.datasource") |
| | | public DataSource druidDataSource(){ |
| | | return new DruidDataSource(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import com.hx.util.rsa.RSAUtil; |
| | | import feign.RequestInterceptor; |
| | | import feign.RequestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.UUID; |
| | | |
| | | public class FeignRequestInterceptor implements RequestInterceptor { |
| | | |
| | | |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | |
| | | /** |
| | | * 统一处理feign的远程调用拦截 |
| | | */ |
| | | @Override |
| | | public void apply(RequestTemplate requestTemplate) { |
| | | System.out.println("调用拦截器"); |
| | | // 远程调用请求增加头部信息处理(简写代码如下) |
| | | requestTemplate.header("appId",systemConfig.getRsaAppId()); |
| | | requestTemplate.header("sign", createRequestSign(systemConfig.getRsaAppId(),systemConfig.getRsaPublickey(),"")); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成请求签名 |
| | | * @param pisAppId 平台appId |
| | | * @param publicKey 平台RSA公钥 |
| | | * @param encode 编码 |
| | | * @return |
| | | */ |
| | | public static String createRequestSign(String pisAppId, String publicKey, String encode) { |
| | | String meg = pisAppId+"_"+ System.currentTimeMillis()+"_" + UUID.randomUUID().toString(); |
| | | String rasSign = RSAUtil.publicEncrypt(meg,publicKey).replaceAll("\r", "").replaceAll("\n", ""); |
| | | return rasSign; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import com.hx.exception.ParamException; |
| | | import com.hx.exception.ServiceException; |
| | | import com.hx.exception.TipsException; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.platform.exception.PlatServiceException; |
| | | import com.platform.exception.PlatTipsException; |
| | | import com.platform.resultTool.PlatformCode; |
| | | import com.platform.resultTool.PlatformResult; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.jdbc.BadSqlGrammarException; |
| | | import org.springframework.validation.BindException; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.MethodArgumentNotValidException; |
| | | import org.springframework.web.bind.annotation.ExceptionHandler; |
| | | import org.springframework.web.bind.annotation.RestControllerAdvice; |
| | | import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /**统一异常处理中心 |
| | | * @author ChenJiaHe |
| | | * @date 2020-06-19 |
| | | */ |
| | | @RestControllerAdvice |
| | | public class GlobalExceptionHandler{ |
| | | |
| | | |
| | | //log4j日志 |
| | | private static Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class.getName()); |
| | | |
| | | /** |
| | | * 参数校验错误异常 |
| | | * |
| | | * @param e MethodArgumentNotValidException|BindException |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = {BindException.class, MethodArgumentNotValidException.class}) |
| | | public Result bindExceptionHandler(Exception e) { |
| | | BindingResult bindingResult; |
| | | if (e instanceof BindException) { |
| | | bindingResult = ((BindException) e).getBindingResult(); |
| | | } else { |
| | | bindingResult = ((MethodArgumentNotValidException) e).getBindingResult(); |
| | | } |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | bindingResult.getAllErrors().forEach( |
| | | objectError -> |
| | | stringBuilder.append(",").append(objectError.getDefaultMessage()) |
| | | ); |
| | | String errorMessage = stringBuilder.toString(); |
| | | errorMessage = errorMessage.substring(1, errorMessage.length()); |
| | | logger.error(getExceptionInformation(e)); |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,errorMessage); |
| | | } |
| | | |
| | | /** |
| | | * 捕获统一提示异常 |
| | | * |
| | | * @param e AbstractGlobalException |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = TipsException.class) |
| | | public Result customExceptionHandler(TipsException e) { |
| | | //和爷要求删除 |
| | | // e.printStackTrace(); |
| | | // logger.error(getExceptionInformation(e)); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 捕获统一业务/判断异常 |
| | | * |
| | | * @param e AbstractGlobalException |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = ServiceException.class) |
| | | public Result customExceptionHandler(ServiceException e) { |
| | | e.printStackTrace(); |
| | | logger.error(getExceptionInformation(e)); |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 捕获统一业务/判断异常 |
| | | * |
| | | * @param e AbstractGlobalException |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = ParamException.class) |
| | | public Result customExceptionHandler(ParamException e) { |
| | | e.printStackTrace(); |
| | | logger.error(getExceptionInformation(e)); |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 捕获未知异常 |
| | | * |
| | | * @param e Exception |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = Exception.class) |
| | | public Result commonExceptionHandler(Exception e) throws ServletException { |
| | | String errMsg = "系统错误!"; |
| | | String code=ResponseCode.ERROR_SYSTEM; |
| | | if (e instanceof ServletException) { |
| | | throw (ServletException) e; |
| | | }else if(e instanceof ArrayIndexOutOfBoundsException){ |
| | | errMsg = "系统错误(sizeErr)!"; |
| | | }else if(e instanceof FileNotFoundException){ |
| | | errMsg = "系统错误(fileNot)!"; |
| | | }else if(e instanceof IOException){ |
| | | errMsg = "系统错误(IO)!"; |
| | | }else if(e instanceof NullPointerException){ |
| | | errMsg = "系统错误(null)!"; |
| | | }else if(e instanceof BadSqlGrammarException){ |
| | | errMsg = "系统错误(sql)!"; |
| | | }else if(e instanceof MethodArgumentTypeMismatchException){ |
| | | errMsg = "系统错误(参数类型错误)!"; |
| | | }/*else if(e instanceof Serializable){ |
| | | errMsg = "签名错误!"; |
| | | code=ResponseCode.ERROR_SIGN; |
| | | }*/ |
| | | |
| | | |
| | | e.printStackTrace(); |
| | | |
| | | logger.error(getExceptionInformation(e)); |
| | | |
| | | return Result.failure(code, errMsg); |
| | | } |
| | | |
| | | /** |
| | | * 获取异常信息 |
| | | * @param ex |
| | | * @return |
| | | */ |
| | | public static String getExceptionInformation(Exception ex){ |
| | | String sOut = ex.getMessage() + "\r\n"; |
| | | StackTraceElement[] trace = ex.getStackTrace(); |
| | | for (StackTraceElement s : trace) { |
| | | sOut += "\tat " + s + "\r\n"; |
| | | } |
| | | return sOut; |
| | | }; |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | |
| | | import javax.servlet.*; |
| | | import javax.servlet.annotation.WebFilter; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | |
| | | /** XSS防御过滤器 |
| | | * @Author: ChenJiaHe |
| | | * @Date: 2020-06-21 |
| | | * * 使用注解标注过滤器 |
| | | * @WebFilter将一个实现了javax.servlet.Filter接口的类定义为过滤器 |
| | | * 属性filterName声明过滤器的名称,可选 |
| | | * 属性urlPatterns指定要过滤 的URL模式,也可使用属性value来声明.(指定要过滤的URL模式是必选属性) |
| | | */ |
| | | @WebFilter(filterName="myXssFilter", urlPatterns="/*") |
| | | public class MyXssFilter implements Filter { |
| | | |
| | | FilterConfig filterConfig = null; |
| | | |
| | | @Override |
| | | public void init(FilterConfig filterConfig) throws ServletException { |
| | | System.out.println("过滤器初始化"); |
| | | this.filterConfig = filterConfig; |
| | | } |
| | | |
| | | @Override |
| | | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { |
| | | //暂时不做防御 |
| | | /*if(getServletPath((HttpServletRequest) servletRequest).indexOf("/notify/")!=-1){ |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | }else{ |
| | | filterChain.doFilter(new XssHttpServletRequestWrapper((HttpServletRequest)servletRequest), servletResponse); |
| | | }*/ |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() { |
| | | System.out.println("过滤器销毁"); |
| | | this.filterConfig = null; |
| | | } |
| | | |
| | | private String getServletPath(HttpServletRequest request) { |
| | | String servletPath = request.getServletPath(); |
| | | System.out.println("servletPath...:"+servletPath); |
| | | if (StringUtils.isNotEmpty(servletPath)) { |
| | | return servletPath; |
| | | } else { |
| | | int startIndex = request.getContextPath().equals("") ? 0 : request.getContextPath().length(); |
| | | int endIndex = request.getRequestURI().length(); |
| | | return request.getRequestURI().substring(startIndex, endIndex); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import org.springframework.boot.autoconfigure.batch.BatchProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.scheduling.annotation.SchedulingConfigurer; |
| | | import org.springframework.scheduling.config.ScheduledTaskRegistrar; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * 前因:@Scheduled是单线程,如果有多个定时器,会造成堵塞 |
| | | * 解决:根据定时器方法来判断开启多少个线程 |
| | | * @Date: 2021-04-02 |
| | | * @author JiaHe.Chen |
| | | * |
| | | */ |
| | | @Configuration |
| | | public class ScheduleConfig implements SchedulingConfigurer { |
| | | @Override |
| | | public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { |
| | | Method[] methods = BatchProperties.Job.class.getMethods(); |
| | | int defaultPoolSize = 1; |
| | | int corePoolSize = 0; |
| | | if (methods != null && methods.length > 0) { |
| | | for (Method method : methods) { |
| | | Scheduled annotation = method.getAnnotation(Scheduled.class); |
| | | if (annotation != null) { |
| | | corePoolSize++; |
| | | } |
| | | } |
| | | if (defaultPoolSize > corePoolSize) |
| | | corePoolSize = defaultPoolSize; |
| | | } |
| | | taskRegistrar.setScheduler(Executors.newScheduledThreadPool(corePoolSize)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 系统配置 |
| | | */ |
| | | @Component |
| | | public class SystemConfig { |
| | | |
| | | |
| | | /*企业微信id*/ |
| | | @Value("${systemConfig.corpId:}") |
| | | private String corpId; |
| | | /**企业微信小程序秘钥*/ |
| | | @Value("${systemConfig.corpMpSecret:}") |
| | | private String corpMpSecret; |
| | | /**企业微信通信录密钥*/ |
| | | @Value("${systemConfig.corpAddrSecret:}") |
| | | private String corpAddrSecret; |
| | | /**小程序AppId*/ |
| | | @Value("${systemConfig.appId:}") |
| | | private String appId; |
| | | /**小程序AppSecret*/ |
| | | @Value("${systemConfig.appSecret:}") |
| | | private String appSecret; |
| | | /**文件上传保存路径*/ |
| | | @Value("${systemConfig.filePath:}") |
| | | private String filePath; |
| | | /**文件访问域名*/ |
| | | @Value("${systemConfig.fileDomain:}") |
| | | private String fileDomain; |
| | | @Value("${api.apiUrl:}") |
| | | private String apiUrl; |
| | | @Value("${api.appId:}") |
| | | private String apiAppId; |
| | | @Value("${api.code:}") |
| | | private String apiCode; |
| | | @Value("${api.secret:}") |
| | | private String apiSecret; |
| | | @Value("${systemConfig.isDev:}") |
| | | private Integer isDev; |
| | | @Value("${systemConfig.baseUrl:}") |
| | | private String baseUrl; |
| | | @Value("${systemConfig.appid:}") |
| | | private String poiAppId; |
| | | @Value("${systemConfig.secret:}") |
| | | private String poiSecret; |
| | | @Value("${systemConfig.code:}") |
| | | private String poiCode; |
| | | @Value("${systemConfig.clenit.token:}") |
| | | private String clenitToken; |
| | | @Value("${systemConfig.clenit.aeskey:}") |
| | | private String clenitAeskey; |
| | | |
| | | @Value("${dataCentre.url:}") |
| | | private String dataCentreUrl; |
| | | @Value("${rsa.appId:}") |
| | | private String rsaAppId; |
| | | |
| | | @Value("${rsa.privatekey:}") |
| | | private String rsaPrivatekey; |
| | | |
| | | @Value("${rsa.publickey:}") |
| | | private String rsaPublickey; |
| | | |
| | | |
| | | public SystemConfig() |
| | | { |
| | | |
| | | } |
| | | |
| | | public String getCorpId() { |
| | | return corpId; |
| | | } |
| | | |
| | | public void setCorpId(String corpId) { |
| | | this.corpId = corpId; |
| | | } |
| | | |
| | | public String getCorpMpSecret() { |
| | | return corpMpSecret; |
| | | } |
| | | |
| | | public void setCorpMpSecret(String corpMpSecret) { |
| | | this.corpMpSecret = corpMpSecret; |
| | | } |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getAppSecret() { |
| | | return appSecret; |
| | | } |
| | | |
| | | public void setAppSecret(String appSecret) { |
| | | this.appSecret = appSecret; |
| | | } |
| | | |
| | | public String getCorpAddrSecret() { |
| | | return corpAddrSecret; |
| | | } |
| | | |
| | | public void setCorpAddrSecret(String corpAddrSecret) { |
| | | this.corpAddrSecret = corpAddrSecret; |
| | | } |
| | | |
| | | public String getFilePath() { |
| | | return filePath; |
| | | } |
| | | |
| | | public void setFilePath(String filePath) { |
| | | this.filePath = filePath; |
| | | } |
| | | |
| | | public String getFileDomain() { |
| | | return fileDomain; |
| | | } |
| | | |
| | | public void setFileDomain(String fileDomain) { |
| | | this.fileDomain = fileDomain; |
| | | } |
| | | |
| | | |
| | | public String getApiAppId() { |
| | | return apiAppId; |
| | | } |
| | | |
| | | public void setApiAppId(String apiAppId) { |
| | | this.apiAppId = apiAppId; |
| | | } |
| | | |
| | | public String getApiCode() { |
| | | return apiCode; |
| | | } |
| | | |
| | | public void setApiCode(String apiCode) { |
| | | this.apiCode = apiCode; |
| | | } |
| | | |
| | | public String getApiSecret() { |
| | | return apiSecret; |
| | | } |
| | | |
| | | public void setApiSecret(String apiSecret) { |
| | | this.apiSecret = apiSecret; |
| | | } |
| | | |
| | | public String getApiUrl() { |
| | | return apiUrl; |
| | | } |
| | | |
| | | public void setApiUrl(String apiUrl) { |
| | | this.apiUrl = apiUrl; |
| | | } |
| | | |
| | | public String getDefaultImg() |
| | | { |
| | | return fileDomain + "adminweb/tx.jpg"; |
| | | } |
| | | |
| | | public Integer getIsDev() { |
| | | return isDev; |
| | | } |
| | | |
| | | public void setIsDev(Integer isDev) { |
| | | this.isDev = isDev; |
| | | } |
| | | |
| | | public String getBaseUrl() { |
| | | return baseUrl; |
| | | } |
| | | |
| | | public void setBaseUrl(String baseUrl) { |
| | | this.baseUrl = baseUrl; |
| | | } |
| | | |
| | | public String getPoiAppId() { |
| | | return poiAppId; |
| | | } |
| | | |
| | | public void setPoiAppId(String poiAppId) { |
| | | this.poiAppId = poiAppId; |
| | | } |
| | | |
| | | public String getPoiSecret() { |
| | | return poiSecret; |
| | | } |
| | | |
| | | public void setPoiSecret(String poiSecret) { |
| | | this.poiSecret = poiSecret; |
| | | } |
| | | |
| | | public String getPoiCode() { |
| | | return poiCode; |
| | | } |
| | | |
| | | public void setPoiCode(String poiCode) { |
| | | this.poiCode = poiCode; |
| | | } |
| | | |
| | | public String getClenitToken() { |
| | | return clenitToken; |
| | | } |
| | | |
| | | public void setClenitToken(String clenitToken) { |
| | | this.clenitToken = clenitToken; |
| | | } |
| | | |
| | | public String getClenitAeskey() { |
| | | return clenitAeskey; |
| | | } |
| | | |
| | | public void setClenitAeskey(String clenitAeskey) { |
| | | this.clenitAeskey = clenitAeskey; |
| | | } |
| | | |
| | | public String getDataCentreUrl() { |
| | | return dataCentreUrl; |
| | | } |
| | | |
| | | public void setDataCentreUrl(String dataCentreUrl) { |
| | | this.dataCentreUrl = dataCentreUrl; |
| | | } |
| | | |
| | | public String getRsaAppId() { |
| | | return rsaAppId; |
| | | } |
| | | |
| | | public void setRsaAppId(String rsaAppId) { |
| | | this.rsaAppId = rsaAppId; |
| | | } |
| | | |
| | | public String getRsaPrivatekey() { |
| | | return rsaPrivatekey; |
| | | } |
| | | |
| | | public void setRsaPrivatekey(String rsaPrivatekey) { |
| | | this.rsaPrivatekey = rsaPrivatekey; |
| | | } |
| | | |
| | | public String getRsaPublickey() { |
| | | return rsaPublickey; |
| | | } |
| | | |
| | | public void setRsaPublickey(String rsaPublickey) { |
| | | this.rsaPublickey = rsaPublickey; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import org.springframework.beans.factory.config.BeanDefinition; |
| | | import org.springframework.beans.factory.support.BeanDefinitionRegistry; |
| | | import org.springframework.context.annotation.AnnotationBeanNameGenerator; |
| | | |
| | | /** |
| | | * 重置bean名称生成策略,可以不同包同名策略 |
| | | * @author ChenJiaHe |
| | | * @Date 2020-06-30 |
| | | */ |
| | | public class UniqueNameGenerator extends AnnotationBeanNameGenerator { |
| | | |
| | | @Override |
| | | public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) { |
| | | //全限定类名 |
| | | String beanName = definition.getBeanClassName(); |
| | | return beanName; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.config; |
| | | |
| | | import javax.servlet.ReadListener; |
| | | import javax.servlet.ServletInputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletRequestWrapper; |
| | | import java.io.BufferedReader; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.nio.charset.Charset; |
| | | |
| | | |
| | | /** |
| | | * xss请求适配器 |
| | | * @Author: ChenJiaHe |
| | | * @Date: 2020-06-22 |
| | | */ |
| | | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { |
| | | |
| | | public XssHttpServletRequestWrapper(HttpServletRequest request) { |
| | | super(request); |
| | | } |
| | | |
| | | @Override |
| | | public String[] getParameterValues(String parameter) { |
| | | String[] values = super.getParameterValues(parameter); |
| | | if (values==null) { |
| | | return null; |
| | | } |
| | | int count = values.length; |
| | | String[] encodedValues = new String[count]; |
| | | for (int i = 0; i < count; i++) { |
| | | encodedValues[i] = cleanXSS(values[i]); |
| | | } |
| | | return encodedValues; |
| | | } |
| | | |
| | | @Override |
| | | public String getParameter(String parameter) { |
| | | String value = super.getParameter(parameter); |
| | | if (value != null) { |
| | | return cleanXSS(value); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public String getHeader(String name) { |
| | | String value = super.getHeader(name); |
| | | if (value == null) |
| | | return null; |
| | | return cleanXSS(value); |
| | | } |
| | | |
| | | private static String cleanXSS(String value) { |
| | | value = value.replaceAll("<", "<").replaceAll(">", ">"); |
| | | value = value.replaceAll("%3C", "<").replaceAll("%3E", ">"); |
| | | value = value.replaceAll("\\(", "(").replaceAll("\\)", ")"); |
| | | value = value.replaceAll("%28", "(").replaceAll("%29", ")"); |
| | | value = value.replaceAll("'", "'"); |
| | | value = value.replaceAll("eval\\((.*)\\)", ""); |
| | | value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\""); |
| | | value = value.replaceAll("script", ""); |
| | | return value; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ServletInputStream getInputStream() throws IOException { |
| | | final ByteArrayInputStream bais = new ByteArrayInputStream(inputHandlers(super.getInputStream ()).getBytes ()); |
| | | |
| | | return new ServletInputStream() { |
| | | |
| | | @Override |
| | | public int read() throws IOException { |
| | | return bais.read(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean isFinished() { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isReady() { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public void setReadListener(ReadListener readListener) { } |
| | | }; |
| | | } |
| | | |
| | | public String inputHandlers(ServletInputStream servletInputStream){ |
| | | StringBuilder sb = new StringBuilder(); |
| | | BufferedReader reader = null; |
| | | try { |
| | | reader = new BufferedReader(new InputStreamReader(servletInputStream, Charset.forName("UTF-8"))); |
| | | String line = ""; |
| | | while ((line = reader.readLine()) != null) { |
| | | sb.append(line); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (servletInputStream != null) { |
| | | try { |
| | | servletInputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (reader != null) { |
| | | try { |
| | | reader.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | return cleanXSS(sb.toString ()); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | package com.hx.phip.config.rabbitmq; |
| | | |
| | | |
| | | import org.springframework.amqp.core.Binding; |
| | | import org.springframework.amqp.core.BindingBuilder; |
| | | import org.springframework.amqp.core.DirectExchange; |
| | | import org.springframework.amqp.core.Queue; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | public class DirectRabbitConfig { |
| | | //队列 起名:TestDirectQueue |
| | | @Bean |
| | | public Queue TestDirectQueue() { |
| | | // durable:是否持久化,默认是false,持久化队列:会被存储在磁盘上,当消息代理重启时仍然存在,暂存队列:当前连接有效 |
| | | // exclusive:默认也是false,只能被当前创建的连接使用,而且当连接关闭后队列即被删除。此参考优先级高于durable |
| | | // autoDelete:是否自动删除,当没有生产者或者消费者使用此队列,该队列会自动删除。 |
| | | // return new Queue("TestDirectQueue",true,true,false); |
| | | |
| | | //一般设置一下队列的持久化就好,其余两个就是默认false |
| | | return new Queue("TestDirectQueue",true); |
| | | } |
| | | @Bean |
| | | public Queue TestDirectQueue2() { |
| | | |
| | | return new Queue("TestDirectQueue2",true); |
| | | } |
| | | //Direct交换机 起名:TestDirectExchange |
| | | @Bean |
| | | DirectExchange TestDirectExchange() { |
| | | // return new DirectExchange("TestDirectExchange",true,true); |
| | | return new DirectExchange("TestDirectExchange",true,false); |
| | | } |
| | | @Bean |
| | | Binding bindingDirect2() { |
| | | return BindingBuilder.bind(TestDirectQueue2()).to(TestDirectExchange()).with("TestDirectRouting2"); |
| | | } |
| | | //绑定 将队列和交换机绑定, 并设置用于匹配键:TestDirectRouting |
| | | @Bean |
| | | Binding bindingDirect() { |
| | | return BindingBuilder.bind(TestDirectQueue()).to(TestDirectExchange()).with("TestDirectRouting"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | */ |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | import com.hx.phip.service.AppointmentLogService; |
| | | import com.hx.phip.service.OrderTotalLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/log/appointment") |
| | | public class AppointmentLogController { |
| | | |
| | | @Resource |
| | | AppointmentLogService appointmentLogService; |
| | | /** |
| | | * 查看同步预约订单日志 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/list") |
| | | public Result orderListLog(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return appointmentLogService.appointmentListLog(jsonObject); |
| | | } |
| | | /** |
| | | * 重新发送失败同步订单到his |
| | | * @return |
| | | */ |
| | | @RequestMapping("/resynchronize") |
| | | public Result resynchronizeOrder(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return appointmentLogService.resynchronizeOrder(jsonObject); |
| | | } |
| | | /** |
| | | * 手动同步his订单,多次重新推送之后还是失败,在his手动创单,把hisid存到我们系统 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/manualsync") |
| | | public Result manualsyncOrder(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return appointmentLogService.manualsyncOrder(jsonObject); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | import com.hx.phip.service.BasicInformationLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author 基础信息同步日志 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/log/basic/information") |
| | | public class BasicInformationLogController { |
| | | |
| | | @Resource |
| | | BasicInformationLogService basicInformationLogService; |
| | | /** |
| | | * 查看同步项目日志记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/list") |
| | | public Result basicInformationList(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return basicInformationLogService.basicInformationList(jsonObject); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.service.ExecutionRecordLogService; |
| | | import com.hx.phip.service.UserLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步主动划扣日志 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/log/executionRecord") |
| | | public class ExecutionRecordLogController { |
| | | |
| | | @Resource |
| | | ExecutionRecordLogService executionRecordLogService; |
| | | /** |
| | | * 查看同步划扣日志 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/list") |
| | | public Result orderListLog(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return executionRecordLogService.executionRecordLisrLog(jsonObject); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | |
| | | import com.hx.common.service.CommonService; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.dao.mapper.HeartbeatReceiveMapper; |
| | | import com.hx.phiappt.dao.mapper.ShangTangUserMapper; |
| | | import com.hx.phiappt.dao.mapper.SyncUserRecordMapper; |
| | | import com.hx.phiappt.dao.mapper.UserArriveVisitMapper; |
| | | import com.hx.phiappt.model.sync.HeartbeatReceive; |
| | | import com.hx.phiappt.model.sync.ShangTangUser; |
| | | import com.hx.phiappt.model.sync.SyncUserRecord; |
| | | import com.hx.phiappt.model.sync.UserArriveVisit; |
| | | import com.hx.phip.dao.mapper.syn.*; |
| | | import com.hx.phip.model.*; |
| | | import com.hx.phip.feign.LogService; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 直接通过接口来实现url接口 |
| | | * @author ChenJiaHe |
| | | * @Date 2021-10-21 |
| | | */ |
| | | @RestController |
| | | public class FeignController implements LogService { |
| | | |
| | | @Resource |
| | | protected CommonService commonService; |
| | | |
| | | @Override |
| | | public Result test1(String name) { |
| | | return Result.success("请求了提供者的test1:"+name); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addHeartbeatReceive(HeartbeatReceive heartbeatReceive) { |
| | | return commonService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addShangTangUser(ShangTangUser shangTangUser) { |
| | | return commonService.insert(ShangTangUserMapper.class,shangTangUser); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addAppointmentRecord(SyncAppointmentRecord SyncAppointmentRecord) { |
| | | return commonService.insert(SyncAppointmentRecordMapper.class,SyncAppointmentRecord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addBasicInformation(SyncBasicInformationRecord syncBasicInformationRecord) { |
| | | return commonService.insert(SyncBasicInformationRecordMapper.class,syncBasicInformationRecord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addExecutionRecord(SyncExecutionRecord syncExecutionRecord) { |
| | | return commonService.insert(SyncExecutionRecordMapper.class,syncExecutionRecord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addKoapAppointment(SyncKoapAppointmentRecord syncKoapAppointmentRecord) { |
| | | return commonService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addOrderTotal(SyncOrderTotal syncOrderTotal) { |
| | | return commonService.insert(SyncOrderTotalMapper.class,syncOrderTotal); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addProject(SyncProjectRecord syncProjectRecord) { |
| | | return commonService.insert(SyncProjectRecordMapper.class,syncProjectRecord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addUserAccount(SyncUserAccountRecord syncUserAccountRecord) { |
| | | return commonService.insert(SyncUserAccountRecordMapper.class,syncUserAccountRecord); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addUserCrad(SyncUserCardRecord syncUserCardRecord) { |
| | | return commonService.insert(SyncUserCardRecordMapper.class,syncUserCardRecord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addUserPicture(SyncUserPictureRcord syncUserPictureRcord) { |
| | | return commonService.insert(SyncUserPictureRcordMapper.class,syncUserPictureRcord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addUser(SyncUserRecord syncUserRecord) { |
| | | return commonService.insert(SyncUserRecordMapper.class,syncUserRecord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int adduserArriveVisit(UserArriveVisit userArriveVisit) { |
| | | return commonService.insert(UserArriveVisitMapper.class,userArriveVisit); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int updateuserArriveVisit(UserArriveVisit userArriveVisit) { |
| | | return commonService.updateAll(UserArriveVisitMapper.class,userArriveVisit); |
| | | } |
| | | @Override |
| | | public <T extends Serializable> int addVisitRecord(HisVisitRecord hisVisitRecord) { |
| | | return commonService.insert(HisVisitRecordMapper.class,hisVisitRecord); |
| | | } |
| | | |
| | | @Override |
| | | public HisVisitRecord queryVisitRecord(SqlSentence sqlSentence) { |
| | | return commonService.selectOne(HisVisitRecordMapper.class,sqlSentence); |
| | | } |
| | | |
| | | @Override |
| | | public List<HisVisitRecord> selectListVisitRecord(SqlSentence sqlSentence) { |
| | | return commonService.selectList(HisVisitRecordMapper.class,sqlSentence); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int updateVisitRecord(HisVisitRecord hisVisitRecord) { |
| | | return commonService.updateAll(HisVisitRecordMapper.class,hisVisitRecord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addHisOrderItem(HisOrderItem hisOrderItem) { |
| | | return commonService.insert(HisOrderItemMapper.class,hisOrderItem); |
| | | } |
| | | |
| | | @Override |
| | | public HisOrderItem queryHisOrderItem(SqlSentence sqlSentence) { |
| | | return commonService.selectOne(HisOrderItemMapper.class,sqlSentence); |
| | | } |
| | | |
| | | @Override |
| | | public List<HisOrderItem> selectListHisOrderItem(SqlSentence sqlSentence) { |
| | | return commonService.selectList(HisOrderItemMapper.class,sqlSentence); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int updateHisOrderItem(HisOrderItem hisOrderItem) { |
| | | return commonService.updateAll(HisOrderItemMapper.class,hisOrderItem); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addHisExecutionRecord( HisExecutionRecord hisExecutionRecord) { |
| | | return commonService.insert(HisExecutionRecordMapper.class,hisExecutionRecord); |
| | | } |
| | | |
| | | @Override |
| | | public HisExecutionRecord queryHisExecutionRecord( SqlSentence sqlSentence ) { |
| | | return commonService.selectOne(HisExecutionRecordMapper.class,sqlSentence); |
| | | } |
| | | |
| | | @Override |
| | | public List<HisExecutionRecord> selectListHisExecutionRecord(SqlSentence sqlSentence) { |
| | | return commonService.selectList(HisExecutionRecordMapper.class,sqlSentence); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int updateHisExecutionRecord(HisExecutionRecord hisExecutionRecord) { |
| | | return commonService.updateAll(HisExecutionRecordMapper.class,hisExecutionRecord); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addHisOrderItemRecord(HisOrderItemRecord hisOrderItemRecord) { |
| | | return commonService.insert(HisOrderItemRecordMapper.class,hisOrderItemRecord); |
| | | } |
| | | |
| | | @Override |
| | | public HisAccountJournal queryAccountJournal(SqlSentence sqlSentence) { |
| | | return commonService.selectOne(HisAccountJournalMapper.class,sqlSentence); |
| | | } |
| | | |
| | | @Override |
| | | public List<HisAccountJournal> selectListAccountJournal(SqlSentence sqlSentence) { |
| | | return commonService.selectList(HisAccountJournalMapper.class,sqlSentence); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int addAccountJournal(HisAccountJournal hisAccountJournal) { |
| | | return commonService.insert(HisAccountJournalMapper.class,hisAccountJournal); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int updateAccountJournal(HisAccountJournal hisAccountJournal) { |
| | | return commonService.updateAll(HisAccountJournalMapper.class,hisAccountJournal); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | import com.hx.phip.service.KoapAppointmentLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/log/koap/appointment") |
| | | public class KoapAppointmentLogController { |
| | | |
| | | @Resource |
| | | private KoapAppointmentLogService koapAppointmentLogService; |
| | | /** |
| | | * 查看同步kbj预约订单日志 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/list") |
| | | public Result orderListLog(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return koapAppointmentLogService.list(jsonObject); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.service.OrderTotalLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步订单 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/log/order") |
| | | public class OrderTotalLogController { |
| | | |
| | | @Resource |
| | | OrderTotalLogService syncOrderTotalService; |
| | | /** |
| | | * 查看同步订单日志 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/list") |
| | | public Result orderListLog(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return syncOrderTotalService.orderListLog(jsonObject); |
| | | } |
| | | /** |
| | | * 重新发送失败同步订单到his |
| | | * @return |
| | | */ |
| | | @RequestMapping("/againCreateOrder") |
| | | public Result againCreateOrder(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return syncOrderTotalService.againCreateOrder(jsonObject); |
| | | } |
| | | /** |
| | | * 手动同步his订单,多次重新推送之后还是失败,在his手动创单,把hisid存到我们系统 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/manualCreateOrder") |
| | | public Result manualCreateOrder(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return syncOrderTotalService.manualCreateOrder(jsonObject); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.service.ProjectLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author 同步项目日志 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/log/project") |
| | | public class ProjectLogController { |
| | | |
| | | @Resource |
| | | ProjectLogService projectLogService; |
| | | |
| | | /** |
| | | * 查看同步项目日志记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/list") |
| | | public Result projectListLog(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return projectLogService.projectListLog(jsonObject); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | import com.hx.phip.service.SynchronizationLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author 查看所有同步日志 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/log/synchronization") |
| | | public class SynchronizationLogController { |
| | | |
| | | @Resource |
| | | SynchronizationLogService synchronizationLogService; |
| | | /** |
| | | * 查看所有同步日志 |
| | | * @return |
| | | */ |
| | | @PostMapping("/list") |
| | | public Result syncList(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return synchronizationLogService.syncList(jsonObject); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | import com.hx.phip.service.UserCardLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/log/user/card") |
| | | public class UserCardLogController { |
| | | |
| | | @Resource |
| | | private UserCardLogService userCardLogService; |
| | | |
| | | /** |
| | | * 查看同步卡包日志 |
| | | * @return |
| | | */ |
| | | @PostMapping("/list") |
| | | public Result list(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return userCardLogService.list(jsonObject); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.service.UserLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步用户 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/log/user") |
| | | public class UserLogController { |
| | | |
| | | @Resource |
| | | UserLogService userLogService; |
| | | /** |
| | | * 查看同步日志记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/list") |
| | | public Result orderListLog(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return userLogService.userListLog(jsonObject); |
| | | } |
| | | /** |
| | | * 查看同步日志记录 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/account/list") |
| | | public Result userAccountList(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return userLogService.userAccountList(jsonObject); |
| | | } |
| | | /** |
| | | * 查看同步日志记录 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/picture/list") |
| | | public Result userPictureList(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return userLogService.userPictureList(jsonObject); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.interceptor; |
| | | |
| | | import com.hx.phip.config.CustomParameter; |
| | | import com.hx.redis.RedisUtil; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import com.platform.entity.ThirtApplication; |
| | | import com.platform.resultTool.PlatformCode; |
| | | import com.platform.resultTool.PlatformResult; |
| | | import com.platform.verification.ApplicationTool; |
| | | import com.platform.verification.VerificationTool; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 前端设计一拦截器 |
| | | * 拦截请求的校验 |
| | | * @Author: ChenJiaHe |
| | | * @Date: 2021-10-20 |
| | | */ |
| | | /*@Aspect |
| | | @Component*/ |
| | | public class UserInterceptor { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UserInterceptor.class.getName()); |
| | | |
| | | @Resource |
| | | private CustomParameter rsaParameter; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | /**有效时间(秒)*/ |
| | | private static final long ttlMillis = 42300; |
| | | |
| | | /**设置拦截的位置 |
| | | * 拦截要校验的包 |
| | | */ |
| | | @Pointcut("within(com.hx.phip.controller.his.*))") |
| | | public void checkSign() { |
| | | } |
| | | |
| | | /* *设置拦截的位置的操作 |
| | | * @param joinPoint |
| | | * @return |
| | | * @throws Throwable*/ |
| | | public HttpServletRequest getRequest() { |
| | | //获取参数对象 |
| | | ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
| | | return attributes.getRequest(); |
| | | } |
| | | |
| | | @Around("checkSign()") |
| | | public Object doBefore(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | //获取签名 |
| | | HttpServletRequest request = getRequest(); |
| | | /*RequestAttributes ra = RequestContextHolder.getRequestAttributes(); |
| | | ServletRequestAttributes sra = (ServletRequestAttributes) ra; |
| | | HttpServletRequest request = sra.getRequest(); |
| | | Map<String, String> header = HttpServletRequestUtil.getHeader(request);*/ |
| | | String sign = request.getHeader("sign"); |
| | | String appId = request.getHeader("appId"); |
| | | if(StringUtils.isEmpty(appId)){ |
| | | appId = request.getHeader("appid"); |
| | | } |
| | | ThirtApplication thirtApplication = ApplicationTool.jsonToEntity(appId,redisUtil); |
| | | //校验 |
| | | PlatformResult platformResult = VerificationTool.verification(appId,sign,thirtApplication,request); |
| | | if(!PlatformCode.SUCCESS.equals(platformResult.getCode())){ |
| | | // return platformResult; |
| | | return Result.failure(ResponseCode.ERROR_SIGN, "签名错误!"); |
| | | } |
| | | |
| | | return joinPoint.proceed(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface AppointmentLogService { |
| | | |
| | | Result appointmentListLog(JSONObject jsonObject); |
| | | |
| | | Result resynchronizeOrder(JSONObject jsonObject); |
| | | |
| | | Result manualsyncOrder(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface BasicInformationLogService { |
| | | |
| | | Result basicInformationList(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.service; |
| | | |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface ExecutionRecordLogService { |
| | | |
| | | Result executionRecordLisrLog(JSONObject jsonObject); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface KoapAppointmentLogService { |
| | | |
| | | Result list(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.service; |
| | | |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface OrderTotalLogService { |
| | | |
| | | Result orderListLog(JSONObject jsonObject); |
| | | |
| | | Result againCreateOrder(JSONObject jsonObject); |
| | | |
| | | Result manualCreateOrder(JSONObject jsonObject); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface ProjectLogService { |
| | | |
| | | Result projectListLog(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface SynchronizationLogService { |
| | | |
| | | Result syncList(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface UserCardLogService { |
| | | |
| | | Result list(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.service; |
| | | |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface UserLogService { |
| | | |
| | | Result userListLog(JSONObject jsonObject); |
| | | |
| | | Result userAccountList(JSONObject jsonObject); |
| | | |
| | | Result userPictureList(JSONObject jsonObject); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.Appointment; |
| | | import com.hx.phip.common.HisUrl; |
| | | import com.hx.phip.config.SystemConfig; |
| | | import com.hx.phiappt.dao.mapper.AppointmentMapper; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.dao.mapper.syn.SyncAppointmentRecordMapper; |
| | | import com.hx.phip.model.SyncAppointmentRecord; |
| | | import com.hx.phip.service.AppointmentLogService; |
| | | import com.hx.phip.uti.ApiUtil; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import com.hz.util.http.HttpHzUtil; |
| | | import com.hz.util.http.dto.HttpHzResponse; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | public class AppointmentLogServiceImpl implements AppointmentLogService { |
| | | private static Logger logger = LoggerFactory.getLogger(AppointmentLogServiceImpl.class); |
| | | |
| | | @Resource |
| | | private SyncAppointmentRecordMapper syncAppointmentRecordMapper ; |
| | | @Resource |
| | | private AppointmentMapper appointmentMapper; |
| | | |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | /** |
| | | * 获取HIS token |
| | | * |
| | | * @return |
| | | */ |
| | | public String getToken(){ |
| | | String at = ApiUtil.getOpenApiAccessToken(systemParameterMapper, systemConfig.getApiAppId(), systemConfig.getApiCode(), |
| | | systemConfig.getApiSecret(), systemConfig.getApiUrl()); |
| | | return at; |
| | | } |
| | | @Override |
| | | public Result appointmentListLog(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_appointment WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | List<SyncAppointmentRecord> list = syncAppointmentRecordMapper.selectList(sqlSentence); |
| | | PageInfo<SyncAppointmentRecord> pageInfo = new PageInfo<>(list); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | |
| | | return Result.success(data); |
| | | } |
| | | |
| | | @Override |
| | | public Result resynchronizeOrder(JSONObject jsonObject) { |
| | | String id=jsonObject.optString("id"); |
| | | if(StringUtils.isEmpty(id)) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要重新同步的预约订单id"); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | sqlSentence.setSqlSentence("SELECT * FROM sync_appointment WHERE isDel=0 and id = #{m.id}"); |
| | | map.put("id", id); |
| | | SyncAppointmentRecord appointmentRecord=syncAppointmentRecordMapper.selectOne(sqlSentence); |
| | | |
| | | if(appointmentRecord==null) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"找不到需要重新同步的预约订单"); |
| | | if(appointmentRecord.getStatus()!=2 || appointmentRecord.getFailNumber()>=2 ) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"当前预约订单不支持重发"); |
| | | Appointment appointment = appointmentMapper.selectOneByKey(appointmentRecord.getForeignKeyId()); |
| | | if(appointment==null) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"当前数据找不到对应的预约订单"); |
| | | String at = getToken(); |
| | | //传参处理 |
| | | Map<String,String> header = new HashMap<>(); |
| | | header.put("x-access-token",at); |
| | | logger.info("主动同步HIS预约订单:"+appointmentRecord.getRequestParameters()); |
| | | HttpHzResponse httpHzResponse = HttpHzUtil.HttpURLUtilJson(systemConfig.getApiUrl()+ HisUrl.WORKFLOW_APPOINTMENT,appointmentRecord.getRequestParameters(),null,header,"POST",null); |
| | | logger.info("主动同步HIS预约订单返回:"+ JSON.toJSONString(httpHzResponse)); |
| | | |
| | | appointmentRecord.setReturnParameters(JSON.toJSONString(httpHzResponse)); |
| | | appointmentRecord.setEditTime(new Date()); |
| | | Result result=null; |
| | | if("201".equals(httpHzResponse.getCode())){ |
| | | JSONObject resultJosn=JSONObject.fromObject(httpHzResponse.getData()); |
| | | if(resultJosn.containsKey("id")){ |
| | | appointmentRecord.setSuccessNumber(1); |
| | | appointmentRecord.setStatus(1); |
| | | result=Result.success("请求成功"); |
| | | appointment.setApiId(resultJosn.optString("id")); |
| | | appointmentMapper.updateAll(appointment); |
| | | }else { |
| | | appointmentRecord.setFailNumber(appointmentRecord.getFailNumber()+1); |
| | | appointmentRecord.setStatus(2); |
| | | result= Result.success("预约订单重新发送失败"); |
| | | } |
| | | }else { |
| | | appointmentRecord.setFailNumber(appointmentRecord.getFailNumber()+1); |
| | | appointmentRecord.setStatus(2); |
| | | result= Result.success("预约订单重新发送失败"); |
| | | } |
| | | syncAppointmentRecordMapper.updateAll(appointmentRecord); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Result manualsyncOrder(JSONObject jsonObject) { |
| | | String id=jsonObject.optString("id"); |
| | | String hisId=jsonObject.optString("hisId"); |
| | | if(StringUtils.isEmpty(id)) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要手动同步的预约订单id"); |
| | | if(StringUtils.isEmpty(hisId)) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"HIS预约订单id不能为空"); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | sqlSentence.setSqlSentence("SELECT * FROM sync_appointment WHERE isDel=0 and id = #{m.id}"); |
| | | map.put("id", id); |
| | | SyncAppointmentRecord appointmentRecord=syncAppointmentRecordMapper.selectOne(sqlSentence); |
| | | if(appointmentRecord==null) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"找不到需要重新同步的预约订单"); |
| | | if(appointmentRecord.getStatus()!=2) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"当前预约订单不支持手动"); |
| | | Appointment appointment = appointmentMapper.selectOneByKey(appointmentRecord.getForeignKeyId()); |
| | | if(appointment==null) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"当前数据找不到对应的预约订单"); |
| | | |
| | | appointmentRecord.setReturnParameters(hisId); |
| | | appointmentRecord.setEditTime(new Date()); |
| | | appointmentRecord.setSuccessNumber(1); |
| | | appointmentRecord.setStatus(1); |
| | | syncAppointmentRecordMapper.updateAll(appointmentRecord); |
| | | |
| | | appointment.setApiId(hisId); |
| | | appointmentMapper.updateAll(appointment); |
| | | |
| | | return Result.success("手动同步成功"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.service.impl; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.dao.mapper.syn.SyncBasicInformationRecordMapper; |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.service.BasicInformationLogService; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | public class BasicInformationLogServiceImpl implements BasicInformationLogService { |
| | | private static Logger logger = LoggerFactory.getLogger(BasicInformationLogServiceImpl.class); |
| | | @Resource |
| | | SyncBasicInformationRecordMapper syncBasicInformationRecordMapper; |
| | | |
| | | |
| | | @Override |
| | | public Result basicInformationList(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_basic_information WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | |
| | | |
| | | List<SyncBasicInformationRecord> orderTotalList = syncBasicInformationRecordMapper.selectList(sqlSentence); |
| | | PageInfo<SyncBasicInformationRecord> pageInfo = new PageInfo<>(orderTotalList); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | return Result.success(data); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.service.impl; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.dao.mapper.syn.SyncExecutionRecordMapper; |
| | | import com.hx.phip.model.SyncExecutionRecord; |
| | | import com.hx.phip.service.ExecutionRecordLogService; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Transactional |
| | | @Service |
| | | class ExecutionRecordLogServiceImpl implements ExecutionRecordLogService { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ExecutionRecordLogServiceImpl.class); |
| | | @Autowired |
| | | private SyncExecutionRecordMapper syncExecutionRecordMapper; |
| | | |
| | | |
| | | @Override |
| | | public Result executionRecordLisrLog(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_executable_record WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | |
| | | List<SyncExecutionRecord> list = syncExecutionRecordMapper.selectList(sqlSentence); |
| | | PageInfo<SyncExecutionRecord> pageInfo = new PageInfo<>(list); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | |
| | | return Result.success(data); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.service.impl; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.dao.mapper.syn.SyncKoapAppointmentRecordMapper; |
| | | import com.hx.phip.model.SyncExecutionRecord; |
| | | import com.hx.phip.model.SyncKoapAppointmentRecord; |
| | | import com.hx.phip.service.KoapAppointmentLogService; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | public class KoapAppointmentLogServiceImpl implements KoapAppointmentLogService { |
| | | @Resource |
| | | private SyncKoapAppointmentRecordMapper syncKoapAppointmentRecordMapper; |
| | | @Override |
| | | public Result list(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_koap_appointment WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | |
| | | List<SyncKoapAppointmentRecord> list = syncKoapAppointmentRecordMapper.selectList(sqlSentence); |
| | | PageInfo<SyncKoapAppointmentRecord> pageInfo = new PageInfo<>(list); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | |
| | | return Result.success(data); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.common.OrderTotalConstants; |
| | | import com.hx.phiappt.common.RoleType; |
| | | import com.hx.phiappt.model.Employee; |
| | | import com.hx.phiappt.model.order.OrdersTotal; |
| | | import com.hx.phip.common.HisUrl; |
| | | import com.hx.phip.config.SystemConfig; |
| | | import com.hx.phiappt.dao.mapper.EmployeeMapper; |
| | | import com.hx.phiappt.dao.mapper.OrdersTotalMapper; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.dao.mapper.syn.SyncOrderTotalMapper; |
| | | import com.hx.phip.feign.OrderFeignService; |
| | | import com.hx.phip.model.SyncOrderTotal; |
| | | import com.hx.phip.service.OrderTotalLogService; |
| | | import com.hx.phip.uti.ApiUtil; |
| | | import com.hx.phip.uti.WeChatApiUtil; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import com.hz.util.http.HttpHzUtil; |
| | | import com.hz.util.http.dto.HttpHzResponse; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Transactional |
| | | @Service |
| | | class OrderTotalLogServiceImpl implements OrderTotalLogService { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(OrderTotalLogServiceImpl.class); |
| | | |
| | | @Resource |
| | | private SyncOrderTotalMapper syncOrderTotalMapper; |
| | | @Resource |
| | | private OrdersTotalMapper ordersTotalMapper; |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | @Resource |
| | | private EmployeeMapper employeeMapper; |
| | | |
| | | @Resource |
| | | private OrderFeignService orderFeignService; |
| | | /** |
| | | * 获取HIS token |
| | | * |
| | | * @return |
| | | */ |
| | | public String getToken(){ |
| | | //获取 领健 token |
| | | String at = ApiUtil.getOpenApiAccessToken(systemParameterMapper, systemConfig.getApiAppId(), systemConfig.getApiCode(), |
| | | systemConfig.getApiSecret(), systemConfig.getApiUrl()); |
| | | return at; |
| | | } |
| | | @Override |
| | | public Result orderListLog(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_orders_total WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | List<SyncOrderTotal> orderTotalList = syncOrderTotalMapper.selectList(sqlSentence); |
| | | PageInfo<SyncOrderTotal> pageInfo = new PageInfo<>(orderTotalList); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | |
| | | return Result.success(data); |
| | | } |
| | | |
| | | @Override |
| | | public Result againCreateOrder(JSONObject jsonObject) { |
| | | String id=jsonObject.optString("id"); |
| | | if(StringUtils.isEmpty(id)) { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要重新同步的订单id"); |
| | | } |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | sqlSentence.setSqlSentence("SELECT * FROM sync_orders_total WHERE isDel=0 and id = #{m.id}"); |
| | | map.put("id", id); |
| | | SyncOrderTotal syncOrderTotal=syncOrderTotalMapper.selectOne(sqlSentence); |
| | | |
| | | if(syncOrderTotal==null) { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"找不到需要重新同步的订单"); |
| | | } |
| | | if(syncOrderTotal.getStatus()!=2 || syncOrderTotal.getSendingQuantity()>=2 ) { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"当前订单不支持重发"); |
| | | } |
| | | OrdersTotal ordersTotal=orderFeignService.selectOrdersTotal(syncOrderTotal.getForeignKeyId()); |
| | | if(ordersTotal==null) { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"当前数据找不到对应的订单"); |
| | | } |
| | | |
| | | String at =orderFeignService.getToken(); |
| | | if(at==null){ |
| | | return Result.success("订单重新发送失败"); |
| | | } |
| | | Map<String,String> header = new HashMap<>(); |
| | | header.put("x-access-token",at); |
| | | logger.info("主动同步HIS订单:"+syncOrderTotal.getRequestParameters()); |
| | | logger.info("at:"+at); |
| | | HttpHzResponse httpHzResponse = HttpHzUtil.HttpURLUtilJson(systemConfig.getApiUrl()+ HisUrl.BILLING_SALES_ORDER,syncOrderTotal.getRequestParameters(),null,header,"POST",null); |
| | | |
| | | logger.info("主动同步HIS订单返回:"+ JSON.toJSONString(httpHzResponse)); |
| | | |
| | | //修改记录请求日志 |
| | | if("201".equals(httpHzResponse.getCode())){ |
| | | JSONObject json=JSONObject.fromObject(httpHzResponse.getData()); |
| | | if(json.containsKey("id")){ |
| | | syncOrderTotal.setStatus(1); |
| | | syncOrderTotal.setSendingQuantity(syncOrderTotal.getSendingQuantity()+1); |
| | | syncOrderTotal.setSuccessNumber(syncOrderTotal.getSuccessNumber()+1); |
| | | syncOrderTotal.setReturnParameters(JSON.toJSONString(httpHzResponse)); |
| | | syncOrderTotalMapper.updateAll(syncOrderTotal); |
| | | |
| | | ordersTotal.setHisOrderId(json.optString("id")); |
| | | ordersTotal.setSyncStatus(OrderTotalConstants.SYNC_STATUS_ORDER_SUCCES); |
| | | orderFeignService.updateOrdersTotal(ordersTotal); |
| | | return Result.success("请求成功"); |
| | | }else { |
| | | syncOrderTotal.setFailNumber(syncOrderTotal.getFailNumber()+1); |
| | | syncOrderTotal.setSendingQuantity(syncOrderTotal.getSendingQuantity()+1); |
| | | syncOrderTotal.setReturnParameters(JSON.toJSONString(httpHzResponse)); |
| | | syncOrderTotalMapper.updateAll(syncOrderTotal); |
| | | // sendAppointment(); |
| | | return Result.success("订单重新发送失败"); |
| | | } |
| | | }else { |
| | | syncOrderTotal.setSendingQuantity(syncOrderTotal.getSendingQuantity()+1); |
| | | syncOrderTotal.setReturnParameters(JSON.toJSONString(httpHzResponse)); |
| | | syncOrderTotalMapper.updateAll(syncOrderTotal); |
| | | // sendAppointment(); |
| | | return Result.success("订单重新发送失败"); |
| | | } |
| | | |
| | | } |
| | | public void sendAppointment(){ |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | sqlSentence.setSqlSentence("SELECT e.* FROM employee e INNER JOIN employee_role er on e.id=er.employeeId \n" + |
| | | "INNER JOIN employee_role_type ert on er.roleTypeId=ert.id WHERE ert.uniqueStr = #{m.uniqueStr} GROUP BY e.id"); |
| | | map.put("uniqueStr", RoleType.UNIQUE_STR_ADMIN); |
| | | List<Employee> list= employeeMapper.selectList(sqlSentence); |
| | | StringBuffer touser=new StringBuffer(); |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | if(i==list.size()-1){ |
| | | touser.append(list.get(i).getUserId()); |
| | | }else { |
| | | touser.append(list.get(i).getUserId()+"|"); |
| | | } |
| | | } |
| | | // WeChatApiUtil.sendAppointment(systemParameterMapper,systemConfig.getCorpId(), systemConfig.getCorpMpSecret(),systemConfig.getAppId(),touser.toString(),"同步订单失败"); |
| | | } |
| | | |
| | | @Override |
| | | public Result manualCreateOrder(JSONObject jsonObject) { |
| | | String id=jsonObject.optString("id"); |
| | | String hisId=jsonObject.optString("hisId"); |
| | | if(StringUtils.isEmpty(id)) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要手动同步的订单id"); |
| | | if(StringUtils.isEmpty(hisId)) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"HIS订单id不能为空"); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | sqlSentence.setSqlSentence("SELECT * FROM sync_orders_total WHERE isDel=0 and id = #{m.id}"); |
| | | map.put("id", id); |
| | | SyncOrderTotal syncOrderTotal=syncOrderTotalMapper.selectOne(sqlSentence); |
| | | if(syncOrderTotal.getStatus()!=2) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"当前订单不支持手动"); |
| | | OrdersTotal ordersTotal=ordersTotalMapper.selectOneByKey(syncOrderTotal.getForeignKeyId()); |
| | | if(ordersTotal==null) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"当前数据找不到对应的订单"); |
| | | |
| | | syncOrderTotal.setStatus(1); |
| | | syncOrderTotal.setSendingQuantity(syncOrderTotal.getSendingQuantity()+1); |
| | | syncOrderTotal.setReturnParameters(hisId); |
| | | syncOrderTotal.setSuccessNumber(syncOrderTotal.getSuccessNumber()+1); |
| | | syncOrderTotalMapper.updateAll(syncOrderTotal); |
| | | |
| | | |
| | | ordersTotal.setHisOrderId(hisId); |
| | | ordersTotal.setSyncStatus(OrderTotalConstants.SYNC_STATUS_ORDER_SUCCES); |
| | | ordersTotalMapper.updateAll(ordersTotal); |
| | | return Result.success("手动同步成功"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.service.impl; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.dao.mapper.syn.SyncProjectRecordMapper; |
| | | import com.hx.phip.model.SyncProjectRecord; |
| | | import com.hx.phip.service.ProjectLogService; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | public class ProjectLogServiceImpl implements ProjectLogService { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ProjectLogServiceImpl.class); |
| | | @Resource |
| | | SyncProjectRecordMapper syncProjectRecordMapper; |
| | | |
| | | @Override |
| | | public Result projectListLog(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_project WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | |
| | | |
| | | List<SyncProjectRecord> orderTotalList = syncProjectRecordMapper.selectList(sqlSentence); |
| | | PageInfo<SyncProjectRecord> pageInfo = new PageInfo<>(orderTotalList); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | |
| | | return Result.success(data); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.service.impl; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.dao.mapper.SyncUserRecordMapper; |
| | | import com.hx.phip.dao.mapper.syn.*; |
| | | import com.hx.phip.service.SynchronizationLogService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | public class SynchronizationLogServiceImpl implements SynchronizationLogService { |
| | | |
| | | @Resource |
| | | private SyncUserRecordMapper syncUserRecordMapper; |
| | | @Resource |
| | | private SyncUserAccountRecordMapper syncUserAccountRecordMapper; |
| | | @Resource |
| | | private SyncUserPictureRcordMapper syncUserPictureRcordMapper; |
| | | @Resource |
| | | SyncProjectRecordMapper syncProjectRecordMapper; |
| | | @Resource |
| | | private SyncOrderTotalMapper syncOrderTotalMapper; |
| | | @Resource |
| | | SyncBasicInformationRecordMapper syncBasicInformationRecordMapper; |
| | | @Resource |
| | | private SyncUserCardRecordMapper syncUserCardRecordMapper; |
| | | @Resource |
| | | private SyncAppointmentRecordMapper syncAppointmentRecordMapper ; |
| | | @Autowired |
| | | private SyncExecutionRecordMapper syncExecutionRecordMapper; |
| | | @Resource |
| | | private SyncKoapAppointmentRecordMapper syncKoapAppointmentRecordMapper; |
| | | @Override |
| | | public Result syncList(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | List<Map> list=new ArrayList<>(); |
| | | Map con=new HashMap(); |
| | | |
| | | String sql="SELECT COALESCE(sum(successNumber),0) as successNumber, COALESCE(sum(failNumber),0) as failNumber,CURDATE() as createTime FROM database_table WHERE createTime > CURDATE()"; |
| | | //用户同步日志 |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_user")); |
| | | Map<String, Object> syncUserRecord=syncUserRecordMapper.selectOneMap(sqlSentence); |
| | | con.put("id","user"); |
| | | con.put("successNumber",syncUserRecord.get("successNumber")); |
| | | con.put("failNumber",syncUserRecord.get("failNumber")); |
| | | list.add(con); |
| | | //用户余额同步日志 |
| | | con=new HashMap(); |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_user_account")); |
| | | Map<String, Object> syncUserAccountRecord=syncUserAccountRecordMapper.selectOneMap(sqlSentence); |
| | | con.put("id","userAccount"); |
| | | con.put("successNumber",syncUserAccountRecord.get("successNumber")); |
| | | con.put("failNumber",syncUserAccountRecord.get("failNumber")); |
| | | list.add(con); |
| | | //用户对比照同步日志 |
| | | con=new HashMap(); |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_user_picture")); |
| | | Map<String, Object> syncUserPictureRcord=syncUserPictureRcordMapper.selectOneMap(sqlSentence); |
| | | con.put("id","userPicture"); |
| | | con.put("successNumber",syncUserPictureRcord.get("successNumber")); |
| | | con.put("failNumber",syncUserPictureRcord.get("failNumber")); |
| | | list.add(con); |
| | | //用户卡包同步日志 |
| | | con=new HashMap(); |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_user_card")); |
| | | Map<String, Object> syncUserCardRcord=syncUserCardRecordMapper.selectOneMap(sqlSentence); |
| | | con.put("id","syncUserCardRcord"); |
| | | con.put("successNumber",syncUserCardRcord.get("successNumber")); |
| | | con.put("failNumber",syncUserCardRcord.get("failNumber")); |
| | | list.add(con); |
| | | //项目同步日志 |
| | | con=new HashMap(); |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_project")); |
| | | Map<String, Object> syncProjectRecord=syncProjectRecordMapper.selectOneMap(sqlSentence); |
| | | con.put("id","project"); |
| | | con.put("successNumber",syncProjectRecord.get("successNumber")); |
| | | con.put("failNumber",syncProjectRecord.get("failNumber")); |
| | | list.add(con); |
| | | //订单同步日志 |
| | | con=new HashMap(); |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_orders_total")); |
| | | Map<String, Object> syncOrderTotal=syncOrderTotalMapper.selectOneMap(sqlSentence); |
| | | con.put("id","order"); |
| | | con.put("successNumber",syncOrderTotal.get("successNumber")); |
| | | con.put("failNumber",syncOrderTotal.get("failNumber")); |
| | | list.add(con); |
| | | //基础数据同步日志 |
| | | con=new HashMap(); |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_basic_information")); |
| | | Map<String, Object> syncBasicInformationRecord=syncBasicInformationRecordMapper.selectOneMap(sqlSentence); |
| | | con.put("id","basicInformation"); |
| | | con.put("successNumber",syncBasicInformationRecord.get("successNumber")); |
| | | con.put("failNumber",syncBasicInformationRecord.get("failNumber")); |
| | | list.add(con); |
| | | //预约同步日志 |
| | | con=new HashMap(); |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_appointment")); |
| | | Map<String, Object> appointmentRecord=syncAppointmentRecordMapper.selectOneMap(sqlSentence); |
| | | con.put("id","appointmentRecord"); |
| | | con.put("successNumber",appointmentRecord.get("successNumber")); |
| | | con.put("failNumber",appointmentRecord.get("failNumber")); |
| | | list.add(con); |
| | | //划扣同步日志 |
| | | con=new HashMap(); |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_appointment")); |
| | | Map<String, Object> executionRecord=syncExecutionRecordMapper.selectOneMap(sqlSentence); |
| | | con.put("id","executionRecord"); |
| | | con.put("successNumber",executionRecord.get("successNumber")); |
| | | con.put("failNumber",executionRecord.get("failNumber")); |
| | | list.add(con); |
| | | //预约同步日志 |
| | | con=new HashMap(); |
| | | sqlSentence.setSqlSentence(sql.replace("database_table","sync_koap_appointment")); |
| | | Map<String, Object> koapAppointmentRecord=syncKoapAppointmentRecordMapper.selectOneMap(sqlSentence); |
| | | con.put("id","koapAppointmentRecord"); |
| | | con.put("successNumber",koapAppointmentRecord.get("successNumber")); |
| | | con.put("failNumber",koapAppointmentRecord.get("failNumber")); |
| | | list.add(con); |
| | | |
| | | |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | PageInfo<Map> pageInfo = new PageInfo<>(list); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | return Result.success(data); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.service.impl; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.dao.mapper.syn.SyncUserCardRecordMapper; |
| | | import com.hx.phip.model.SyncUserCardRecord; |
| | | import com.hx.phip.service.UserCardLogService; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | public class UserCardLogServiceImpl implements UserCardLogService { |
| | | |
| | | |
| | | @Resource |
| | | private SyncUserCardRecordMapper syncUserCardRecordMapper; |
| | | @Override |
| | | public Result list(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_user_card WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | |
| | | List<SyncUserCardRecord> list = syncUserCardRecordMapper.selectList(sqlSentence); |
| | | PageInfo<SyncUserCardRecord> pageInfo = new PageInfo<>(list); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | |
| | | return Result.success(data); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.service.impl; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.dao.mapper.syn.SyncUserAccountRecordMapper; |
| | | import com.hx.phip.dao.mapper.syn.SyncUserPictureRcordMapper; |
| | | import com.hx.phiappt.dao.mapper.SyncUserRecordMapper; |
| | | import com.hx.phip.model.SyncUserAccountRecord; |
| | | import com.hx.phip.model.SyncUserPictureRcord; |
| | | import com.hx.phiappt.model.sync.SyncUserRecord; |
| | | import com.hx.phip.service.UserLogService; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Transactional |
| | | @Service |
| | | class UserLogServiceImpl implements UserLogService { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UserLogServiceImpl.class); |
| | | |
| | | @Resource |
| | | private SyncUserRecordMapper syncUserRecordMapper; |
| | | @Resource |
| | | private SyncUserAccountRecordMapper syncUserAccountRecordMapper; |
| | | @Resource |
| | | private SyncUserPictureRcordMapper syncUserPictureRcordMapper; |
| | | |
| | | @Override |
| | | public Result userListLog(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_user WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | |
| | | |
| | | List<SyncUserRecord> orderTotalList = syncUserRecordMapper.selectList(sqlSentence); |
| | | PageInfo<SyncUserRecord> pageInfo = new PageInfo<>(orderTotalList); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | |
| | | return Result.success(data); |
| | | } |
| | | |
| | | @Override |
| | | public Result userAccountList(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_user_account WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | List<SyncUserAccountRecord> orderTotalList = syncUserAccountRecordMapper.selectList(sqlSentence); |
| | | PageInfo<SyncUserAccountRecord> pageInfo = new PageInfo<>(orderTotalList); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | return Result.success(data); |
| | | } |
| | | |
| | | @Override |
| | | public Result userPictureList(JSONObject jsonObject) { |
| | | Integer pageNum= jsonObject.optInt("pageNum",0); |
| | | Integer pageSize=jsonObject.optInt("pageSize",0); |
| | | //分页插件 |
| | | PageHelper.startPage(pageNum==0?1:pageNum, pageSize==0?10:pageSize); |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT * FROM sync_user_picture WHERE isDel=0 "); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("startTime",null))){ |
| | | sql.append(" and createTime >= #{m.startTime} "); |
| | | map.put("startTime", jsonObject.optString("startTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("endTime",null))){ |
| | | sql.append(" and createTime <= #{m.endTime} "); |
| | | map.put("endTime", jsonObject.optString("endTime")); |
| | | } |
| | | if(!StringUtils.isEmpty(jsonObject.optString("type",null))){ |
| | | sql.append(" and type = #{m.type} "); |
| | | map.put("type", jsonObject.optString("type")); |
| | | } |
| | | sql.append(" ORDER BY editTime desc"); |
| | | sqlSentence.setSqlSentence(sql.toString()); |
| | | List<SyncUserPictureRcord> orderTotalList = syncUserPictureRcordMapper.selectList(sqlSentence); |
| | | PageInfo<SyncUserPictureRcord> pageInfo = new PageInfo<>(orderTotalList); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("list", pageInfo.getList()); |
| | | data.put("total", pageInfo.getTotal()); |
| | | data.put("pages", pageInfo.getPages()); |
| | | data.put("pageNum", pageInfo.getPageNum()); |
| | | data.put("pageSize", pageInfo.getPageSize()); |
| | | data.put("isLastPage", pageInfo.isIsLastPage()); |
| | | return Result.success(data); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.task; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.dao.mapper.HeartbeatReceiveMapper; |
| | | import com.hx.phiappt.dao.mapper.SyncUserRecordMapper; |
| | | import com.hx.phiappt.dao.mapper.UserArriveVisitMapper; |
| | | import com.hx.phip.dao.mapper.syn.*; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Component |
| | | public class DeleteLogTask { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(DeleteLogTask.class); |
| | | |
| | | @Resource |
| | | HeartbeatReceiveMapper heartbeatReceiveMapper; |
| | | @Resource |
| | | private SyncAppointmentRecordMapper syncAppointmentRecordMapper ; |
| | | @Resource |
| | | private SyncBasicInformationRecordMapper syncBasicInformationRecordMapper; |
| | | @Resource |
| | | private SyncOrderTotalMapper syncOrderTotalMapper; |
| | | @Resource |
| | | private SyncProjectRecordMapper syncProjectRecordMapper; |
| | | @Resource |
| | | private SyncUserRecordMapper syncUserRecordMapper; |
| | | @Resource |
| | | private SyncUserAccountRecordMapper syncUserAccountRecordMapper; |
| | | @Resource |
| | | private SyncUserPictureMapper syncUserPictureMapper; |
| | | @Resource |
| | | private UserArriveVisitMapper userArriveVisitMapper; |
| | | @Resource |
| | | private SyncUserCardRecordMapper syncUserCardRecordMapper; |
| | | @Resource |
| | | private SyncKoapAppointmentRecordMapper syncKoapAppointmentRecordMapper; |
| | | /** |
| | | * 删除同步日志库半月之前的数据 |
| | | */ |
| | | @Scheduled(cron="0 20 5 * * ?") |
| | | public void syncPromotionTask() { |
| | | logger.info("开始删除同步日志库半月之前的数据"); |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | //删除15天前的数据 |
| | | sqlSentence.setSqlSentence(" createTime < SUBDATE(now(), INTERVAL 15 DAY) "); |
| | | |
| | | //删除心跳日志 |
| | | heartbeatReceiveMapper.deleteWhere(sqlSentence); |
| | | //删除预约日志 |
| | | syncAppointmentRecordMapper.deleteWhere(sqlSentence); |
| | | //删除标签日志 |
| | | syncBasicInformationRecordMapper.deleteWhere(sqlSentence); |
| | | //删除订单日志 |
| | | syncOrderTotalMapper.deleteWhere(sqlSentence); |
| | | //删除项目同步日志 |
| | | syncProjectRecordMapper.deleteWhere(sqlSentence); |
| | | //删除用户日志 |
| | | syncUserRecordMapper.deleteWhere(sqlSentence); |
| | | //删除用户同步余额日志 |
| | | syncUserAccountRecordMapper.deleteWhere(sqlSentence); |
| | | //删除用户同步对比照日志 |
| | | syncUserPictureMapper.deleteWhere(sqlSentence); |
| | | //删除用户到访日志 |
| | | userArriveVisitMapper.deleteWhere(sqlSentence); |
| | | //删除用户卡包同步日志 |
| | | syncUserCardRecordMapper.deleteWhere(sqlSentence); |
| | | //删除康博嘉预约日志 |
| | | syncKoapAppointmentRecordMapper.deleteWhere(sqlSentence); |
| | | logger.info("结束删除同步日志库半月之前的数据"); |
| | | } |
| | | } |
New file |
| | |
| | | 正式APPID: |
| | | 54654asdf56sd1e1gv567as1 |
| | | |
| | | 正式publicKey: |
| | | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgFI+OzRsz0mkuEPHYZwbM2vLVubjoHVl |
| | | QdSngB0vFWkmPc6RuQX8/mtPyQ3i/F1EW2CdapHPliLl5N0QtO+v7NcP+i5nS2TgHpXDzJnU/Sm2 |
| | | SXXN2wMncg4Gk9I1Bbl9IKKOBZ6+jMeRLpYcl3okmshqAHu1zzAepXUiqgr0lk0E2etNzq8cOdou |
| | | TZXj0VHgq6MUtAfucRXV8nqUpIDZEZWwxPc27xr0XtCllOXcJv0scJZsPmuVcPs5W/4GAXkeGbwL |
| | | LdSnMnmyx2wE0PwBDehdg1xwQftlbd0tOyrQAbgfONAPu1fCy6QfZa0tksSGqKnS+qlck/U6wCtn |
| | | /8TSewIDAQAB |
| | | |
| | | 正式privateKey: |
| | | MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCAUj47NGzPSaS4Q8dhnBsza8tW |
| | | 5uOgdWVB1KeAHS8VaSY9zpG5Bfz+a0/JDeL8XURbYJ1qkc+WIuXk3RC076/s1w/6LmdLZOAelcPM |
| | | mdT9KbZJdc3bAydyDgaT0jUFuX0goo4Fnr6Mx5EulhyXeiSayGoAe7XPMB6ldSKqCvSWTQTZ603O |
| | | rxw52i5NlePRUeCroxS0B+5xFdXyepSkgNkRlbDE9zbvGvRe0KWU5dwm/Sxwlmw+a5Vw+zlb/gYB |
| | | eR4ZvAst1KcyebLHbATQ/AEN6F2DXHBB+2Vt3S07KtABuB840A+7V8LLpB9lrS2SxIaoqdL6qVyT |
| | | 9TrAK2f/xNJ7AgMBAAECggEABVxqQSr1iMt42EHsqIVPFZzhR+YpiGCfNFrgDJgriWd1M4vXxrUb |
| | | Vr3A/ZNY8lYrLu4gZX1mAM3AcQlTU1vYK7robflWU24Jdv2mynt6zIDbnsIPMaE2Gqu/VpmnoW+Y |
| | | bK6d5Fo3d8Y2qI2Y8DMoKFdLJm4EsH1AKoV0R0ph4Y2S8VJHIp2dMCNLRH8OZSyG/vsUdXhxVFtY |
| | | 99Ww7d67M5cBvkF5QMvtZ5xjRYf8xPiO3NUnVmvcQEJUIuLn4PlnQQeVFXlkQABqYxMk59Qw/mqc |
| | | mdrPDJ7JX6b2qHo6Db13vF/ELLD0JTv7WPlA1Qam3rL/nPiNp/zIHIE+/MvHQQKBgQDLftNxGkg7 |
| | | hpeZOkeGoXfTHpaKEaP7ncA5Sby8N42r2byfgTC4AgiksSKpZPgaVMHJ7vJ5hWRaVkRwrnTmAm+9 |
| | | ejQCVI3Z+6dQs5A2dN44kcQMjmlPlDhmI2W9C/2beQWlCLk0In+U4/FJ1EO6j8sSiID5hTFi2ZGw |
| | | pOso4gB9ywKBgQChbg2I2JwA4xYh54Syb7gA4ZCdSFw08q/O2dxBL3WZ1Xe0NXMkBRV4rJO5EAV6 |
| | | TGeIJmJLxgGO3kJvLefcgFG5aBoRudEEzymsvMLv7a9gpPG7UKJClCiJoNP5HnN3e3cPnSfSw+95 |
| | | zwDCB+mPmJ701z4jU2tjVM7d8ruGi6ZoEQKBgQCQ3a2qw9oOPken9nw61LIX4puqmNpTYr8YSW0J |
| | | 1MaPQ4drSa4kIJaEn/GcA9w36oS2u9t0NUj2oplAWoGvyKZBjkB+NDFzsBoxclNE4Tfdr6+QfMVt |
| | | uIfZ9nMT/PhC+QnSrf4ipjiLByabt3er1Xfsrq6ac35v75Eu3ojmZtWQtwKBgQCe1MuYU5fa/5Qt |
| | | M8BKWMWwiD9joWin6Ai2+4BM2sdY3sHym4x4alAf9Z07PtpE5JwRR8L7Tw0FZwXyojY5rD+8rwLH |
| | | Yg6YLsSQYwFiVHh0HJaDeOjNnTztfUJTIHT3oJEa2cPvCj27mcLjJinV0ZLE0GshEtjcWPtZQZTk |
| | | 4s6OIQKBgQCRolEg5/+gRmBTPclZGzT9HeH7DCO7dZFS+I//ju/6nqUmKzfxjEMrv1KMdvmeR1Me |
| | | c+qJ970DxDRuJApE+aOlSzdg1wqmwEvjHmMyT5C++8hANSSRiXtD9XfRJJRFdlsrkCB6WgsCcJDT |
| | | MzGxdpJGVBpp9xi8YDYLiIqtmvbl2g== |
New file |
| | |
| | | appId: |
| | | 9454dsf41s1w1n4tyko4a4dsfg4s |
| | | |
| | | publicKey: |
| | | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgR8YuvjPRVTjlGwzzIfqsHXZzQ/mCJS3 |
| | | 0Xg3D8v+VnPqrsM2iPSbB1ztu6VKC3SAffwyDQ2NXWxKwNuYFNakbAHZ9EaK+YXdGfajFsaiAHuK |
| | | 5GZuJeGGkbxN3WrRkXSDjYfuhnn+8aXc7dlGIigTPenEGhKn+5MlPOT/pBVH+EHnJENtLj37UmUR |
| | | evUR1QD7QplG6tzzlO789auLwBsvcxjx9ZF9gPZGMngX/k0Bw8f+/HBIZBdbmUtMCefGAvqwkgjL |
| | | ZWpBScQW/PY87gtvxBe0Q9xCEyOdwBcT8k/UZr2vIRwrJlNSeW4Lx4V6+AaPDawABKU30c1uQmxz |
| | | bOr5aQIDAQAB |
| | | |
| | | |
| | | privateKey: |
| | | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCBHxi6+M9FVOOUbDPMh+qwddnN |
| | | D+YIlLfReDcPy/5Wc+quwzaI9JsHXO27pUoLdIB9/DINDY1dbErA25gU1qRsAdn0Ror5hd0Z9qMW |
| | | xqIAe4rkZm4l4YaRvE3datGRdIONh+6Gef7xpdzt2UYiKBM96cQaEqf7kyU85P+kFUf4QeckQ20u |
| | | PftSZRF69RHVAPtCmUbq3POU7vz1q4vAGy9zGPH1kX2A9kYyeBf+TQHDx/78cEhkF1uZS0wJ58YC |
| | | +rCSCMtlakFJxBb89jzuC2/EF7RD3EITI53AFxPyT9Rmva8hHCsmU1J5bgvHhXr4Bo8NrAAEpTfR |
| | | zW5CbHNs6vlpAgMBAAECggEAGr/fdrSe9AUPFKuJ26B4vU/c7D+T70kn/6xA8/PV4AEpqETm4l6S |
| | | U2csFQi8Gz1qdS8vC0c4dxc9MVEM45xH+dw0VAfdOK5DzOIsjUZfP2xYrNKPlSdwonZ5RxqfCdwy |
| | | eLqlbpSNfXBYIao2flMBEX2BU8lzpYmpWEE0uMBz5XkuT2Mud5nTnDJdmen9ZQWWZsF6wjpfh6Sn |
| | | KKOhCg2rBw5dobB/90B/lBx6lSQxJbui4VfK3xmNu9yFGoiOLk5gq4hawWvmK3bZG7XF5lGtyb75 |
| | | mI60n7B23FA9XchK3Xh5DsGITjhq+8jQO8+hUHzLOG78PBcnI/nIeslwKkkDZQKBgQC89oIi5s6E |
| | | atXpWxOY76XQSQhV4Cl3lFf1Sh21I3H2xim2Xuu0e9kpgzcY9rmSTuU/6LGFoBuawj9azfguJPI1 |
| | | E7vmwT2CuiWUBywvViyiBz7S92ZDFN5PkGuaKjLewoOn7t/is66xovC8avRU1c1obqsQt7Pfcz85 |
| | | qxvzp+dsswKBgQCu7dNuisgLEeivohXKS2boJRFf/hprsSrhB6Xdvst663hzFDQOTKlJUp27oO5o |
| | | RiqEdL5cXSNQqUxyhlOzuCkybijftJXjz/3CIlP4DwG9oIy3cs6hyJGfLKasch64QLOPZ0iTWKC4 |
| | | qtL9Gjx3h8Hz0gDw5t7+mKaFNMI8YrLHcwKBgAV+3dYKBGORf9sjjPRbs+TU2us0c8BIji5SE38b |
| | | IstchAYLyKsdFvnAGTAerNL2fHBZYiBSwbrEf3cymk8tP+YPRt21LQbKRyGA++X8iZvEvi0AiPbW |
| | | eoix2I9JPuV/nriZl+VN+HyuEnZIXgbBmRG6djssPIz5GxOgSFXTwkVFAoGARXT9LLlCMNMNlx8+ |
| | | k7JYy/hb68eTagtQwUUuINvvI4F3tAnjmYHq/cgmBSgjQZgKrclFBJueuBpg1mBrv8Jx6SpAZILp |
| | | uSkO0xSaTrZ2tHqZJQYa8bYXzCIIlBREClj2cwxJjufz+R8q44CVXcizxEIwSXcCOAkYpW+LaDqw |
| | | Te0CgYEAsZQX2iGcex8vhFNPM6IceYpo2Br50WKUoy4/adRdq9sBYWUc9U3UCYtro/MuLXYbTKPg |
| | | A+WD5wuRymiopMTiQcLBMHGcpvNp0IsW8YFRLsk4ETB2Qnt5hcJuCv2luainNTN0gblLerZ4+RHi |
| | | pTtcUfkjo5c7ZcIQGtMVWWI+apA= |
New file |
| | |
| | | #\u8BBE\u7F6E\u7AEF\u53E3 |
| | | server.port=8695 |
| | | #\u8BBE\u7F6E\u7A7A\u95F4\u540D\u79F0 |
| | | server.servlet.context-path=/his_synchro_sys |
| | | |
| | | logging.config=classpath:log4j2-local.xml |
| | | #\u8BBE\u7F6E\u6570\u636E\u5E93\u76F8\u5173 |
| | | spring.datasource.url=jdbc:mysql://localhost:3306/syn_phi_guide?useUnicode=true&characterEncoding=UTF-8 |
| | | spring.datasource.username=root |
| | | spring.datasource.password=root |
| | | spring.datasource.driver-class-name=com.mysql.jdbc.Driver |
| | | |
| | | |
| | | spring.data.mongodb.host=dds-bp17e9a4772fa0842276-pub.mongodb.rds.aliyuncs.com |
| | | spring.data.mongodb.port=3717 |
| | | spring.data.mongodb.database=charites-prod |
| | | spring.data.mongodb.authentication-database=admin |
| | | spring.data.mongodb.username=root |
| | | spring.data.mongodb.password=pHISKINdb2017 |
| | | |
| | | #\u8BBE\u7F6E\u76D1\u63A7\u8D26\u53F7 |
| | | spring.datasource.druid.stat-view-servlet.login-username=admin |
| | | spring.datasource.druid.stat-view-servlet.login-password=123456 |
| | | |
| | | #\u6307\u5B9A\u4E34\u65F6\u6587\u4EF6\u5B58\u653E\u4F4D\u7F6E |
| | | server.tomcat.basedir = /usr/app/upload |
| | | |
| | | #\u6253\u5370 |
| | | mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | logging.level.org.springframework.boot.autoconfigure: error |
| | | |
| | | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
| | | spring.datasource.druid.filters=stat,wall,log4j |
| | | spring.datasource.druid.initial-size=10 |
| | | spring.datasource.druid.max-active=50 |
| | | spring.datasource.druid.min-idle=10 |
| | | spring.datasource.druid.max-wait=20 |
| | | spring.datasource.druid.time-between-eviction-runs-millis=60000 |
| | | spring.datasource.druid.min-evictable-idle-time-millis=300000 |
| | | spring.datasource.druid.test-on-borrow=true |
| | | spring.datasource.druid.test-while-idle=false |
| | | |
| | | spring.datasource.druid.stat-view-servlet.enabled=true |
| | | spring.datasource.druid.stat-view-servlet.allow=127.0.0.1 |
| | | spring.datasource.druid.stat-view-servlet.url-pattern=/druid/* |
| | | |
| | | spring.datasource.druid.web-stat-filter.enabled= true |
| | | spring.datasource.druid.web-stat-filter.url-pattern=/* |
| | | spring.datasource.druid.web-stat-filter.exclusions='*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
| | | |
| | | # mybatis \u6587\u4EF6\u52A0\u8F7D\u8BBE\u7F6E |
| | | mybatis.type-aliases-package=com.hx.phip.model |
| | | mybatis.mapperLocations=classpath*:/mapper/phi/*.xml,classpath*:/mapper/syn/*.xml,classpath*:com/gitee/sunchenbin/mybatis/actable/mapping/*/*.xml,classpath*:com/hx/common/xml/*.xml |
| | | |
| | | #mysql\u81EA\u52A8\u5EFA\u8868 |
| | | mybatis.table.auto=update |
| | | mybatis.model.pack=com.hx.phip.model |
| | | mybatis.database.type=mysql |
| | | |
| | | #\u8BBE\u7F6E\u65F6\u95F4\u683C\u5F0F |
| | | spring.jackson.date-format = yyyy-MM-dd HH:mm:ss |
| | | spring.jackson.time-zone = GMT+8 |
| | | |
| | | #\u8BBE\u7F6E\u6587\u4EF6\u5927\u5C0F |
| | | spring.servlet.multipart.max-file-size=10MB |
| | | spring.servlet.multipart.max-request-size=10MB |
| | | |
| | | #\u8BBE\u7F6E\u5206\u9875 |
| | | pagehelper.helper-dialect=mysql |
| | | pagehelper.params=count=countSql |
| | | pagehelper.reasonable=true |
| | | pagehelper.support-methods-arguments=true |
| | | |
| | | #redis\uFFFD\uFFFD\uFFFD\uFFFD |
| | | # Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B7 |
| | | spring.redis.host=101.200.173.220 |
| | | # Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04F6\u02FF\uFFFD |
| | | spring.redis.port=6379 |
| | | # Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uB8E8\u012C\uFFFD\uFFFD\u03AA\uFFFD\u0563\uFFFD |
| | | spring.redis.password=cjh8899 |
| | | # \uFFFD\uFFFD\uFFFD\u04F3\uFFFD\u02B1\u02B1\uFFFD\u48E8\uFFFD\uFFFD\uFFFD\uB8E9 |
| | | spring.redis.timeout=10000 |
| | | # set database |
| | | spring.redis.database= 9 |
| | | platform.pattern = com.hx.phip.Test |
| | | |
| | | #\u9886\u5EFA\u914D\u7F6E |
| | | api.apiUrl = http://open.xxx.com |
| | | api.appId= 9d1a7c45-89d6-4241-b84a-32b34edc1283 |
| | | api.code = phiskin-open2 |
| | | api.secret = MDhkYmZiYjctNWU0ZS00YTM3LTgwNGYtYmMzYzRmMWQxZTYx |
| | | |
| | | systemConfig.baseUrl=https://serv.xxx.com |
| | | systemConfig.appid=9d1a7c45-89d6-4241-b84a-32b36edc1283-\u5C4F |
| | | systemConfig.secret=MDhkYmZiYjctNWU0ZS00YTM3LTgwNGYtYmMzYmRmMWQxZTYx |
| | | systemConfig.code=phiskin-open |
| | | |
| | | |
| | | #\u4F01\u4E1A\u5FAE\u4FE1id |
| | | systemConfig.corpId = xxx |
| | | #\u4F01\u4E1A\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u79D8\u94A5 |
| | | systemConfig.corpMpSecret = xxx-12Sp7ey4o |
| | | |
| | | #\u5C0F\u7A0B\u5E8FAPPID |
| | | systemConfig.appId = xxx |
New file |
| | |
| | | #\u8BBE\u7F6E\u7AEF\u53E3 |
| | | server.port=8088 |
| | | #\u8BBE\u7F6E\u7A7A\u95F4\u540D\u79F0 |
| | | server.servlet.context-path=/his_synchro |
| | | |
| | | logging.config=classpath:log4j2-prod.xml |
| | | |
| | | spring.datasource.phi.jdbc-url=jdbc:mysql://rm-bp1274ge7vf4zr67hzo.mysql.rds.aliyuncs.com:3306/phivipappoint?useUnicode=true&characterEncoding=UTF-8 |
| | | spring.datasource.phi.username=phimarketing |
| | | spring.datasource.phi.password=kpaIJRzlkEs8h0tq |
| | | spring.datasource.phi.driver-class-name=com.mysql.jdbc.Driver |
| | | |
| | | spring.datasource.syn.jdbc-urljdbc:mysql://rm-bp1274ge7vf4zr67hzo.mysql.rds.aliyuncs.com:3306/phivipappoint?useUnicode=true&characterEncoding=UTF-8 |
| | | spring.datasource.syn.username=phimarketing |
| | | spring.datasource.syn.password=kpaIJRzlkEs8h0tq |
| | | spring.datasource.syn.driver-class-name=com.mysql.jdbc.Driver |
| | | |
| | | #\u8BBE\u7F6E\u76D1\u63A7\u8D26\u53F7 |
| | | spring.datasource.druid.stat-view-servlet.login-username=admin |
| | | spring.datasource.druid.stat-view-servlet.login-:password=123456 |
| | | |
| | | #\u6307\u5B9A\u4E34\u65F6\u6587\u4EF6\u5B58\u653E\u4F4D\u7F6E |
| | | server.tomcat.basedir = /usr/app/upload |
| | | |
| | | #\u6253\u5370 |
| | | mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | logging.level.org.springframework.boot.autoconfigure: error |
| | | |
| | | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
| | | spring.datasource.druid.filters=stat,wall,log4j |
| | | spring.datasource.druid.initial-size=10 |
| | | spring.datasource.druid.max-active=50 |
| | | spring.datasource.druid.min-idle=10 |
| | | spring.datasource.druid.max-wait=20 |
| | | spring.datasource.druid.time-between-eviction-runs-millis=60000 |
| | | spring.datasource.druid.min-evictable-idle-time-millis=300000 |
| | | spring.datasource.druid.test-on-borrow=true |
| | | spring.datasource.druid.test-while-idle=false |
| | | |
| | | spring.datasource.druid.stat-view-servlet.enabled=true |
| | | spring.datasource.druid.stat-view-servlet.allow=127.0.0.1 |
| | | spring.datasource.druid.stat-view-servlet.url-pattern=/druid/* |
| | | |
| | | spring.datasource.druid.web-stat-filter.enabled= true |
| | | spring.datasource.druid.web-stat-filter.url-pattern=/* |
| | | spring.datasource.druid.web-stat-filter.exclusions='*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
| | | |
| | | # mybatis \u6587\u4EF6\u52A0\u8F7D\u8BBE\u7F6E |
| | | mybatis.type-aliases-package=com.hx.phip.model |
| | | mybatis.mapperLocations=com/hx/phip/dao/mapper/xml/*.xml,classpath*:com/gitee/sunchenbin/mybatis/actable/mapping/*/*.xml |
| | | |
| | | #mysql\u81EA\u52A8\u5EFA\u8868 |
| | | mybatis.table.auto=update |
| | | mybatis.model.pack= com.hx.phip.model |
| | | mybatis.database.type=mysql |
| | | |
| | | #\u8BBE\u7F6E\u65F6\u95F4\u683C\u5F0F |
| | | spring.jackson.date-format = yyyy-MM-dd HH:mm:ss |
| | | spring.jackson.time-zone = GMT+8 |
| | | |
| | | #\u8BBE\u7F6E\u6587\u4EF6\u5927\u5C0F |
| | | spring.servlet.multipart.max-file-size=10MB |
| | | spring.servlet.multipart.max-request-size=10MB |
| | | |
| | | #\u8BBE\u7F6E\u5206\u9875 |
| | | pagehelper.helper-dialect=mysql |
| | | pagehelper.params=count=countSql |
| | | pagehelper.reasonable=true |
| | | pagehelper.support-methods-arguments=true |
| | | |
New file |
| | |
| | | spring.application.name = p-synchro-service |
| | | spring.cloud.nacos.discovery.server-addr=1.15.12.102:8848 |
| | | spring.cloud.nacos.discovery.group = phiskin |
| | | |
| | | spring.cloud.nacos.discovery.namespace=e7d83269-bd0f-4ee0-8012-6ffac8966a35 |
| | | |
| | | spring.cloud.nacos.config.server-addr = 1.15.12.102:8848 |
| | | spring.cloud.nacos.config.group = phiskin |
| | | spring.cloud.nacos.config.file-extension = properties |
| | | |
| | | spring.cloud.nacos.config.namespace=e7d83269-bd0f-4ee0-8012-6ffac8966a35 |
| | | |
New file |
| | |
| | | log4j.rootLogger=info,appender |
| | | |
| | | #\u8F93\u51FA\u5230\u63A7\u5236\u53F0 |
| | | log4j.appender.appender=org.apache.log4j.ConsoleAppender |
| | | #\u6837\u5F0F\u4E3ATTCCLayout |
| | | log4j.appender.appender.layout=org.apache.log4j.TTCCLayout |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!-- status :表示log4j自身日志的打印级别 --> |
| | | <!-- monitorInterval:含义是每隔300秒重新读取配置文件,可以不重启应用的情况下修改配置 --> |
| | | <Configuration status="warn" monitorInterval="300"> |
| | | <properties> |
| | | <property name="INFO_FILE_NAME">info</property> |
| | | <property name="ERROR_FILE_NAME">error</property> |
| | | <property name="DEBUG_FILE_NAME">debug</property> |
| | | <property name="WARN_FILE_NAME">warn</property> |
| | | <property name="PAY_FILE_NAME">pay</property> |
| | | <property name="UNIFIED_FOLDER">C:\work\project\phi-synchro-his\log\</property> |
| | | </properties> |
| | | |
| | | <Appenders> |
| | | <Console name="Console" target="SYSTEM_OUT"> |
| | | <!-- 左对齐,最小宽度为4;长度>10也可正常显示,不足4用空格补齐 --> |
| | | <PatternLayout charset="UTF-8" pattern="%d{DEFAULT} [%t] %-4level - %l - %msg%n"/> |
| | | </Console> |
| | | |
| | | <!-- fileName:日志位置以及文件名;filePattern:rolling时新建文件的位置以及命名规则。命名文件名称需要细到时分秒是注意不要这么写 |
| | | HH:mm:ss,文件名称不可以包含特殊字符:使用"-"代替 --> |
| | | <RollingRandomAccessFile name="INFO_FILE" |
| | | fileName="${UNIFIED_FOLDER}/${INFO_FILE_NAME}.log" |
| | | filePattern="${UNIFIED_FOLDER}/base/$${date:yyyy-MM}/${INFO_FILE_NAME}-%d{yyyy-MM-dd}-%i.log.gz" |
| | | append="true"> |
| | | |
| | | <Filters> |
| | | <ThresholdFilter level="WARN" onMatch="DENY" onMismatch="NEUTRAL"/> |
| | | <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/> |
| | | </Filters> |
| | | <PatternLayout |
| | | pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %l - %msg%n"/> |
| | | <Policies> |
| | | <!-- 下面两个策略:满足一个,即会产生一个文件 --> |
| | | <!-- 日志文件大于100M,就新建文件 --> |
| | | <SizeBasedTriggeringPolicy size="100 MB"/> |
| | | <!-- 结合filePattern:精确到dd(天),所以表示每天产生一个日志文件 --> |
| | | <TimeBasedTriggeringPolicy interval="1"/> |
| | | </Policies> |
| | | <!-- 作用于filePattern中的i,最大20个文件。 --> |
| | | <DefaultRolloverStrategy max="20"/> |
| | | </RollingRandomAccessFile> |
| | | |
| | | <RollingRandomAccessFile name="ERROR_FILE" append="true" fileName="${UNIFIED_FOLDER}/${ERROR_FILE_NAME}.log" |
| | | filePattern="${UNIFIED_FOLDER}/error/$${date:yyyy-MM}/${ERROR_FILE_NAME}-%d{yyyy-MM}-%i.log.gz"> |
| | | <Filters> |
| | | <ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/> |
| | | <ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/> |
| | | </Filters> |
| | | <PatternLayout |
| | | pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %l - %msg%n"/> |
| | | <Policies> |
| | | <SizeBasedTriggeringPolicy size="100 MB"/> |
| | | <TimeBasedTriggeringPolicy interval="1"/> |
| | | </Policies> |
| | | <DefaultRolloverStrategy max="20"/> |
| | | </RollingRandomAccessFile> |
| | | |
| | | <RollingRandomAccessFile name="DEBUG_FILE" fileName="${UNIFIED_FOLDER}/${DEBUG_FILE_NAME}.log" |
| | | filePattern="${UNIFIED_FOLDER}/error/$${date:yyyy-MM}/${DEBUG_FILE_NAME}-%d{yyyy-MM}-%i.log.gz" append="true"> |
| | | <Filters> |
| | | <ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/> |
| | | <ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/> |
| | | </Filters> |
| | | <PatternLayout |
| | | pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %l - %msg%n"/> |
| | | <Policies> |
| | | <SizeBasedTriggeringPolicy size="100 MB"/> |
| | | <TimeBasedTriggeringPolicy interval="1"/> |
| | | </Policies> |
| | | <DefaultRolloverStrategy max="20"/> |
| | | </RollingRandomAccessFile> |
| | | |
| | | <RollingRandomAccessFile name="WARN_FILE" fileName="${UNIFIED_FOLDER}/${WARN_FILE_NAME}.log" |
| | | filePattern="${UNIFIED_FOLDER}/error/$${date:yyyy-MM}/${WARN_FILE_NAME}-%d{yyyy-MM}-%i.log.gz" append="true"> |
| | | <Filters> |
| | | <ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/> |
| | | </Filters> |
| | | <PatternLayout |
| | | pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %l - %msg%n"/> |
| | | <Policies> |
| | | <SizeBasedTriggeringPolicy size="100 MB"/> |
| | | <TimeBasedTriggeringPolicy interval="1"/> |
| | | </Policies> |
| | | <DefaultRolloverStrategy max="20"/> |
| | | </RollingRandomAccessFile> |
| | | |
| | | </Appenders> |
| | | |
| | | <Loggers> |
| | | <!-- additivity="false"表示在该logger中输出的日志不会再延伸到父层logger。这里如果改为true,则会延伸到Root |
| | | Logger,遵循Root Logger的配置也输出一次。 --> |
| | | <!-- logger的级别优先于appender的级别,logger为debug,appender为info,debug信息依然可以呈现。即以logger级别为主。 --> |
| | | <!-- logger可以配置多个 --> |
| | | <logger name="com.hx.phi_platform.controller.TestController" level="info" additivity="false"> |
| | | <appender-ref ref="PAY_FILE"/> |
| | | </logger> |
| | | |
| | | <Root level="debug"> |
| | | <AppenderRef ref="Console"/> |
| | | <AppenderRef ref="INFO_FILE"/> |
| | | <AppenderRef ref="ERROR_FILE"/> |
| | | <AppenderRef ref="DEBUG_FILE"/> |
| | | <AppenderRef ref="WARN_FILE"/> |
| | | </Root> |
| | | </Loggers> |
| | | </Configuration> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!-- status :表示log4j自身日志的打印级别 --> |
| | | <!-- monitorInterval:含义是每隔300秒重新读取配置文件,可以不重启应用的情况下修改配置 --> |
| | | <Configuration status="warn" monitorInterval="300"> |
| | | <properties> |
| | | <property name="INFO_FILE_NAME">info</property> |
| | | <property name="ERROR_FILE_NAME">error</property> |
| | | <property name="UNIFIED_FOLDER">logs/phi-synchro-his/</property> |
| | | </properties> |
| | | |
| | | <Appenders> |
| | | |
| | | <!-- fileName:日志位置以及文件名;filePattern:rolling时新建文件的位置以及命名规则。命名文件名称需要细到时分秒是注意不要这么写 |
| | | HH:mm:ss,文件名称不可以包含特殊字符:使用"-"代替 --> |
| | | <RollingRandomAccessFile name="INFO_FILE" |
| | | fileName="${UNIFIED_FOLDER}/${INFO_FILE_NAME}.log" |
| | | filePattern="${UNIFIED_FOLDER}/base/$${date:yyyy-MM}/${INFO_FILE_NAME}-%d{yyyy-MM-dd}-%i.log.gz" |
| | | append="true"> |
| | | |
| | | <Filters> |
| | | <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/> |
| | | </Filters> |
| | | <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %l - %msg%n"/> |
| | | <Policies> |
| | | <!-- 下面两个策略:满足一个,即会产生一个文件 --> |
| | | <!-- 日志文件大于100M,就新建文件 --> |
| | | <SizeBasedTriggeringPolicy size="30MB"/> |
| | | <!-- 结合filePattern:精确到dd(天),所以表示每天产生一个日志文件 --> |
| | | <TimeBasedTriggeringPolicy interval="1"/> |
| | | </Policies> |
| | | <!-- 作用于filePattern中的i,最大20个文件。 --> |
| | | <DefaultRolloverStrategy max="20"/> |
| | | </RollingRandomAccessFile> |
| | | |
| | | <RollingRandomAccessFile name="ERROR_FILE" |
| | | fileName="${UNIFIED_FOLDER}/${ERROR_FILE_NAME}.log" |
| | | filePattern="${UNIFIED_FOLDER}/error/$${date:yyyy-MM}/${ERROR_FILE_NAME}-%d{yyyy-MM}-%i.log.gz" |
| | | append="true"> |
| | | |
| | | |
| | | <Filters> |
| | | <ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/> |
| | | <ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/> |
| | | </Filters> |
| | | <PatternLayout |
| | | pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %l - %msg%n"/> |
| | | <Policies> |
| | | <SizeBasedTriggeringPolicy size="30MB"/> |
| | | <TimeBasedTriggeringPolicy interval="1"/> |
| | | </Policies> |
| | | <DefaultRolloverStrategy max="20"/> |
| | | </RollingRandomAccessFile> |
| | | |
| | | </Appenders> |
| | | <Loggers> |
| | | <!-- additivity="false"表示在该logger中输出的日志不会再延伸到父层logger。这里如果改为true,则会延伸到Root |
| | | Logger,遵循Root Logger的配置也输出一次。 --> |
| | | <!-- logger的级别优先于appender的级别,logger为debug,appender为info,debug信息依然可以呈现。即以logger级别为主。 --> |
| | | <!-- logger可以配置多个 --> |
| | | <!--<logger name="com.dingDong.dao.mapper" level="debug" additivity="false"> |
| | | <appender-ref ref="Console"/> |
| | | </logger>--> |
| | | <!--支付日志--> |
| | | <logger name="com.hx.phi_platform.controller.PayNotifyController" level="info" additivity="false"> |
| | | <appender-ref ref="PAY_FILE"/> |
| | | </logger> |
| | | |
| | | <Root level="debug"> |
| | | <AppenderRef ref="INFO_FILE"/> |
| | | <AppenderRef ref="ERROR_FILE"/> |
| | | </Root> |
| | | </Loggers> |
| | | </Configuration> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <properties> |
| | | <dist>target/build</dist> |
| | | <res>target/build/resources</res> |
| | | <dist-tmp>target/build/tmp</dist-tmp> |
| | | <app-name>${project.artifactId}-${project.version}</app-name> |
| | | <real-app-name>${project.artifactId}</real-app-name> |
| | | </properties> |
| | | |
| | | <parent> |
| | | <groupId>com.hx</groupId> |
| | | <artifactId>phi-synchro</artifactId> |
| | | <version>stander</version> |
| | | </parent> |
| | | |
| | | <artifactId>phi-synchro-his</artifactId> |
| | | <version>stander</version> |
| | | |
| | | <dependencies> |
| | | <!--springCloud-nacos--> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-ribbon</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-ribbon</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
| | | </dependency> |
| | | |
| | | <!--spring cloud的支持--> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-bootstrap</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-context --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-context</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-commons --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-commons</artifactId> |
| | | </dependency> |
| | | |
| | | <!--openfeign的支持--> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-openfeign</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-loadbalancer</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-log4j2</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>hx-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>phi-synchro-common</artifactId> |
| | | <version>stander</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>phi-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>commons-fileupload</groupId> |
| | | <artifactId>commons-fileupload</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>platform-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>hx-auto</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.hz</groupId> |
| | | <artifactId>phis-feign</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-tomcat</artifactId> |
| | | <!--<scope>provided</scope>--> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-mongodb</artifactId> |
| | | <!--排除使用logback日志--> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>logback-classic</artifactId> |
| | | <groupId>ch.qos.logback</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!--数据监控平台(sql)--> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- mybatis分页 --> |
| | | <dependency> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| | | <!--排除使用logback日志--> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>logback-classic</artifactId> |
| | | <groupId>ch.qos.logback</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-aop</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.aliyun.oss</groupId> |
| | | <artifactId>aliyun-sdk-oss</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.tomcat.embed</groupId> |
| | | <artifactId>tomcat-embed-jasper</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>javax.servlet.jsp.jstl</groupId> |
| | | <artifactId>jstl-api</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>servlet-api</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>jstl</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.junit.jupiter</groupId> |
| | | <artifactId>junit-jupiter-api</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </dependency> |
| | | |
| | | <!--rabbitmq--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-amqp</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-context</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>io.lettuce</groupId> |
| | | <artifactId>lettuce-core</artifactId> |
| | | </dependency> |
| | | |
| | | <!--<dependency> |
| | | <groupId>net.sf.json-lib</groupId> |
| | | <artifactId>json-lib</artifactId> |
| | | </dependency>--> |
| | | <dependency> |
| | | <groupId>com.hx.gitee</groupId> |
| | | <artifactId>guide-common</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <resources> |
| | | <resource> |
| | | <directory>src/main/java</directory> |
| | | <includes> |
| | | <include>**/*.xml</include> |
| | | </includes> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | <excludes> |
| | | <exclude>*.properties</exclude> |
| | | <exclude>*.xml</exclude> |
| | | </excludes> |
| | | </resource> |
| | | </resources> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.hx.phip; |
| | | |
| | | import com.hx.auto.GeneratorUtil; |
| | | import com.hx.auto.common.UrlData; |
| | | import com.hx.phiappt.model.UserMoneyLog; |
| | | |
| | | |
| | | /** |
| | | * 自动生成工具 |
| | | * 2019-08-29 |
| | | * @author cjh |
| | | * |
| | | */ |
| | | public class AutoDomeUtil { |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | |
| | | System.out.println("开始"); |
| | | String packageName = AutoDomeUtil.class.getPackage().getName(); |
| | | String packRoot = "phi-synchro-common.src.main.java"; |
| | | UrlData urlData = new UrlData(); |
| | | urlData.setTotalUrl(packageName); |
| | | urlData.actionUrlData(packRoot,packageName + ".controller.front"); |
| | | urlData.daoUrlData(packRoot,packageName + ".dao.mapper.phi"); |
| | | /*urlData.serviceUrlData(packRoot,packageName + ".service"); |
| | | urlData.serviceImplUrlData(packRoot,packageName + ".service.impl");*/ |
| | | // urlData.mapperUrlData(packRoot, packageName + ".dao.mapper.xml"); |
| | | // urlData.mapperUrlData(packRoot, packageName + "classpath*:/mapper/syn"); |
| | | urlData.mapperUrlData("phi-synchro-common.src.main.resources" , "mapper.phi"); |
| | | |
| | | |
| | | |
| | | Class<?> clas = UserMoneyLog.class; |
| | | //dao |
| | | GeneratorUtil.generatorDao(clas, urlData); |
| | | //mapper |
| | | GeneratorUtil.generatorMapper(clas, urlData); |
| | | //action |
| | | // GeneratorUtil.generatorAction(clas,urlData); |
| | | // 生成service |
| | | GeneratorUtil.generatorService(clas,urlData); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip; |
| | | |
| | | import com.hx.util.AesUtil; |
| | | import com.hx.util.rsa.RSAUtil; |
| | | import org.jasypt.util.text.BasicTextEncryptor; |
| | | |
| | | public class Rsa { |
| | | public static void main(String[] args) { |
| | | |
| | | System.out.println(AesUtil.aesEncryp("ev8i6tfy9Gg0eyaF6SDyvNHcsNGNeff8enwT_eLKf_0")); |
| | | |
| | | BasicTextEncryptor encryptor = new BasicTextEncryptor(); |
| | | encryptor.setPassword(AesUtil.SECRET); |
| | | String encrypted = encryptor.encrypt("99sdfa5454a4f5asd4f55saf4"); |
| | | System.out.println(encrypted); |
| | | |
| | | //配置文件数据加密 |
| | | /*BasicTextEncryptor encryptor = new BasicTextEncryptor(); |
| | | encryptor.setPassword(AesUtil.SECRET); |
| | | String encrypted = encryptor.encrypt("pis_rw:UYWoCz#4^@w5Soj*"); |
| | | System.out.println(encrypted);*/ |
| | | //解密 |
| | | //String decrypt = encryptor.decrypt("uFESkQwpAXSxg0SUR6BOlTujZqFC3pfIi3eTfuP0Lmrd0fqxG5XC4X0ho0Sp2FEV"); |
| | | //System.out.println("decrypt:"+decrypt); |
| | | |
| | | //RSAUtil.main(null); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import com.hx.exception.TipsException; |
| | | import com.hx.phiappt.common.OrderTotalConstants; |
| | | import com.hx.phiappt.common.RoleType; |
| | | import com.hx.util.DateUtil; |
| | | import com.hx.util.StringUtils; |
| | | import com.hx.util.rsa.RSAUtil; |
| | | import org.apache.commons.lang.RandomStringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | |
| | | public class Test { |
| | | private static Logger logger = LoggerFactory.getLogger(Test.class); |
| | | public static void main(String[] args) throws Exception { |
| | | /*System.out.println("11:"+ MysqlHexAesTool.decryptData("744803A3E5BB6EAA2D6E1E6A6EA6930B", "215fdbfefefa074906695dcafbbfcf93",null)); |
| | | System.out.println("11:"+MysqlHexAesTool.decryptData("A3C47C917E695FC07E6AB5DDE45BCAF8", "215fdbfefefa074906695dcafbbfcf93",null)); |
| | | System.out.println("11:"+MysqlHexAesTool.decryptData("44F2616CFF292E6D7628BD6EB0AE6F51", "215fdbfefefa074906695dcafbbfcf93",null)); |
| | | System.out.println("11:"+MysqlHexAesTool.decryptData("A21036759A8B345916EF798A76E5C75C", "123456789",null)); |
| | | System.out.println(MysqlHexAesTool.encryptData("18918797573", "123456789",null)); |
| | | System.out.println(MysqlHexAesTool.encryptData("18838083708", "215fdbfefefa074906695dcafbbfcf93",null));*/ |
| | | |
| | | /* String publicKeyStr="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgFI+OzRsz0mkuEPHYZwbM2vLVubjoHVlQdSngB0vFWkmPc6RuQX8/mtPyQ3i/F1EW2CdapHPliLl5N0QtO+v7NcP+i5nS2TgHpXDzJnU/Sm2SXXN2wMncg4Gk9I1Bbl9IKKOBZ6+jMeRLpYcl3okmshqAHu1zzAepXUiqgr0lk0E2etNzq8cOdouTZXj0VHgq6MUtAfucRXV8nqUpIDZEZWwxPc27xr0XtCllOXcJv0scJZsPmuVcPs5W/4GAXkeGbwLLdSnMnmyx2wE0PwBDehdg1xwQftlbd0tOyrQAbgfONAPu1fCy6QfZa0tksSGqKnS+qlck/U6wCtn/8TSewIDAQAB"; |
| | | String appId ="54654asdf56sd1e1gv567as1"; |
| | | Map<String, String> map=getSignData(appId,publicKeyStr); |
| | | System.out.println(map.get("sign"));*/ |
| | | |
| | | /*String publicKeyStr="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgR8YuvjPRVTjlGwzzIfqsHXZzQ/mCJS30Xg3D8v+VnPqrsM2iPSbB1ztu6VKC3SAffwyDQ2NXWxKwNuYFNakbAHZ9EaK+YXdGfajFsaiAHuK5GZuJeGGkbxN3WrRkXSDjYfuhnn+8aXc7dlGIigTPenEGhKn+5MlPOT/pBVH+EHnJENtLj37UmURevUR1QD7QplG6tzzlO789auLwBsvcxjx9ZF9gPZGMngX/k0Bw8f+/HBIZBdbmUtMCefGAvqwkgjLZWpBScQW/PY87gtvxBe0Q9xCEyOdwBcT8k/UZr2vIRwrJlNSeW4Lx4V6+AaPDawABKU30c1uQmxzbOr5aQIDAQAB"; |
| | | String appId ="9454dsf41s1w1n4tyko4a4dsfg4s"; |
| | | Map<String, String> map=getSignData(appId,publicKeyStr); |
| | | System.out.println(map.get("sign"));*/ |
| | | |
| | | /* BigDecimal price=new BigDecimal("10.00").divide(new BigDecimal("3"),2,BigDecimal.ROUND_HALF_UP); |
| | | System.out.println("单价:"+price); |
| | | |
| | | BigDecimal price1=price.multiply(new BigDecimal("2")); |
| | | System.out.println(price1); |
| | | |
| | | BigDecimal price2=new BigDecimal("10.00").subtract(price1); |
| | | System.out.println(price2); |
| | | System.out.println(); |
| | | |
| | | System.out.println(new BigDecimal("10.00").divide(new BigDecimal("3"),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("2")).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | System.out.println(new BigDecimal(10).subtract(new BigDecimal("10.00").divide(new BigDecimal(3),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(3-1)).setScale(2,BigDecimal.ROUND_HALF_UP)).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | |
| | | */ |
| | | |
| | | /*BigDecimal actulTotal=new BigDecimal("0.8").multiply(new BigDecimal("1")).setScale(2,BigDecimal.ROUND_HALF_UP); |
| | | System.out.println("小计:"+actulTotal); |
| | | |
| | | BigDecimal percentage1=actulTotal.divide(new BigDecimal("3.20"),10,BigDecimal.ROUND_HALF_UP); |
| | | System.out.println("换算率:"+percentage1); |
| | | |
| | | BigDecimal zfb=new BigDecimal("0.2").multiply(percentage1).setScale(2,BigDecimal.ROUND_HALF_UP); |
| | | |
| | | System.out.println("zfb:"+zfb); |
| | | |
| | | BigDecimal wx=new BigDecimal("3").multiply(percentage1).setScale(2,BigDecimal.ROUND_HALF_UP); |
| | | System.out.println("wx:"+wx);*/ |
| | | |
| | | |
| | | |
| | | /* System.out.println(new BigDecimal(0).compareTo(BigDecimal.ZERO)); |
| | | System.out.println(new BigDecimal(10.1).compareTo(BigDecimal.ZERO)); |
| | | System.out.println(new BigDecimal(204.10).compareTo(new BigDecimal(25000.00))); |
| | | |
| | | System.out.println(new BigDecimal(204.10).add(new BigDecimal(0)).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | System.out.println(new BigDecimal(25204.1).subtract(new BigDecimal(25000.00)).setScale(2,BigDecimal.ROUND_HALF_UP));*/ |
| | | |
| | | |
| | | /* Date date = DateUtil.parseString_1("2016-09-21 00:00:00");;//date等于当前时间 |
| | | System.out.println("------------------------"); |
| | | System.out.println("DATE:"+date); |
| | | Long longDate = date.getTime(); |
| | | System.out.println("LONGDATE:"+longDate); |
| | | SimpleDateFormat formatTime= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//HH是24小时制,12小时用hh |
| | | String strDate = formatTime.format(date); |
| | | System.out.println("STRING:"+strDate);*/ |
| | | /* System.out.println(new BigDecimal("3933.33").multiply(new BigDecimal(1)).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | System.out.println(new BigDecimal("3933.33").multiply(new BigDecimal(2)).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | System.out.println(new BigDecimal("11800.00").subtract(new BigDecimal("3933.33").multiply(new BigDecimal(3-1)).setScale(2,BigDecimal.ROUND_HALF_UP)).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | BigDecimal total=BigDecimal.ZERO; |
| | | System.out.println(total.add(new BigDecimal("11800.00").subtract(new BigDecimal("3933.33").multiply(new BigDecimal(3-1)).setScale(2,BigDecimal.ROUND_HALF_UP)).setScale(2,BigDecimal.ROUND_HALF_UP))); |
| | | */ |
| | | |
| | | } |
| | | public static boolean isValid(String s) { |
| | | int length = s.length()/2; |
| | | System.out.println(length); |
| | | for (int i = 0; i < length ; i++) { |
| | | s=s.replace("()","").replace("{}","").replace("[]",""); |
| | | } |
| | | return s.length()==0; |
| | | } |
| | | /** |
| | | * 根据时间获取本月所有日期 |
| | | * @param date |
| | | * @return |
| | | */ |
| | | public static List<String> getMonthDay(String date) { |
| | | |
| | | List<String> list = getMonthFullDay(date); |
| | | List<String> listDay = new ArrayList<>(); |
| | | for (String date1 : list) { |
| | | listDay.add(date1.substring(0, 10)); |
| | | } |
| | | return listDay; |
| | | } |
| | | private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | public static List<String> getMonthFullDay(String date) { |
| | | List<String> fullDayList = new ArrayList<String>(); |
| | | int year = Integer.parseInt(date.substring(0, 4)); |
| | | int month = Integer.parseInt(date.substring(5, 7)); |
| | | int day = 1;// 所有月份从1号开始 |
| | | Calendar cal = Calendar.getInstance();// 获得当前日期对象 |
| | | cal.clear();// 清除信息 |
| | | cal.set(Calendar.YEAR, year); |
| | | cal.set(Calendar.MONTH, month - 1);// 1月从0开始 |
| | | cal.set(Calendar.DAY_OF_MONTH, day); |
| | | int count = cal.getActualMaximum(Calendar.DAY_OF_MONTH); |
| | | for (int j = 0; j <= (count - 1); ) { |
| | | if (sdf.format(cal.getTime()).equals(getLastDay(year, month))) |
| | | break; |
| | | cal.add(Calendar.DAY_OF_MONTH, j == 0 ? +0 : +1); |
| | | j++; |
| | | fullDayList.add(sdf.format(cal.getTime())); |
| | | } |
| | | return fullDayList; |
| | | } |
| | | public static String getLastDay(int year, int month) { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.set(Calendar.YEAR, year); |
| | | cal.set(Calendar.MONTH, month); |
| | | cal.set(Calendar.DAY_OF_MONTH, 0); |
| | | return sdf.format(cal.getTime()); |
| | | } |
| | | private static DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | |
| | | public static List<Map> getScope() { |
| | | String date = "2023-01-01"; |
| | | String timeStrs[] = date.split("-"); |
| | | Calendar c = Calendar.getInstance(); |
| | | c.set(Calendar.YEAR, Integer.parseInt(timeStrs[0])); |
| | | c.set(Calendar.MONTH, Integer.parseInt(timeStrs[1]) - 1); |
| | | c.setFirstDayOfWeek(Calendar.MONDAY); |
| | | int weeks = c.getActualMaximum(Calendar.WEEK_OF_MONTH); |
| | | |
| | | LocalDate localDateate = LocalDate.parse(date, dateTimeFormatter); |
| | | //月份第一周的起始时间和结束时间 |
| | | LocalDate firstDay = localDateate.with(TemporalAdjusters.firstDayOfMonth()); |
| | | String firstDayStr = firstDay.format(dateTimeFormatter); |
| | | String sunStr = getSunOfWeek(firstDayStr); |
| | | |
| | | List<Map> weekInfos = new ArrayList<>(); |
| | | for (int i = 1; i <= weeks; i++) { |
| | | Map weekInfo = new HashMap(); |
| | | //第一周的起始时间就是当月的1号,结束时间就是周日 |
| | | if (i == 1) { |
| | | weekInfo.put("start",firstDayStr); |
| | | weekInfo.put("end",sunStr); |
| | | weekInfo.put("order",i); |
| | | //计算接下来每周的周一和周日 |
| | | } else if (i < weeks) { |
| | | //由于sunStr是上一周的周日,所以取周一要取sunStr的下一周的周一 |
| | | String monDay = getLastMonOfWeek(sunStr); |
| | | sunStr = getSunOfWeek(monDay); |
| | | weekInfo.put("start",monDay); |
| | | weekInfo.put("end",sunStr); |
| | | weekInfo.put("order",i); |
| | | //由于最后一周可能结束时间不是周日,所以要单独处理 |
| | | } else { |
| | | String monDay = getLastMonOfWeek(sunStr); |
| | | //结束时间肯定就是当前月的最后一天 |
| | | LocalDate lastDay = localDateate.with(TemporalAdjusters.lastDayOfMonth()); |
| | | String endDay = lastDay.format(dateTimeFormatter); |
| | | weekInfo.put("start",monDay); |
| | | weekInfo.put("end",endDay); |
| | | weekInfo.put("order",i); |
| | | } |
| | | |
| | | weekInfos.add(weekInfo); |
| | | |
| | | } |
| | | return weekInfos; |
| | | } |
| | | |
| | | //算出所在周的周日 |
| | | public static String getSunOfWeek(String time) { |
| | | LocalDate localDateate = LocalDate.parse(time, dateTimeFormatter); |
| | | LocalDate endday = localDateate.with(TemporalAdjusters.next(java.time.DayOfWeek.MONDAY)).minusDays(1); |
| | | String endDayStr = endday.format(dateTimeFormatter); |
| | | return endDayStr; |
| | | } |
| | | |
| | | //下一周的周一 |
| | | public static String getLastMonOfWeek(String time) { |
| | | LocalDate localDateate = LocalDate.parse(time, dateTimeFormatter); |
| | | LocalDate endday = localDateate.with(TemporalAdjusters.next(java.time.DayOfWeek.MONDAY)); |
| | | String endDayStr = endday.format(dateTimeFormatter); |
| | | return endDayStr; |
| | | } |
| | | |
| | | |
| | | |
| | | public static String generateSign(Map<String, Object> params, String appSecret, String signMethod) { |
| | | // 第一步:参数排序 |
| | | List<String> keys = Lists.newArrayList(); |
| | | for (Map.Entry<String, Object> entry : params.entrySet()) { |
| | | if (StringUtils.noNull((String) entry.getValue())) { |
| | | keys.add(entry.getKey()); |
| | | } |
| | | } |
| | | Collections.sort(keys); |
| | | // 第二步:把所有参数名和参数值串在一起 |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (StringUtils.noNull(appSecret)) { |
| | | sb.append(appSecret); |
| | | } |
| | | for (String key : keys) { |
| | | sb.append(key).append(params.get(key).toString().trim()); |
| | | } |
| | | if (StringUtils.noNull(appSecret)) { |
| | | sb.append(appSecret); |
| | | } |
| | | String encryptionKey = sb.toString().trim(); |
| | | // 第三步:加签 |
| | | if (signMethod.equals("MD5")) { |
| | | try { |
| | | String sign = genMd5(encryptionKey); |
| | | return sign; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | }else{ |
| | | //开发者暂不需支持,支持MD5即可 |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public static String genMd5(String info) throws NoSuchAlgorithmException, UnsupportedEncodingException { |
| | | MessageDigest md5 = MessageDigest.getInstance("MD5"); |
| | | byte[] infoBytes = info.getBytes(); |
| | | md5.update(infoBytes); |
| | | byte[] sign = md5.digest(); |
| | | return byteArrayToHex(sign); |
| | | } |
| | | |
| | | public static String byteArrayToHex(byte[] bytes) { |
| | | StringBuilder sign = new StringBuilder(); |
| | | for (int i = 0; i < bytes.length; i++) { |
| | | String hex = Integer.toHexString(bytes[i] & 0xFF); |
| | | if (hex.length() == 1) { |
| | | sign.append("0"); |
| | | } |
| | | sign.append(hex.toLowerCase()); |
| | | } |
| | | return sign.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static Map<String, String> getSignData(String appId, String publicKeyStr) throws Exception { |
| | | Map<String, String> headerMap = new HashMap<>(); |
| | | // 获取时间戳 |
| | | long time = new Date().getTime(); |
| | | // 获取随机字符串 |
| | | String generatedString = RandomStringUtils.randomAlphabetic(10); |
| | | // 生成签名消息 |
| | | String message = String.format("%s_%s_%s", appId, time, generatedString); |
| | | // 公钥加密 |
| | | String byte2Base64 = RSAUtil.publicEncrypt(message, publicKeyStr); |
| | | // 字符串还行符号处理 |
| | | if(byte2Base64 != null){ |
| | | byte2Base64 = byte2Base64.replaceAll("\r","").replaceAll("\n",""); |
| | | } |
| | | // 生成请求头签名数据 |
| | | headerMap.put("appId", appId); |
| | | headerMap.put("sign", byte2Base64); |
| | | // 返回加密数据 |
| | | return headerMap; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public class Test2 { |
| | | |
| | | public static void main(String[] args) { |
| | | List<Integer> statusList = Arrays.asList(1, 2); |
| | | System.out.println(statusList); |
| | | System.out.println(statusList.contains(1)); |
| | | System.out.println(statusList.contains(3)); |
| | | statusList.add(3); |
| | | System.out.println(statusList.contains(3)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his; |
| | | |
| | | |
| | | import com.hx.bean.annotations.RequestSecurity; |
| | | import com.hx.util.AesUtil; |
| | | import com.hx.phip.his.config.UniqueNameGenerator; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.CommandLineRunner; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.ServletComponentScan; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | //@MapperScan({"com.hx.phiappt.dao.*"}) |
| | | //@ComponentScan(basePackages = {"com.hx.phip.*","com.hx.redis","com.hx.common.*"},nameGenerator = UniqueNameGenerator.class) |
| | | //@ServletComponentScan |
| | | //@EnableScheduling |
| | | //@EnableAsync |
| | | ////@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) |
| | | //@SpringBootApplication(exclude = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,DataSourceAutoConfiguration.class} ) |
| | | //@RequestSecurity |
| | | //@EnableDiscoveryClient |
| | | //@EnableFeignClients(basePackages = {"com.hx.phip.*","com.hz.his.feign.*"}) |
| | | public class PhiPlatformUserApplication extends SpringBootServletInitializer implements CommandLineRunner { |
| | | |
| | | public static void main(String[] args) { |
| | | System.setProperty("jasypt.encryptor.password", AesUtil.SECRET); |
| | | SpringApplication.run(PhiPlatformUserApplication.class, args); |
| | | } |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
| | | return builder.sources(PhiPlatformUserApplication.class); |
| | | } |
| | | |
| | | @Override |
| | | public void run(String... args) { |
| | | System.out.println("SpringBoot is Running..."); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 系统配置 |
| | | */ |
| | | @Component |
| | | public class BaseConfig { |
| | | |
| | | |
| | | |
| | | /**OSS配置*/ |
| | | @Value("${systemConfig.ossKeyId:}") |
| | | private String ossKeyId; |
| | | @Value("${systemConfig.ossKeySecret:}") |
| | | private String ossKeySecret; |
| | | @Value("${systemConfig.ossBucket:}") |
| | | private String ossBucket; |
| | | @Value("${systemConfig.ossEndPoint:}") |
| | | private String ossEndPoint; |
| | | |
| | | |
| | | public BaseConfig() { |
| | | |
| | | } |
| | | |
| | | public String getOssKeyId() { |
| | | return ossKeyId; |
| | | } |
| | | |
| | | public void setOssKeyId(String ossKeyId) { |
| | | this.ossKeyId = ossKeyId; |
| | | } |
| | | |
| | | public String getOssKeySecret() { |
| | | return ossKeySecret; |
| | | } |
| | | |
| | | public void setOssKeySecret(String ossKeySecret) { |
| | | this.ossKeySecret = ossKeySecret; |
| | | } |
| | | |
| | | public String getOssBucket() { |
| | | return ossBucket; |
| | | } |
| | | |
| | | public void setOssBucket(String ossBucket) { |
| | | this.ossBucket = ossBucket; |
| | | } |
| | | |
| | | public String getOssEndPoint() { |
| | | return ossEndPoint; |
| | | } |
| | | |
| | | public void setOssEndPoint(String ossEndPoint) { |
| | | this.ossEndPoint = ossEndPoint; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.PropertySource; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 企业微信和小程序配置 |
| | | */ |
| | | @Component |
| | | public class CustomParameter { |
| | | /**加解密密钥*/ |
| | | @Value("${mysql.hxe.aes.fixd.key:}") |
| | | private String aesFixedKey; |
| | | /**公共平台地址*/ |
| | | @Value("${public.platform.url:}") |
| | | private String url; |
| | | /**RSA账号*/ |
| | | @Value("${rsa.appId:}") |
| | | private String appId; |
| | | /**公共平台公钥*/ |
| | | @Value("${public.platform.publickey:}") |
| | | private String publicKey; |
| | | /**RSA秘钥*/ |
| | | @Value("${rsa.privatekey:}") |
| | | private String privatekey; |
| | | /**平台模式*/ |
| | | @Value("${platform.pattern:}") |
| | | private String platformPattern; |
| | | //----------------------------------------------------------------------- |
| | | /**第三方平台地址*/ |
| | | @Value("${common.baseUrl:}") |
| | | private String commonBaseUrl; |
| | | /**第三方平台公钥*/ |
| | | @Value("${platform.key.public:}") |
| | | private String platformPublicKey; |
| | | /**第三方平台appid*/ |
| | | @Value("${platform.key.appid:}") |
| | | private String platformAppId; |
| | | |
| | | public CustomParameter() { |
| | | |
| | | } |
| | | |
| | | public String getAesFixedKey() { |
| | | return aesFixedKey; |
| | | } |
| | | |
| | | public void setAesFixedKey(String aesFixedKey) { |
| | | this.aesFixedKey = aesFixedKey; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getPublicKey() { |
| | | return publicKey; |
| | | } |
| | | |
| | | public void setPublicKey(String publicKey) { |
| | | this.publicKey = publicKey; |
| | | } |
| | | |
| | | public String getPrivatekey() { |
| | | return privatekey; |
| | | } |
| | | |
| | | public void setPrivatekey(String privatekey) { |
| | | this.privatekey = privatekey; |
| | | } |
| | | |
| | | public String getPlatformPattern() { |
| | | return platformPattern; |
| | | } |
| | | |
| | | public void setPlatformPattern(String platformPattern) { |
| | | this.platformPattern = platformPattern; |
| | | } |
| | | |
| | | public String getPlatformPublicKey() { |
| | | return platformPublicKey; |
| | | } |
| | | |
| | | public void setPlatformPublicKey(String platformPublicKey) { |
| | | this.platformPublicKey = platformPublicKey; |
| | | } |
| | | |
| | | public String getCommonBaseUrl() { |
| | | return commonBaseUrl; |
| | | } |
| | | |
| | | public void setCommonBaseUrl(String commonBaseUrl) { |
| | | this.commonBaseUrl = commonBaseUrl; |
| | | } |
| | | |
| | | public String getPlatformAppId() { |
| | | return platformAppId; |
| | | } |
| | | |
| | | public void setPlatformAppId(String platformAppId) { |
| | | this.platformAppId = platformAppId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import org.apache.ibatis.session.SqlSessionFactory; |
| | | import org.mybatis.spring.SqlSessionFactoryBean; |
| | | import org.mybatis.spring.SqlSessionTemplate; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.boot.jdbc.DataSourceBuilder; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Primary; |
| | | import org.springframework.core.io.support.PathMatchingResourcePatternResolver; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * Druid配置类 |
| | | */ |
| | | /*@Configuration |
| | | @MapperScan(basePackages = "com.hx.phip.dao.mapper.phi", sqlSessionTemplateRef = "phiSqlSessionTemplate")*/ |
| | | public class DataSourcePhiConfig { |
| | | |
| | | @Bean(name = "phiDataSource") |
| | | @ConfigurationProperties(prefix = "spring.datasource.phi") |
| | | @Primary |
| | | public DataSource testDataSource() { |
| | | return DataSourceBuilder.create().build(); |
| | | } |
| | | |
| | | @Bean(name = "phiSqlSessionFactory") |
| | | @Primary |
| | | public SqlSessionFactory testSqlSessionFactory(@Qualifier("phiDataSource") DataSource dataSource) throws Exception { |
| | | SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); |
| | | bean.setDataSource(dataSource); |
| | | bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:/mapper/phi/*.xml")); |
| | | return bean.getObject(); |
| | | } |
| | | |
| | | @Bean(name = "phiTransactionManager") |
| | | @Primary |
| | | public DataSourceTransactionManager testTransactionManager(@Qualifier("phiDataSource") DataSource dataSource) { |
| | | return new DataSourceTransactionManager(dataSource); |
| | | } |
| | | |
| | | @Bean(name = "phiSqlSessionTemplate") |
| | | @Primary |
| | | public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("phiSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { |
| | | return new SqlSessionTemplate(sqlSessionFactory); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import org.apache.ibatis.session.SqlSessionFactory; |
| | | import org.mybatis.spring.SqlSessionFactoryBean; |
| | | import org.mybatis.spring.SqlSessionTemplate; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.boot.jdbc.DataSourceBuilder; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Primary; |
| | | import org.springframework.core.io.support.PathMatchingResourcePatternResolver; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * Druid配置类 |
| | | */ |
| | | /*@Configuration |
| | | @MapperScan(basePackages = "com.hx.phip.dao.mapper.syn", sqlSessionTemplateRef = "synSqlSessionTemplate")*/ |
| | | public class DataSourceSynConfig { |
| | | |
| | | @Bean(name = "synDataSource") |
| | | @ConfigurationProperties(prefix = "spring.datasource.syn") |
| | | |
| | | public DataSource testDataSource() { |
| | | return DataSourceBuilder.create().build(); |
| | | } |
| | | |
| | | @Bean(name = "synSqlSessionFactory") |
| | | public SqlSessionFactory testSqlSessionFactory(@Qualifier("synDataSource") DataSource dataSource) throws Exception { |
| | | SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); |
| | | bean.setDataSource(dataSource); |
| | | bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:/mapper/syn/*.xml")); |
| | | return bean.getObject(); |
| | | } |
| | | |
| | | @Bean(name = "synTransactionManager") |
| | | public DataSourceTransactionManager testTransactionManager(@Qualifier("synDataSource") DataSource dataSource) { |
| | | return new DataSourceTransactionManager(dataSource); |
| | | } |
| | | |
| | | @Bean(name = "synSqlSessionTemplate") |
| | | public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("synSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { |
| | | return new SqlSessionTemplate(sqlSessionFactory); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import feign.Logger; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | //@Configuration |
| | | //@EnableFeignClients(basePackages = "com.hz.his.controller.*") |
| | | public class DiscoveryClientConfig { |
| | | |
| | | /** |
| | | * 日志级别 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | Logger.Level feignLoggerLevel() { |
| | | return Logger.Level.FULL; |
| | | } |
| | | /** |
| | | * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public FeignRequestInterceptor basicAuthRequestInterceptor() { |
| | | System.out.println("拦截啦"); |
| | | return new FeignRequestInterceptor(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * Druid配置类 |
| | | */ |
| | | //@Configuration |
| | | public class DruidConfig { |
| | | |
| | | |
| | | |
| | | @Bean |
| | | @ConfigurationProperties(prefix = "spring.datasource") |
| | | public DataSource druidDataSource(){ |
| | | return new DruidDataSource(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * erp配置 |
| | | */ |
| | | @Component |
| | | public class ErpConfig { |
| | | /*企业微信小程序应用id*/ |
| | | @Value("${erpConfig.url:}") |
| | | private String url; |
| | | /*企业微信id*/ |
| | | @Value("${erpConfig.token:}") |
| | | private String token; |
| | | |
| | | public ErpConfig() { |
| | | |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getToken() { |
| | | return token; |
| | | } |
| | | |
| | | public void setToken(String token) { |
| | | this.token = token; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import com.hx.util.rsa.RSAUtil; |
| | | import feign.RequestInterceptor; |
| | | import feign.RequestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.UUID; |
| | | |
| | | public class FeignRequestInterceptor implements RequestInterceptor { |
| | | |
| | | |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | |
| | | /** |
| | | * 统一处理feign的远程调用拦截 |
| | | */ |
| | | @Override |
| | | public void apply(RequestTemplate requestTemplate) { |
| | | System.out.println("调用拦截器"); |
| | | // 远程调用请求增加头部信息处理(简写代码如下) |
| | | requestTemplate.header("appId",systemConfig.getRsaAppId()); |
| | | requestTemplate.header("sign", createRequestSign(systemConfig.getRsaAppId(),systemConfig.getRsaPublickey(),"")); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成请求签名 |
| | | * @param pisAppId 平台appId |
| | | * @param publicKey 平台RSA公钥 |
| | | * @param encode 编码 |
| | | * @return |
| | | */ |
| | | public static String createRequestSign(String pisAppId, String publicKey, String encode) { |
| | | String meg = pisAppId+"_"+ System.currentTimeMillis()+"_" + UUID.randomUUID().toString(); |
| | | String rasSign = RSAUtil.publicEncrypt(meg,publicKey).replaceAll("\r", "").replaceAll("\n", ""); |
| | | return rasSign; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import com.hx.exception.ParamException; |
| | | import com.hx.exception.ServiceException; |
| | | import com.hx.exception.TipsException; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.platform.exception.PlatServiceException; |
| | | import com.platform.exception.PlatTipsException; |
| | | import com.platform.resultTool.PlatformCode; |
| | | import com.platform.resultTool.PlatformResult; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.jdbc.BadSqlGrammarException; |
| | | import org.springframework.validation.BindException; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.MethodArgumentNotValidException; |
| | | import org.springframework.web.bind.annotation.ExceptionHandler; |
| | | import org.springframework.web.bind.annotation.RestControllerAdvice; |
| | | import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | |
| | | |
| | | /**统一异常处理中心 |
| | | * @author ChenJiaHe |
| | | * @date 2020-06-19 |
| | | */ |
| | | //@RestControllerAdvice |
| | | public class GlobalExceptionHandler{ |
| | | |
| | | |
| | | //log4j日志 |
| | | private static Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class.getName()); |
| | | |
| | | /** |
| | | * 参数校验错误异常 |
| | | * |
| | | * @param e MethodArgumentNotValidException|BindException |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = {BindException.class, MethodArgumentNotValidException.class}) |
| | | public Result bindExceptionHandler(Exception e) { |
| | | BindingResult bindingResult; |
| | | if (e instanceof BindException) { |
| | | bindingResult = ((BindException) e).getBindingResult(); |
| | | } else { |
| | | bindingResult = ((MethodArgumentNotValidException) e).getBindingResult(); |
| | | } |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | bindingResult.getAllErrors().forEach( |
| | | objectError -> |
| | | stringBuilder.append(",").append(objectError.getDefaultMessage()) |
| | | ); |
| | | String errorMessage = stringBuilder.toString(); |
| | | errorMessage = errorMessage.substring(1, errorMessage.length()); |
| | | logger.error(getExceptionInformation(e)); |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,errorMessage); |
| | | } |
| | | |
| | | /** |
| | | * 捕获统一提示异常 |
| | | * |
| | | * @param e AbstractGlobalException |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = TipsException.class) |
| | | public Result customExceptionHandler(TipsException e) { |
| | | //和爷要求删除 |
| | | // e.printStackTrace(); |
| | | // logger.error(getExceptionInformation(e)); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 捕获统一业务/判断异常 |
| | | * |
| | | * @param e AbstractGlobalException |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = ServiceException.class) |
| | | public Result customExceptionHandler(ServiceException e) { |
| | | e.printStackTrace(); |
| | | logger.error(getExceptionInformation(e)); |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 捕获统一业务/判断异常 |
| | | * |
| | | * @param e AbstractGlobalException |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = ParamException.class) |
| | | public Result customExceptionHandler(ParamException e) { |
| | | e.printStackTrace(); |
| | | logger.error(getExceptionInformation(e)); |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 捕获未知异常 |
| | | * |
| | | * @param e Exception |
| | | * @return ResponseData |
| | | */ |
| | | @ExceptionHandler(value = Exception.class) |
| | | public Result commonExceptionHandler(Exception e) throws ServletException { |
| | | String errMsg = e.getMessage(); |
| | | String code=ResponseCode.ERROR_SYSTEM; |
| | | if (e instanceof ServletException) { |
| | | throw (ServletException) e; |
| | | }else if(e instanceof ArrayIndexOutOfBoundsException){ |
| | | errMsg = "系统错误(sizeErr)!"; |
| | | }else if(e instanceof FileNotFoundException){ |
| | | errMsg = "系统错误(fileNot)!"; |
| | | }else if(e instanceof IOException){ |
| | | errMsg = "系统错误(IO)!"; |
| | | }else if(e instanceof NullPointerException){ |
| | | errMsg = "系统错误(null)!"; |
| | | }else if(e instanceof BadSqlGrammarException){ |
| | | errMsg = "系统错误(sql)!"; |
| | | }else if(e instanceof MethodArgumentTypeMismatchException){ |
| | | errMsg = "系统错误(参数类型错误)!"; |
| | | }/*else if(e instanceof Serializable){ |
| | | errMsg = "签名错误!"; |
| | | code=ResponseCode.ERROR_SIGN; |
| | | }*/ |
| | | |
| | | |
| | | e.printStackTrace(); |
| | | |
| | | logger.error(getExceptionInformation(e)); |
| | | |
| | | return Result.failure(code, errMsg); |
| | | } |
| | | |
| | | /** |
| | | * 获取异常信息 |
| | | * @param ex |
| | | * @return |
| | | */ |
| | | public static String getExceptionInformation(Exception ex){ |
| | | String sOut = ex.getMessage() + "\r\n"; |
| | | StackTraceElement[] trace = ex.getStackTrace(); |
| | | for (StackTraceElement s : trace) { |
| | | sOut += "\tat " + s + "\r\n"; |
| | | } |
| | | return sOut; |
| | | }; |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | |
| | | import javax.servlet.*; |
| | | import javax.servlet.annotation.WebFilter; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | |
| | | /** XSS防御过滤器 |
| | | * @Author: ChenJiaHe |
| | | * @Date: 2020-06-21 |
| | | * * 使用注解标注过滤器 |
| | | * @WebFilter将一个实现了javax.servlet.Filter接口的类定义为过滤器 |
| | | * 属性filterName声明过滤器的名称,可选 |
| | | * 属性urlPatterns指定要过滤 的URL模式,也可使用属性value来声明.(指定要过滤的URL模式是必选属性) |
| | | */ |
| | | //@WebFilter(filterName="myXssFilter", urlPatterns="/*") |
| | | public class MyXssFilter implements Filter { |
| | | |
| | | FilterConfig filterConfig = null; |
| | | |
| | | @Override |
| | | public void init(FilterConfig filterConfig) throws ServletException { |
| | | System.out.println("过滤器初始化"); |
| | | this.filterConfig = filterConfig; |
| | | } |
| | | |
| | | @Override |
| | | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { |
| | | //暂时不做防御 |
| | | /*if(getServletPath((HttpServletRequest) servletRequest).indexOf("/notify/")!=-1){ |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | }else{ |
| | | filterChain.doFilter(new XssHttpServletRequestWrapper((HttpServletRequest)servletRequest), servletResponse); |
| | | }*/ |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() { |
| | | System.out.println("过滤器销毁"); |
| | | this.filterConfig = null; |
| | | } |
| | | |
| | | private String getServletPath(HttpServletRequest request) { |
| | | String servletPath = request.getServletPath(); |
| | | System.out.println("servletPath...:"+servletPath); |
| | | if (StringUtils.isNotEmpty(servletPath)) { |
| | | return servletPath; |
| | | } else { |
| | | int startIndex = request.getContextPath().equals("") ? 0 : request.getContextPath().length(); |
| | | int endIndex = request.getRequestURI().length(); |
| | | return request.getRequestURI().substring(startIndex, endIndex); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import org.springframework.boot.autoconfigure.batch.BatchProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.scheduling.annotation.SchedulingConfigurer; |
| | | import org.springframework.scheduling.config.ScheduledTaskRegistrar; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * 前因:@Scheduled是单线程,如果有多个定时器,会造成堵塞 |
| | | * 解决:根据定时器方法来判断开启多少个线程 |
| | | * @Date: 2021-04-02 |
| | | * @author JiaHe.Chen |
| | | * |
| | | */ |
| | | @Configuration |
| | | public class ScheduleConfig implements SchedulingConfigurer { |
| | | @Override |
| | | public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { |
| | | taskRegistrar.setScheduler(Executors.newScheduledThreadPool(5)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 系统配置 |
| | | */ |
| | | @Component |
| | | public class SystemConfig { |
| | | |
| | | /*企业微信小程序应用id*/ |
| | | @Value("${systemConfig.corpAgentId}") |
| | | private String corpAgentId; |
| | | /*企业微信id*/ |
| | | @Value("${systemConfig.corpId}") |
| | | private String corpId; |
| | | /**企业微信小程序秘钥*/ |
| | | @Value("${systemConfig.corpMpSecret}") |
| | | private String corpMpSecret; |
| | | /**企业微信通信录密钥*/ |
| | | @Value("${systemConfig.corpAddrSecret}") |
| | | private String corpAddrSecret; |
| | | /**小程序AppId*/ |
| | | @Value("${systemConfig.appId}") |
| | | private String appId; |
| | | /**小程序AppSecret*/ |
| | | @Value("${systemConfig.appSecret}") |
| | | private String appSecret; |
| | | /**文件上传保存路径*/ |
| | | @Value("${systemConfig.filePath}") |
| | | private String filePath; |
| | | /**文件访问域名*/ |
| | | @Value("${systemConfig.fileDomain}") |
| | | private String fileDomain; |
| | | @Value("${api.apiUrl}") |
| | | private String apiUrl; |
| | | @Value("${api.appId}") |
| | | private String apiAppId; |
| | | @Value("${api.code}") |
| | | private String apiCode; |
| | | @Value("${api.secret}") |
| | | private String apiSecret; |
| | | @Value("${systemConfig.isDev}") |
| | | private Integer isDev; |
| | | @Value("${systemConfig.baseUrl}") |
| | | private String baseUrl; |
| | | @Value("${systemConfig.appid}") |
| | | private String poiAppId; |
| | | @Value("${systemConfig.secret}") |
| | | private String poiSecret; |
| | | @Value("${systemConfig.code}") |
| | | private String poiCode; |
| | | @Value("${systemConfig.clenit.token}") |
| | | private String clenitToken; |
| | | @Value("${systemConfig.clenit.aeskey}") |
| | | private String clenitAeskey; |
| | | @Value("${dataCentre.url}") |
| | | private String dataCentreUrl; |
| | | |
| | | @Value("${systemConfig.stUrl:}") |
| | | private String stUrl; |
| | | @Value("${systemConfig.stKey:}") |
| | | private String stKey; |
| | | @Value("${systemConfig.stSecret:}") |
| | | private String stSecret; |
| | | |
| | | @Value("${systemConfig.cos.bucketName:}") |
| | | private String cosBucketName; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Value("${systemConfig.koapUrl:}") |
| | | private String koapUrl; |
| | | @Value("${systemConfig.koaClientId:}") |
| | | private String koaClientId; |
| | | @Value("${systemConfig.KoaClientSecret:}") |
| | | private String KoaClientSecret; |
| | | @Value("${systemConfig.koaGrantType:}") |
| | | private String koaGrantType; |
| | | @Value("${systemConfig.koaClinicCode:}") |
| | | private String koaClinicCode; |
| | | @Value("${systemConfig.phimedUrl:}") |
| | | private String phimedUrl; |
| | | |
| | | @Value("${rsa.appId:}") |
| | | private String rsaAppId; |
| | | |
| | | @Value("${rsa.privatekey:}") |
| | | private String rsaPrivatekey; |
| | | |
| | | @Value("${rsa.publickey:}") |
| | | private String rsaPublickey; |
| | | |
| | | |
| | | @Value("${systemConfig.isSpa:}") |
| | | private String isSpa; |
| | | |
| | | |
| | | |
| | | public SystemConfig() |
| | | { |
| | | |
| | | } |
| | | |
| | | public String getKoapUrl() { |
| | | return koapUrl; |
| | | } |
| | | |
| | | public void setKoapUrl(String koapUrl) { |
| | | this.koapUrl = koapUrl; |
| | | } |
| | | |
| | | public String getKoaClientId() { |
| | | return koaClientId; |
| | | } |
| | | |
| | | public void setKoaClientId(String koaClientId) { |
| | | this.koaClientId = koaClientId; |
| | | } |
| | | |
| | | public String getKoaClientSecret() { |
| | | return KoaClientSecret; |
| | | } |
| | | |
| | | public void setKoaClientSecret(String koaClientSecret) { |
| | | KoaClientSecret = koaClientSecret; |
| | | } |
| | | |
| | | public String getKoaGrantType() { |
| | | return koaGrantType; |
| | | } |
| | | |
| | | public void setKoaGrantType(String koaGrantType) { |
| | | this.koaGrantType = koaGrantType; |
| | | } |
| | | |
| | | public String getKoaClinicCode() { |
| | | return koaClinicCode; |
| | | } |
| | | |
| | | public void setKoaClinicCode(String koaClinicCode) { |
| | | this.koaClinicCode = koaClinicCode; |
| | | } |
| | | |
| | | public String getStUrl() { |
| | | return stUrl; |
| | | } |
| | | |
| | | public void setStUrl(String stUrl) { |
| | | this.stUrl = stUrl; |
| | | } |
| | | |
| | | public String getStSecret() { |
| | | return stSecret; |
| | | } |
| | | |
| | | public void setStSecret(String stSecret) { |
| | | this.stSecret = stSecret; |
| | | } |
| | | |
| | | public String getStKey() { |
| | | return stKey; |
| | | } |
| | | |
| | | public void setStKey(String stKey) { |
| | | this.stKey = stKey; |
| | | } |
| | | |
| | | public String getCorpId() { |
| | | return corpId; |
| | | } |
| | | |
| | | public void setCorpId(String corpId) { |
| | | this.corpId = corpId; |
| | | } |
| | | |
| | | public String getCorpMpSecret() { |
| | | return corpMpSecret; |
| | | } |
| | | |
| | | public void setCorpMpSecret(String corpMpSecret) { |
| | | this.corpMpSecret = corpMpSecret; |
| | | } |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getAppSecret() { |
| | | return appSecret; |
| | | } |
| | | |
| | | public void setAppSecret(String appSecret) { |
| | | this.appSecret = appSecret; |
| | | } |
| | | |
| | | public String getCorpAddrSecret() { |
| | | return corpAddrSecret; |
| | | } |
| | | |
| | | public void setCorpAddrSecret(String corpAddrSecret) { |
| | | this.corpAddrSecret = corpAddrSecret; |
| | | } |
| | | |
| | | public String getFilePath() { |
| | | return filePath; |
| | | } |
| | | |
| | | public void setFilePath(String filePath) { |
| | | this.filePath = filePath; |
| | | } |
| | | |
| | | public String getFileDomain() { |
| | | return fileDomain; |
| | | } |
| | | |
| | | public void setFileDomain(String fileDomain) { |
| | | this.fileDomain = fileDomain; |
| | | } |
| | | |
| | | public String getCorpAgentId() { |
| | | return corpAgentId; |
| | | } |
| | | |
| | | public void setCorpAgentId(String corpAgentId) { |
| | | this.corpAgentId = corpAgentId; |
| | | } |
| | | |
| | | public String getApiAppId() { |
| | | return apiAppId; |
| | | } |
| | | |
| | | public void setApiAppId(String apiAppId) { |
| | | this.apiAppId = apiAppId; |
| | | } |
| | | |
| | | public String getApiCode() { |
| | | return apiCode; |
| | | } |
| | | |
| | | public void setApiCode(String apiCode) { |
| | | this.apiCode = apiCode; |
| | | } |
| | | |
| | | public String getApiSecret() { |
| | | return apiSecret; |
| | | } |
| | | |
| | | public void setApiSecret(String apiSecret) { |
| | | this.apiSecret = apiSecret; |
| | | } |
| | | |
| | | public String getApiUrl() { |
| | | return apiUrl; |
| | | } |
| | | |
| | | public void setApiUrl(String apiUrl) { |
| | | this.apiUrl = apiUrl; |
| | | } |
| | | |
| | | public String getDefaultImg() |
| | | { |
| | | return fileDomain + "adminweb/tx.jpg"; |
| | | } |
| | | |
| | | public Integer getIsDev() { |
| | | return isDev; |
| | | } |
| | | |
| | | public void setIsDev(Integer isDev) { |
| | | this.isDev = isDev; |
| | | } |
| | | |
| | | public String getBaseUrl() { |
| | | return baseUrl; |
| | | } |
| | | |
| | | public void setBaseUrl(String baseUrl) { |
| | | this.baseUrl = baseUrl; |
| | | } |
| | | |
| | | public String getPoiAppId() { |
| | | return poiAppId; |
| | | } |
| | | |
| | | public void setPoiAppId(String poiAppId) { |
| | | this.poiAppId = poiAppId; |
| | | } |
| | | |
| | | public String getPoiSecret() { |
| | | return poiSecret; |
| | | } |
| | | |
| | | public void setPoiSecret(String poiSecret) { |
| | | this.poiSecret = poiSecret; |
| | | } |
| | | |
| | | public String getPoiCode() { |
| | | return poiCode; |
| | | } |
| | | |
| | | public void setPoiCode(String poiCode) { |
| | | this.poiCode = poiCode; |
| | | } |
| | | |
| | | public String getClenitToken() { |
| | | return clenitToken; |
| | | } |
| | | |
| | | public void setClenitToken(String clenitToken) { |
| | | this.clenitToken = clenitToken; |
| | | } |
| | | |
| | | public String getClenitAeskey() { |
| | | return clenitAeskey; |
| | | } |
| | | |
| | | public void setClenitAeskey(String clenitAeskey) { |
| | | this.clenitAeskey = clenitAeskey; |
| | | } |
| | | |
| | | public String getDataCentreUrl() { |
| | | return dataCentreUrl; |
| | | } |
| | | |
| | | public void setDataCentreUrl(String dataCentreUrl) { |
| | | this.dataCentreUrl = dataCentreUrl; |
| | | } |
| | | |
| | | public String getPhimedUrl() { |
| | | return phimedUrl; |
| | | } |
| | | |
| | | public void setPhimedUrl(String phimedUrl) { |
| | | this.phimedUrl = phimedUrl; |
| | | } |
| | | |
| | | public String getRsaAppId() { |
| | | return rsaAppId; |
| | | } |
| | | |
| | | public void setRsaAppId(String rsaAppId) { |
| | | this.rsaAppId = rsaAppId; |
| | | } |
| | | |
| | | public String getRsaPrivatekey() { |
| | | return rsaPrivatekey; |
| | | } |
| | | |
| | | public void setRsaPrivatekey(String rsaPrivatekey) { |
| | | this.rsaPrivatekey = rsaPrivatekey; |
| | | } |
| | | |
| | | public String getRsaPublickey() { |
| | | return rsaPublickey; |
| | | } |
| | | |
| | | public void setRsaPublickey(String rsaPublickey) { |
| | | this.rsaPublickey = rsaPublickey; |
| | | } |
| | | |
| | | public String getCosBucketName() { |
| | | return cosBucketName; |
| | | } |
| | | |
| | | public void setCosBucketName(String cosBucketName) { |
| | | this.cosBucketName = cosBucketName; |
| | | } |
| | | |
| | | public String getIsSpa() { |
| | | return isSpa; |
| | | } |
| | | |
| | | public void setIsSpa(String isSpa) { |
| | | this.isSpa = isSpa; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import org.springframework.beans.factory.config.BeanDefinition; |
| | | import org.springframework.beans.factory.support.BeanDefinitionRegistry; |
| | | import org.springframework.context.annotation.AnnotationBeanNameGenerator; |
| | | |
| | | /** |
| | | * 重置bean名称生成策略,可以不同包同名策略 |
| | | * @author ChenJiaHe |
| | | * @Date 2020-06-30 |
| | | */ |
| | | public class UniqueNameGenerator extends AnnotationBeanNameGenerator { |
| | | |
| | | @Override |
| | | public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) { |
| | | //全限定类名 |
| | | String beanName = definition.getBeanClassName(); |
| | | return beanName; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.config; |
| | | |
| | | import javax.servlet.ReadListener; |
| | | import javax.servlet.ServletInputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletRequestWrapper; |
| | | import java.io.BufferedReader; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.nio.charset.Charset; |
| | | |
| | | |
| | | /** |
| | | * xss请求适配器 |
| | | * @Author: ChenJiaHe |
| | | * @Date: 2020-06-22 |
| | | */ |
| | | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { |
| | | |
| | | public XssHttpServletRequestWrapper(HttpServletRequest request) { |
| | | super(request); |
| | | } |
| | | |
| | | @Override |
| | | public String[] getParameterValues(String parameter) { |
| | | String[] values = super.getParameterValues(parameter); |
| | | if (values==null) { |
| | | return null; |
| | | } |
| | | int count = values.length; |
| | | String[] encodedValues = new String[count]; |
| | | for (int i = 0; i < count; i++) { |
| | | encodedValues[i] = cleanXSS(values[i]); |
| | | } |
| | | return encodedValues; |
| | | } |
| | | |
| | | @Override |
| | | public String getParameter(String parameter) { |
| | | String value = super.getParameter(parameter); |
| | | if (value != null) { |
| | | return cleanXSS(value); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public String getHeader(String name) { |
| | | String value = super.getHeader(name); |
| | | if (value == null) |
| | | return null; |
| | | return cleanXSS(value); |
| | | } |
| | | |
| | | private static String cleanXSS(String value) { |
| | | value = value.replaceAll("<", "<").replaceAll(">", ">"); |
| | | value = value.replaceAll("%3C", "<").replaceAll("%3E", ">"); |
| | | value = value.replaceAll("\\(", "(").replaceAll("\\)", ")"); |
| | | value = value.replaceAll("%28", "(").replaceAll("%29", ")"); |
| | | value = value.replaceAll("'", "'"); |
| | | value = value.replaceAll("eval\\((.*)\\)", ""); |
| | | value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\""); |
| | | value = value.replaceAll("script", ""); |
| | | return value; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ServletInputStream getInputStream() throws IOException { |
| | | final ByteArrayInputStream bais = new ByteArrayInputStream(inputHandlers(super.getInputStream ()).getBytes ()); |
| | | |
| | | return new ServletInputStream() { |
| | | |
| | | @Override |
| | | public int read() throws IOException { |
| | | return bais.read(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean isFinished() { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isReady() { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public void setReadListener(ReadListener readListener) { } |
| | | }; |
| | | } |
| | | |
| | | public String inputHandlers(ServletInputStream servletInputStream){ |
| | | StringBuilder sb = new StringBuilder(); |
| | | BufferedReader reader = null; |
| | | try { |
| | | reader = new BufferedReader(new InputStreamReader(servletInputStream, Charset.forName("UTF-8"))); |
| | | String line = ""; |
| | | while ((line = reader.readLine()) != null) { |
| | | sb.append(line); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (servletInputStream != null) { |
| | | try { |
| | | servletInputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (reader != null) { |
| | | try { |
| | | reader.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | return cleanXSS(sb.toString ()); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | package com.hx.phip.config.rabbitmq; |
| | | |
| | | |
| | | import org.springframework.amqp.core.DirectExchange; |
| | | import org.springframework.amqp.core.TopicExchange; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | */ |
| | | /** |
| | | * 交换机配置 可以配置多个交换机 |
| | | * @author zhangxu |
| | | * |
| | | *//* |
| | | |
| | | @Configuration |
| | | public class ExchangeConfig { |
| | | |
| | | @Bean |
| | | DirectExchange testDirectExchange() { |
| | | // return new DirectExchange("TestDirectExchange",true,true); |
| | | return new DirectExchange(RabbitMqConfig.Exchange_TESTDIRECTEXCHANGE,true,false); |
| | | } |
| | | |
| | | |
| | | } |
| | | */ |
New file |
| | |
| | | /* |
| | | package com.hx.phip.config.rabbitmq; |
| | | |
| | | import org.springframework.amqp.core.Queue; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | */ |
| | | /** |
| | | * 队列配置 可以配置多个队列 |
| | | * |
| | | * @Auther: zhangxu |
| | | *//* |
| | | |
| | | |
| | | @Configuration |
| | | public class QueueConfig { |
| | | |
| | | @Bean |
| | | public Queue testDirectQueue() { |
| | | return new Queue(RabbitMqConfig.man,true); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue testDirectQueue2() { |
| | | return new Queue(RabbitMqConfig.woman,true); |
| | | } |
| | | } |
| | | */ |
New file |
| | |
| | | /* |
| | | package com.hx.phip.config.rabbitmq; |
| | | |
| | | |
| | | import org.springframework.amqp.core.Binding; |
| | | import org.springframework.amqp.core.BindingBuilder; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 配置交换机和队列 |
| | | * |
| | | * @Auther: zhangxu |
| | | *//* |
| | | |
| | | @Configuration |
| | | public class RabbitMqConfig { |
| | | |
| | | */ |
| | | /** |
| | | * DIREC模式主消息交换机名称 |
| | | *//* |
| | | |
| | | public static final String Exchange_TESTDIRECTEXCHANGE = "TestDirectExchange"; |
| | | |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 队列名称 |
| | | *//* |
| | | |
| | | public final static String man = "topic.man"; |
| | | |
| | | */ |
| | | /** |
| | | * 队列名称 |
| | | *//* |
| | | |
| | | public final static String woman = "topic.woman"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private QueueConfig queueConfig; |
| | | @Autowired |
| | | private ExchangeConfig exchangeConfig; |
| | | */ |
| | | /** |
| | | * 将队列Queue_TESTDIRECTQUEUE和交换机Exchange_TESTDIRECTEXCHANGE进行绑定 |
| | | * @return |
| | | *//* |
| | | |
| | | @Bean |
| | | public Binding bindingTestQueue() { |
| | | return BindingBuilder.bind(queueConfig.testDirectQueue()).to(exchangeConfig.testDirectExchange()).with(man); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 将队列Queue_TESTDIRECTQUEUE和交换机Exchange_TESTDIRECTEXCHANGE进行绑定 |
| | | * @return |
| | | *//* |
| | | |
| | | @Bean |
| | | public Binding bindingTestQueue2() { |
| | | return BindingBuilder.bind(queueConfig.testDirectQueue2()).to(exchangeConfig.testDirectExchange()).with("topic.#"); |
| | | } |
| | | } |
| | | */ |
New file |
| | |
| | | package com.hx.phip.his.controller; |
| | | |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phip.his.controller.his.SyncUserController; |
| | | import com.hx.phiappt.dao.mapper.EmployeeMapper; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.his.service.GetTokenService; |
| | | import com.hx.phip.his.service.PrescriptionService; |
| | | import com.hx.phip.his.service.SyncMedicalRecordsService; |
| | | import com.hx.phip.his.service.SyncTransactioalService; |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.task.HisOrderSyncTask; |
| | | import com.hx.phip.his.task.HisUserLevelRecordTask; |
| | | import com.hx.phip.his.task.HisUserPicturesTask; |
| | | import com.hx.phip.his.util.SyncMedicalPrescriptionUtil; |
| | | import com.hx.redis.RedisUtil; |
| | | import com.hx.resultTool.Result; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RestController |
| | | @RequestMapping("/test") |
| | | public class TestController { |
| | | |
| | | // lo4g |
| | | private static final Logger logger = LoggerFactory.getLogger(TestController.class); |
| | | |
| | | @Resource |
| | | private PrescriptionService prescriptionService; |
| | | // @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | |
| | | @Resource |
| | | private GetTokenService getTokenService; |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | @Resource |
| | | private EmployeeMapper employeeMapper; |
| | | @Resource |
| | | private SyncMedicalRecordsService medicalRecordsService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | @Resource |
| | | private HisOrderSyncTask hisOrderSyncTask; |
| | | @Resource |
| | | private SyncUserController syncUserController; |
| | | @Resource |
| | | private HisUserPicturesTask hisUserPicturesTask; |
| | | @Resource |
| | | private HisUserLevelRecordTask hisUserLevelRecordTask; |
| | | |
| | | public String getApplicationAccessToken(){ |
| | | String at = getTokenService.getApplicationAccessToken(systemParameterMapper, systemConfig.getCorpId(), systemConfig.getCorpMpSecret()); |
| | | return at; |
| | | } |
| | | |
| | | /** |
| | | * 同步处方 |
| | | */ |
| | | @PostMapping("/syncPrescription") |
| | | public Result syncMedicalRecordsTemplateTask(){ |
| | | logger.info("开始执行同步处方定时器"); |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,16,0,0); |
| | | SyncMedicalPrescriptionUtil.syncPrescription(syncBasicInformationRecord,prescriptionService,syncTransactioalService,mongoTemplate, |
| | | employeeMapper,systemConfig,getApplicationAccessToken()); |
| | | |
| | | return Result.success("同步处方定时器完成"); |
| | | } |
| | | |
| | | /** |
| | | * 同步病历 |
| | | */ |
| | | @PostMapping("/syncMedicalRecordsInit") |
| | | public Result syncMedicalRecordsInit(){ |
| | | logger.info("开始执行同步病例定时器"); |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,14,0,0); |
| | | SyncMedicalPrescriptionUtil.syncMedicalRecords(syncBasicInformationRecord,medicalRecordsService,syncTransactioalService,mongoTemplate,redisUtil, |
| | | employeeMapper,systemConfig,getApplicationAccessToken()); |
| | | // medicalRecordsService.saveHisMedicalRecordsTemplate(basicInformationRecord); |
| | | logger.info("定时器同步病例定时器完成"); |
| | | |
| | | return Result.success("同步处方定时器完成"); |
| | | } |
| | | |
| | | /** |
| | | * 同步前后对比照 |
| | | * @param userId 预约用户id |
| | | */ |
| | | @RequestMapping("/syncPhotoComparesByUserId") |
| | | public Result syncPhotoComparesByUserId(String userId) throws Exception { |
| | | return syncUserController.photoCompares(userId); |
| | | } |
| | | |
| | | /** |
| | | * 同步前后对比照上传图片处理 |
| | | * @param userId 预约用户id |
| | | */ |
| | | @RequestMapping("/syncPhotoComparesUpLoadByUserId") |
| | | public Result syncPhotoComparesUpLoadByUserId(String userId) { |
| | | hisUserPicturesTask.handlerSyncPicture(userId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | /** |
| | | * 执行同步领建用户等级记录 |
| | | * @return 返回 |
| | | */ |
| | | @RequestMapping("/syncUserLevelRecordTask") |
| | | public Result syncUserLevelRecordTask(String id) { |
| | | hisUserLevelRecordTask.handleUserLevelRecord(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | /** |
| | | * 执行同步用户退款记录 |
| | | * @return 返回 |
| | | */ |
| | | @RequestMapping("/syncOrderRefundRecordTask") |
| | | public Result syncOrderRefundRecordTask(String id) { |
| | | hisOrderSyncTask.handleOrderRefundRecord(id); |
| | | return Result.success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.erp; |
| | | |
| | | import com.hx.phip.his.service.ErpSyncGoodsService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RestController |
| | | @RequestMapping("/erp/sync/good") |
| | | public class SyncGoodsController { |
| | | |
| | | @Resource |
| | | private ErpSyncGoodsService erpSyncGoodsService; |
| | | |
| | | /** |
| | | * 同步erp全部产品信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/productAll") |
| | | public Result productAll(@RequestBody JSONObject jsonObject) |
| | | { |
| | | erpSyncGoodsService.productAll(jsonObject); |
| | | return Result.success("初始化同步所有仓库商品信息成功"); |
| | | } |
| | | |
| | | /** |
| | | * 同步erp全部产品的所有库存批次信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/productInventoryAll") |
| | | public Result productInventoryAll() |
| | | { |
| | | erpSyncGoodsService.productInventoryAll(); |
| | | return Result.success("初始化同步所有仓库商品信息成功"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 更改erp库存批次表单 |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateStockBatch") |
| | | public Result updateStockBatch(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return erpSyncGoodsService.updateStockBatch(jsonObject); |
| | | } |
| | | /** |
| | | * 更改库存新增记录表 |
| | | * @return |
| | | */ |
| | | @PostMapping("/insertRecord") |
| | | public Result insertRecord(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return erpSyncGoodsService.insertRecord(jsonObject); |
| | | } |
| | | /** |
| | | * 更改库存主表单 |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateStockTable") |
| | | public Result updateStockTable(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return erpSyncGoodsService.updateStockTable(jsonObject); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.his.service.HisInitializeDataService; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author 切换领建初始化数据到本地用对应的表存起来 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/his/initialize/data") |
| | | public class HisInitializeDataController { |
| | | |
| | | @Resource |
| | | private HisInitializeDataService hisInitializeDataService; |
| | | /** |
| | | * 同步所有到访记录 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/visit/record") |
| | | public Result visitRecord() |
| | | { |
| | | hisInitializeDataService.visitRecord(); |
| | | return Result.success("初始化同步所有到访记录成功"); |
| | | } |
| | | /** |
| | | * 同步所有未执行项目 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/hisOrderItem") |
| | | public Result hisOrderItem() |
| | | { |
| | | hisInitializeDataService.hisOrderItem(); |
| | | return Result.success("初始化同步所有未执行项目记录成功"); |
| | | } |
| | | /** |
| | | * 同步所有资金变动记录 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/hisAccountJournal") |
| | | public Result hisAccountJournal() |
| | | { |
| | | hisInitializeDataService.hisAccountJournal(); |
| | | return Result.success("初始化同步所有执行项目记录成功"); |
| | | } |
| | | |
| | | /** |
| | | * 同步所有执行项目 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/hisExecutionRecord") |
| | | public Result hisExecutionRecord() |
| | | { |
| | | hisInitializeDataService.hisExecutionRecord(); |
| | | return Result.success("初始化同步所有执行项目记录成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 转换到访记录 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/phis/visit/record") |
| | | public Result phisVisitRecord() |
| | | { |
| | | hisInitializeDataService.phisVisitRecord(); |
| | | return Result.success("初始化同步所有到访记录成功"); |
| | | } |
| | | |
| | | /** |
| | | * 转换未执行项目记录 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/phis/hisOrderItem") |
| | | public Result phisOrderItem() |
| | | { |
| | | hisInitializeDataService.phisOrderItem(); |
| | | return Result.success("转换同步所有未执行项目记录成功"); |
| | | } |
| | | |
| | | /** |
| | | * 转换执行项目 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/phis/hisExecutionRecord") |
| | | public Result phisExecutionRecord() |
| | | { |
| | | hisInitializeDataService.phisExecutionRecord(); |
| | | return Result.success("转化同步所有执行项目记录成功"); |
| | | } |
| | | /** |
| | | * 转换所有资金变动记录 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/phis/hisAccountJournal") |
| | | public Result phisAccountJournal() |
| | | { |
| | | hisInitializeDataService.phisAccountJournal(); |
| | | return Result.success("初始化同步所有执行项目记录成功"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.his.service.HisTokenService; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/his") |
| | | public class HisTokenController { |
| | | |
| | | @Resource |
| | | private HisTokenService hisTokenService; |
| | | |
| | | @RequestMapping("/getToken") |
| | | public Result getToken(){ |
| | | return hisTokenService.getToken(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phiappt.model.order.OrdersTotal; |
| | | import com.hx.phiappt.dao.mapper.OrdersTotalMapper; |
| | | import com.hx.phip.his.service.HisTokenService; |
| | | import com.hx.phip.feign.OrderFeignService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | public class OrderFeignController implements OrderFeignService { |
| | | |
| | | |
| | | @Resource |
| | | private HisTokenService hisTokenService; |
| | | |
| | | @Resource |
| | | private OrdersTotalMapper ordersTotalMapper; |
| | | |
| | | @Override |
| | | public String getToken() { |
| | | Result result= hisTokenService.getToken(); |
| | | if(ResponseCode.SUCCESS.equals(result.getCode())){ |
| | | return result.getData().toString(); |
| | | }else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public OrdersTotal selectOrdersTotal(String orderId) { |
| | | return ordersTotalMapper.selectOneByKey(orderId); |
| | | } |
| | | |
| | | @Override |
| | | public void updateOrdersTotal(OrdersTotal ordersTotal) { |
| | | ordersTotalMapper.updateAll(ordersTotal); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.common.BaseController; |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.MD5Util; |
| | | import com.hx.util.StringUtils; |
| | | import com.hz.util.http.HttpHzUtil; |
| | | import com.hz.util.http.dto.HttpHzResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 商汤同步用户头像 |
| | | * |
| | | * @Author:知知 |
| | | * @Date:2023/5/11 18:55 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @RequestMapping("/st/sync/") |
| | | @RestController |
| | | public class STSyncUserImgController extends BaseController { |
| | | |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | |
| | | /** |
| | | * 商汤头像访问路径 |
| | | */ |
| | | private static final String AVATAR_URL = "https://link.bi.sensetime.com/sl/v2/image/1/"; |
| | | |
| | | /** |
| | | * 获取用户商品图片路径 |
| | | */ |
| | | @RequestMapping("/getStImgUrl") |
| | | public Result getStImgUrl(@RequestBody(required = false) Map<String, Object> userMap) { |
| | | |
| | | if (userMap == null) { |
| | | throwParamException("请求对象为空!"); |
| | | } |
| | | |
| | | if (!userMap.containsKey("shangTangId") || StringUtils.isEmpty(userMap.get("shangTangId").toString())) { |
| | | throwParamException("商汤标识为空!"); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | //获取返回的头像 |
| | | data.put("avatar", AVATAR_URL + getAvatarCode(userMap.get("shangTangId").toString())); |
| | | |
| | | return Result.success(data); |
| | | } |
| | | |
| | | |
| | | //////////////////////////////////////////////////////////////////////////////////////////////// |
| | | |
| | | /*** 从返回值中只获取头像*/ |
| | | public String getAvatarCode(String shangTangId) { |
| | | //请求 |
| | | JSONArray jsonArray = handleUser(shangTangId); |
| | | String avatar = null; |
| | | if (jsonArray != null && jsonArray.size() > 0) { |
| | | //获取返回的头像 |
| | | avatar = jsonArray.getJSONObject(0).getString("avatar"); |
| | | } |
| | | return avatar; |
| | | } |
| | | |
| | | |
| | | /*** 请求商汤接口*/ |
| | | public JSONArray handleUser(String shangTangId) { |
| | | |
| | | long timestamp = System.currentTimeMillis(); |
| | | String appKey = systemConfig.getStKey(); |
| | | String appSecret = systemConfig.getStSecret(); |
| | | String sign = MD5Util.MD5Encode(timestamp + "#" + appSecret, null); |
| | | StringBuffer url = new StringBuffer("https://link.bi.sensetime.com" + "/api/v1/user/list?app_key=" + appKey + "&sign=" + sign + "×tamp=" + timestamp); |
| | | url.append("&id=" + shangTangId); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | HttpHzResponse httpHzResponse = HttpHzUtil.HttpURLUtilJson(url.toString(), null, null, null, "GET", null); |
| | | JSONObject json = JSONObject.parseObject(httpHzResponse.getData()); |
| | | if ("200".equals(json.getString("code"))) { |
| | | jsonArray = json.getJSONArray("data"); |
| | | log.info("商汤有{}条数据", jsonArray.size()); |
| | | log.info("数据内容:{}", jsonArray.toString()); |
| | | } else { |
| | | throwServiceException("商汤查询访客信息失败!" + json == null ? "" : json.toJSONString()); |
| | | } |
| | | return jsonArray; |
| | | } |
| | | |
| | | |
| | | // |
| | | // /*** MD5 加密*/ |
| | | // private static String MD5(String sourceStr) { |
| | | // MD5Util.MD5Encode() |
| | | // String result = ""; |
| | | // try { |
| | | // MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | // md.update(sourceStr.getBytes()); |
| | | // byte b[] = md.digest(); |
| | | // int i; |
| | | // StringBuffer buf = new StringBuffer(""); |
| | | // for (int offset = 0; offset < b.length; offset++) { |
| | | // i = b[offset]; |
| | | // if (i < 0) |
| | | // i += 256; |
| | | // if (i < 16) |
| | | // buf.append("0"); |
| | | // buf.append(Integer.toHexString(i)); |
| | | // } |
| | | // result = buf.toString(); |
| | | // /*System.out.println("MD5(" + sourceStr + ",32) = " + result); |
| | | // System.out.println("MD5(" + sourceStr + ",16) = " + buf.toString().substring(8, 24));*/ |
| | | // } catch (NoSuchAlgorithmException e) { |
| | | // System.out.println(e); |
| | | // } |
| | | // return result; |
| | | // } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.his.service.SyncAppointmentService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping("/sync/appointment/toVoid") |
| | | public class SyncAppointmentController { |
| | | |
| | | @Resource |
| | | private SyncAppointmentService syncAppointmentService; |
| | | |
| | | /** 获取授权机构下的预约数据-列表*/ |
| | | @PostMapping("/syncAppointment") |
| | | public Result syncAppointment(@RequestBody JSONObject jsonObject) |
| | | { |
| | | |
| | | try { |
| | | syncAppointmentService.syncAppointment(jsonObject); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** 创建预约*/ |
| | | @RequestMapping("/add") |
| | | public Result addAppointment(@RequestBody JSONObject jsonObject) |
| | | { |
| | | if(jsonObject==null) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"创建预约订单参数不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(jsonObject.optString("clinicId"))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"诊所ID不能为空"); |
| | | if(StringUtils.isEmpty(jsonObject.optString("customerId"))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"客人ID不能为空"); |
| | | if(StringUtils.isEmpty(jsonObject.optString("start"))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"预约开始时间(ISO-8601标志格式,注意时区)不能为空"); |
| | | return syncAppointmentService.addAppointment(jsonObject); |
| | | } |
| | | /** 取消预约*/ |
| | | @RequestMapping("/cancel") |
| | | public Result cancelAppointment(@RequestBody JSONObject jsonObject) |
| | | { |
| | | if(jsonObject==null) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"取消预约订单参数不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(jsonObject.optString("id"))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"取消预约订单id不能为空"); |
| | | if(StringUtils.isEmpty(jsonObject.optString("note"))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"备注不能为空"); |
| | | return syncAppointmentService.cancelAppointment(jsonObject); |
| | | } |
| | | /** 确认预约*/ |
| | | @RequestMapping("/confirm") |
| | | public Result confirmAppointment(@RequestBody JSONObject jsonObject) |
| | | { |
| | | if(jsonObject==null) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"确认预约订单参数不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(jsonObject.optString("id"))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"确认预约订单id不能为空"); |
| | | return syncAppointmentService.confirmAppointment(jsonObject); |
| | | } |
| | | /** 修改预约*/ |
| | | @RequestMapping("/partial") |
| | | public Result partialAppointment(@RequestBody JSONObject jsonObject) |
| | | { |
| | | if(jsonObject==null) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"修改预约订单参数不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(jsonObject.optString("id"))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"修改预约订单id不能为空"); |
| | | return syncAppointmentService.partialAppointment(jsonObject); |
| | | } |
| | | |
| | | /** 创建到访*/ |
| | | @RequestMapping("/visit") |
| | | public Result visit(@RequestBody JSONObject jsonObject) |
| | | { |
| | | if(jsonObject==null) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"创建到访参数不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(jsonObject.optString("customerId"))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"创建到访customerId不能为空"); |
| | | if(StringUtils.isEmpty(jsonObject.optString("clinicId"))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"创建到访clinicId不能为空"); |
| | | return syncAppointmentService.visit(jsonObject); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.service.SyncChannelService; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步门店 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/channel/toVoid") |
| | | public class SyncChannelController { |
| | | |
| | | @Resource |
| | | SyncChannelService syncChannelService; |
| | | |
| | | /** |
| | | * 同步所有渠道信息 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/syncChannel") |
| | | public Result SyncChannel() |
| | | { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,1,0,0); |
| | | syncChannelService.SyncChannel(syncBasicInformationRecord); |
| | | return Result.success("初始化同步所有渠道信息成功"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.exception.ParamException; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.model.SyncUserPictureRcord; |
| | | import com.hx.phip.his.service.SyncConsultationService; |
| | | import com.hx.phip.his.service.SyncUserService; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.DateUtil; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | @RestController |
| | | @RequestMapping("/sync/consultation/toVoid") |
| | | public class SyncConsultationRecordController { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SyncUserController.class); |
| | | @Resource |
| | | private SyncConsultationService syncConsultationService; |
| | | |
| | | @Resource |
| | | private SyncUserService syncUserService; |
| | | |
| | | /** 获取授权机构下的咨询数据*/ |
| | | @GetMapping("/record/byCiq") |
| | | public Result recordByCiq(String ciq) |
| | | { |
| | | User user = syncUserService.selectOneByCiq(ciq); |
| | | if(user==null){ |
| | | throw new ParamException("用户不存在"); |
| | | } |
| | | JSONObject jsonObject=new JSONObject(); |
| | | jsonObject.put("customerId",user.getApiId()); |
| | | return record(jsonObject); |
| | | |
| | | } |
| | | |
| | | /** 获取授权机构下的咨询数据*/ |
| | | @PostMapping("/record") |
| | | public Result record(@RequestBody JSONObject jsonObject) |
| | | { |
| | | |
| | | try { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,12,0,0); |
| | | syncConsultationService.record(jsonObject,syncBasicInformationRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** 获取授权机构下的咨询数据*/ |
| | | @PostMapping("/records") |
| | | public Result records() |
| | | { |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | Integer page=0;//条数 |
| | | Integer number=10;//条数 |
| | | List<User> userList; |
| | | |
| | | //开5个线程池处理其它页 |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(5); |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,12,0,0); |
| | | |
| | | do { |
| | | map.put("page",page*number); |
| | | map.put("number",number); |
| | | sqlSentence.setM(map); |
| | | sqlSentence.setSqlSentence("select id,apiId from user where apiId is NOT NULL ORDER BY createTime LIMIT #{m.page},#{m.number} "); |
| | | userList=syncUserService.selectList(sqlSentence); |
| | | logger.info("同步第:{}页咨询数据用户数量:{}",page,userList.size()); |
| | | try { |
| | | for(int i = 0;i < userList.size();i ++) |
| | | { |
| | | int count=i; |
| | | String userIds=userList.get(count).getId(); |
| | | String apiId=userList.get(count).getApiId(); |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | try { |
| | | |
| | | syncConsultationService.handleRecords(apiId,new JSONObject(),syncBasicInformationRecord); |
| | | }catch (Exception e){ |
| | | System.out.println(Thread.currentThread().getName()+" 执行第:"+count+"条错误"); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | |
| | | } |
| | | page++; |
| | | }while (userList.size()==number); |
| | | threadPool.shutdown(); |
| | | |
| | | return Result.success("同步用户咨询数据成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | /**创建咨询*/ |
| | | @PostMapping("/establish/record") |
| | | public Result establishRecord(@RequestBody JSONObject jsonObject) |
| | | { |
| | | |
| | | try { |
| | | return syncConsultationService.establishRecord(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.his.service.SyncCouponService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/coupon/toVoid") |
| | | public class SyncCouponController { |
| | | |
| | | |
| | | @Resource |
| | | private SyncCouponService syncCouponService; |
| | | /** |
| | | * 获取用户所有优惠卷 |
| | | * @return |
| | | */ |
| | | @PostMapping("/list") |
| | | public Result list(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return syncCouponService.list(jsonObject); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.service.SyncDeviceService; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 同步设备参数信息 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/device/toVoid") |
| | | public class SyncDeviceController { |
| | | |
| | | @Autowired |
| | | private SyncDeviceService syncDeviceService; |
| | | |
| | | /** |
| | | * 同步所有设备参数信息 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/list") |
| | | public Result syncEmployee() |
| | | { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,2,0,0); |
| | | |
| | | syncDeviceService.syncDevice(syncBasicInformationRecord); |
| | | return Result.success("同步所有设备参数信息"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.service.SyncEmployeeService; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步员工 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/employee/toVoid") |
| | | public class SyncEmployeeController{ |
| | | |
| | | @Resource |
| | | SyncEmployeeService syncEmployeeService; |
| | | |
| | | /** |
| | | * 同步所有员工信息 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/syncEmployee") |
| | | public Result syncEmployee() |
| | | { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,3,0,0); |
| | | syncEmployeeService.syncEmployee(syncBasicInformationRecord); |
| | | return Result.success("初始化同步员工成功"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncExecutionRecord; |
| | | import com.hx.phip.his.service.SyncExecutionRecordService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import com.mongodb.BasicDBObject; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 同步划扣信息 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/executionRecord/toVoid") |
| | | public class SyncExecutionRecordController { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SyncExecutionRecordController.class); |
| | | @Resource |
| | | private SyncExecutionRecordService syncExecutionRecordService; |
| | | |
| | | |
| | | /** 主动同步在授权机构下创建项目执行记录数据*/ |
| | | @RequestMapping("/created") |
| | | public Result created(String deductionProjectId) |
| | | { |
| | | if(StringUtils.isEmpty(deductionProjectId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要同步的订单"); |
| | | } |
| | | |
| | | return syncExecutionRecordService.created(deductionProjectId); |
| | | |
| | | } |
| | | /** 主动同步在授权机构下创建项目执行记录数据 直接怼his*/ |
| | | @PostMapping("/createdHis") |
| | | public Result createdHis(@RequestBody JSONObject jsonObject) |
| | | { |
| | | Result result=syncExecutionRecordService.createdHis(jsonObject); |
| | | logger.info("返回调用方数据:" +result); |
| | | return result; |
| | | |
| | | } |
| | | /** 获取授权机构下的客户项目执行数据*/ |
| | | @PostMapping("/obtain") |
| | | public Result obtain(@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | SyncExecutionRecord syncExecutionRecord=new SyncExecutionRecord(jsonObject.toString(),null,1,3,0,0,new Date()); |
| | | syncExecutionRecordService.obtain(jsonObject,syncExecutionRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** 获取授权机构下的可执行条目信息 - 订单中的项目条目*/ |
| | | @PostMapping("/executable") |
| | | public Result executable(@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | SyncExecutionRecord syncExecutionRecord=new SyncExecutionRecord(jsonObject.toString(),null,1,2,0,0,new Date()); |
| | | syncExecutionRecordService.executable(jsonObject,syncExecutionRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** 获取授权机构下的客户项目执行数据*/ |
| | | @PostMapping("/get/obtain") |
| | | public Result getObtain(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return syncExecutionRecordService.getObtain(jsonObject); |
| | | } |
| | | /** 获取授权机构下的客户项目执行数据*/ |
| | | @PostMapping("/get/executable") |
| | | public Result getExecutable(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return syncExecutionRecordService.getExecutable(jsonObject); |
| | | } |
| | | |
| | | /** |
| | | * 直接修改领健订单为已退款 |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateUserProjectItem") |
| | | public Result updateUserProjectItem(@RequestBody BasicDBObject order){ |
| | | return syncExecutionRecordService.updateUserProjectItem(order); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改已划扣记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateExecutionRecord") |
| | | public Result updateExecutionRecord(@RequestBody BasicDBObject basicDBObject){ |
| | | if(StringUtils.isEmpty(basicDBObject.getString("id"))) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"划扣记录id不能为空"); |
| | | } |
| | | return syncExecutionRecordService.updateExecutionRecord(basicDBObject); |
| | | } |
| | | /** |
| | | * 作废已划扣记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/deleteExecutionRecord") |
| | | public Result deleteExecutionRecord(@RequestBody BasicDBObject basicDBObject){ |
| | | if(StringUtils.isEmpty(basicDBObject.getString("id"))) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"已划扣记录id不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(basicDBObject.getString("itemId"))) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"未划扣记录itemId不能为空"); |
| | | } |
| | | return syncExecutionRecordService.deleteExecutionRecord(basicDBObject); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 初始化划扣记录表里面找不到对应的用户项目id |
| | | * @return |
| | | */ |
| | | @PostMapping("/initializationExecutionRecord") |
| | | public Result initializationExecutionRecord(@RequestBody BasicDBObject basicDBObject){ |
| | | syncExecutionRecordService.initializationExecutionRecord(); |
| | | return Result.success("初始化同步成功"); |
| | | } |
| | | |
| | | /** |
| | | * 执行记录的执行金额要重新同步计算 |
| | | */ |
| | | @PostMapping("/updateDeductionAmount") |
| | | public void updateDeductionAmount(){ |
| | | syncExecutionRecordService.updateDeductionAmount(); |
| | | } |
| | | |
| | | |
| | | /** 获取授权机构下的客户项目执行数据*/ |
| | | @PostMapping("/update-amount") |
| | | public Result updateAmount(@RequestBody JSONObject jsonObject) { |
| | | logger.info("同步划扣金额开始"); |
| | | syncExecutionRecordService.handleExecutionRecordAmount(jsonObject); |
| | | logger.info("同步划扣金额结束"); |
| | | return Result.success("初始化同步成功"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.service.SyncGoodsTreeService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import com.hz.his.dto.material.ConsumablesDto; |
| | | import com.hz.his.dto.material.ConsumablesTypeDto; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步耗材相关信息 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/goods/toVoid") |
| | | public class SyncGoodsController { |
| | | |
| | | @Resource |
| | | private SyncGoodsTreeService syncGoodsTreeService; |
| | | |
| | | |
| | | /**获取授权机构下的物料(商品)类数据分类(树状结构)*/ |
| | | @RequestMapping("/category/goods/tree") |
| | | public Result categoryGoodsTree() |
| | | { |
| | | try { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,4,0,0); |
| | | syncGoodsTreeService.categoryGoodsTree(syncBasicInformationRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /**同步所有物料*/ |
| | | @RequestMapping("/catalog/product/goods") |
| | | public Result catalogProductGoods() |
| | | { |
| | | try { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,5,0,0); |
| | | syncGoodsTreeService.catalogProductGoods(syncBasicInformationRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /**同步所有供应商数据*/ |
| | | @RequestMapping("/inventory/supplier") |
| | | public Result inventorySupplier() |
| | | { |
| | | try { |
| | | syncGoodsTreeService.inventorySupplier(); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /**指定类型下创建分类新节点 - 各类型通用*/ |
| | | @RequestMapping("/category/add") |
| | | public Result addCategory(@RequestBody ConsumablesTypeDto consumablesType) |
| | | { |
| | | if(StringUtils.isEmpty(consumablesType.getName()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"新增分类名称不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(consumablesType.getType()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"新增分类类型不能为空"); |
| | | } |
| | | try { |
| | | return syncGoodsTreeService.addCategory(consumablesType); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("指定类型下创建分类新节点,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /**修改指定ID分类节点 - 各类型通用*/ |
| | | @RequestMapping("/category/update") |
| | | public Result updateCategory(@RequestBody ConsumablesTypeDto consumablesType) |
| | | { |
| | | if(StringUtils.isEmpty(consumablesType.getHisId()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"修改分类hisId不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(consumablesType.getName()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"修改分类名称不能为空"); |
| | | } |
| | | try { |
| | | return syncGoodsTreeService.updateCategory(consumablesType); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("指定类型下创建分类新节点,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /**删除指定ID分类节点 - 各类型通用*/ |
| | | @RequestMapping("/category/delete") |
| | | public Result deleteCategory(@RequestBody ConsumablesTypeDto consumablesType) |
| | | { |
| | | if(StringUtils.isEmpty(consumablesType.getHisId()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"删除分类hisId不能为空"); |
| | | } |
| | | try { |
| | | return syncGoodsTreeService.deleteCategory(consumablesType); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("指定类型下创建分类新节点,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /**新建物料类数据*/ |
| | | @RequestMapping("/product/add") |
| | | public Result addProduct(@RequestBody ConsumablesDto consumablesDto) |
| | | { |
| | | if(StringUtils.isEmpty(consumablesDto.getCategoryId()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"新增商品的商品分类hisId不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(consumablesDto.getNameCHS()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"新增商品的中文名称不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(consumablesDto.getNumber()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"新增商品的编号不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(consumablesDto.getSpec()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"新增商品的规格不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(consumablesDto.getUnit()) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"新增商品的单位不能为空"); |
| | | } |
| | | if(consumablesDto.getEnabled()==null ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"新增商品的是否启用不能为空"); |
| | | } |
| | | |
| | | try { |
| | | return syncGoodsTreeService.addProduct(consumablesDto); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("指定类型下创建分类新节点,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /**修改物料类数据*/ |
| | | @RequestMapping("/product/update") |
| | | public Result updateProduct(@RequestBody ConsumablesDto consumablesDto) |
| | | { |
| | | try { |
| | | return syncGoodsTreeService.updateProduct(consumablesDto); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("指定类型下创建分类新节点,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.common.service.CommonService; |
| | | import com.hx.exception.TipsException; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.dao.mapper.OrdersTotalMapper; |
| | | import com.hx.phiappt.model.order.OrdersTotal; |
| | | import com.hx.phip.common.HisUrl; |
| | | import com.hx.phip.dao.mapper.syn.SyncOrderTotalMapper; |
| | | import com.hx.phip.his.service.OrderTotalService; |
| | | import com.hx.phip.his.service.SyncOrderService; |
| | | import com.hx.phip.model.SyncOrderTotal; |
| | | import com.hx.phip.uti.ExecutorServiceTool; |
| | | import com.hx.phip.uti.HisHttpUtil; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.DateUtil; |
| | | import com.hx.util.ExcelUtil; |
| | | import com.hx.util.StringUtils; |
| | | import com.mongodb.BasicDBObject; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 同步领建订单 |
| | | * @author CJH |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/his/order") |
| | | public class SyncHisOrderController { |
| | | private static Logger logger = LoggerFactory.getLogger(SyncHisOrderController.class); |
| | | |
| | | @Resource |
| | | private SyncOrderService saveHisProject; |
| | | @Resource |
| | | private OrderTotalService orderTotalService; |
| | | |
| | | |
| | | /** 根据订单id获取订单信息*/ |
| | | @GetMapping("/getOrderById") |
| | | public Result getOrderById(String orderId) |
| | | { |
| | | return saveHisProject.getOrderById(orderId); |
| | | } |
| | | |
| | | /**矫正订单的所有金额*/ |
| | | @RequestMapping("/init/consultant") |
| | | public Result initOrderConsultant(String orderNo,String startTime,String endTime,Integer his) { |
| | | |
| | | if(StringUtils.isNull(orderNo) |
| | | &&startTime == null&&endTime==null){ |
| | | throw new TipsException("查询参数不能全部为空!"); |
| | | } |
| | | logger.info("矫正订单的咨询师开始时间:{}", DateUtil.dateFormat(new Date(),"yyyy-MM-dd HH:mm:ss")); |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> values = new HashMap<>(); |
| | | |
| | | StringBuffer sql = new StringBuffer(); |
| | | |
| | | sql.append("SELECT ot.id,ot.hisOrderId,oi.hisOrderNo FROM orders_total ot "); |
| | | sql.append("LEFT JOIN orders_info oi ON oi.orderId = ot.id AND oi.isDel = 0"); |
| | | sql.append(" WHERE ot.isDel = 0"); |
| | | if(his != null){ |
| | | if(his == 0){ |
| | | sql.append(" AND ot.appId != '9d1a7c45-89d6-4241-b84a-32b34edc1283'"); |
| | | }else if(his == 1){ |
| | | sql.append(" AND ot.appId = '9d1a7c45-89d6-4241-b84a-32b34edc1283'"); |
| | | } |
| | | } |
| | | if(StringUtils.noNull(orderNo)){ |
| | | sql.append(" AND ot.orderNo = #{m.orderNo}"); |
| | | values.put("orderNo",orderNo); |
| | | } |
| | | if(startTime != null){ |
| | | sql.append(" AND ot.createTime >= #{m.startTime}"); |
| | | values.put("startTime",startTime); |
| | | } |
| | | if(endTime != null){ |
| | | sql.append(" AND ot.createTime <= #{m.endTime}"); |
| | | values.put("endTime",endTime); |
| | | } |
| | | sql.append(" ORDER BY ot.createTime ASC LIMIT #{m.pageSizeCode},#{m.pageSize}"); |
| | | sqlSentence.sqlSentence(sql.toString(),values); |
| | | |
| | | // 创建缓存线程池,大小为30 |
| | | ExecutorServiceTool fixedThreadPool = new ExecutorServiceTool(10,200); |
| | | try{ |
| | | int pageSizeCode = 0; |
| | | int pageSize = 500; |
| | | values.put("pageSize",pageSize); |
| | | while (true){ |
| | | //睡眠 |
| | | if(fixedThreadPool.noRund(5000)){ |
| | | continue; |
| | | } |
| | | if(pageSizeCode % 10000 == 0){ |
| | | logger.info("矫正订单的咨询师初始位置:{}", pageSizeCode); |
| | | } |
| | | values.put("pageSizeCode",pageSizeCode); |
| | | sqlSentence.setM(values); |
| | | List<Map<String,Object>> ordersTotalList = orderTotalService.selectList(sqlSentence); |
| | | for(Map<String,Object> map:ordersTotalList){ |
| | | // 执行任务 |
| | | fixedThreadPool.getThreadPool().execute(() -> { |
| | | try{ |
| | | orderTotalService.initOrderConsultant((String)map.getOrDefault("id",null) |
| | | ,(String)map.getOrDefault("hisOrderId",null),(String)map.getOrDefault("hisOrderNo",null)); |
| | | }catch (Exception e){ |
| | | logger.error("矫正订单的咨询师报错订单标识:{}",map.toString()); |
| | | logger.error("矫正订单的咨询师报错信息",e); |
| | | //异常处理-发送异常信息 |
| | | } |
| | | }); |
| | | |
| | | } |
| | | pageSizeCode = pageSizeCode+pageSize; |
| | | if(ordersTotalList.size() < pageSize){ |
| | | break; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | logger.error("矫正订单的咨询师数据报错信息1",e); |
| | | }finally { |
| | | fixedThreadPool.shutdown(); |
| | | } |
| | | logger.info("矫正订单的咨询师结束时间:{}", DateUtil.dateFormat(new Date(),"yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | return Result.success(); |
| | | } |
| | | |
| | | /**矫正订单的所有金额*/ |
| | | @RequestMapping("/init/consultant/excel") |
| | | public Result initOrderConsultantExcel(MultipartFile file) throws Exception { |
| | | |
| | | List<List<String>> datas = ExcelUtil.getExcelDataCompatible(file,false); |
| | | |
| | | // 创建缓存线程池,大小为30 |
| | | ExecutorServiceTool fixedThreadPool = new ExecutorServiceTool(10,200); |
| | | try{ |
| | | int i = 1; |
| | | for(List<String> data:datas){ |
| | | //睡眠 |
| | | if(fixedThreadPool.noRund(5000)){ |
| | | continue; |
| | | } |
| | | if(i % 100 == 0){ |
| | | logger.info("矫正订单的咨询师初始位置:{}", i); |
| | | } |
| | | // 执行任务 |
| | | fixedThreadPool.getThreadPool().execute(() -> { |
| | | try{ |
| | | orderTotalService.initOrderConsultant(data.get(0),data.get(1),data.get(2)); |
| | | }catch (Exception e){ |
| | | logger.error("矫正订单的咨询师报错订单标识:{}",data.toString()); |
| | | logger.error("矫正订单的咨询师报错信息",e); |
| | | //异常处理-发送异常信息 |
| | | } |
| | | }); |
| | | i++; |
| | | } |
| | | }catch (Exception e){ |
| | | logger.error("矫正订单的咨询师数据报错信息1",e); |
| | | }finally { |
| | | fixedThreadPool.shutdown(); |
| | | } |
| | | logger.info("矫正订单的咨询师结束时间:{}", DateUtil.dateFormat(new Date(),"yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phiappt.dao.mapper.EmployeeMapper; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.service.GetTokenService; |
| | | import com.hx.phip.his.service.SyncMedicalRecordsService; |
| | | import com.hx.phip.his.service.SyncTransactioalService; |
| | | import com.hx.phip.his.util.SyncMedicalPrescriptionUtil; |
| | | import com.hx.redis.RedisUtil; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步病例 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/medical/records/toVoid") |
| | | public class SyncMedicalRecordsController { |
| | | |
| | | @Resource |
| | | private SyncMedicalRecordsService medicalRecordsService; |
| | | // @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | @Resource |
| | | private GetTokenService getTokenService; |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | @Resource |
| | | private EmployeeMapper employeeMapper; |
| | | |
| | | public String getApplicationAccessToken(){ |
| | | String at = getTokenService.getApplicationAccessToken(systemParameterMapper, systemConfig.getCorpId(), systemConfig.getCorpMpSecret()); |
| | | return at; |
| | | } |
| | | |
| | | /**同步病例模板*/ |
| | | @RequestMapping("/his/medical/records/template") |
| | | public Result syncMedicalRecordsTemplate() |
| | | { |
| | | try { |
| | | SyncBasicInformationRecord basicInformationRecord=new SyncBasicInformationRecord(1,13,0,0); |
| | | medicalRecordsService.saveHisMedicalRecordsTemplate(basicInformationRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /**同步病例*/ |
| | | @RequestMapping("/his/medical/records") |
| | | public Result syncMedicalRecords() |
| | | { |
| | | try { |
| | | SyncBasicInformationRecord basicInformationRecord=new SyncBasicInformationRecord(1,14,0,0); |
| | | SyncMedicalPrescriptionUtil.syncMedicalRecords(basicInformationRecord,medicalRecordsService,syncTransactioalService,mongoTemplate,redisUtil, |
| | | employeeMapper,systemConfig,getApplicationAccessToken()); |
| | | // medicalRecordsService.saveHisMedicalRecordsTemplate(basicInformationRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.his.service.SyncMemberCenterService; |
| | | import com.hx.resultTool.Result; |
| | | import com.mongodb.BasicDBObject; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author 同步会员中心其他管理信息 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/member/center/toVoid") |
| | | public class SyncMemberCenterController { |
| | | |
| | | |
| | | @Resource |
| | | private SyncMemberCenterService syncMemberCenterService; |
| | | |
| | | /**同步投诉管理*/ |
| | | @PostMapping("/complaint") |
| | | public Result syncComplaint() |
| | | { |
| | | try { |
| | | syncMemberCenterService.syncComplaint(); |
| | | return Result.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /**同步回访管理*/ |
| | | @PostMapping("/returnVisit") |
| | | public Result returnVisit(@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | syncMemberCenterService.returnVisit(jsonObject); |
| | | return Result.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.common.HisUrl; |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phip.dao.mapper.syn.SyncOrderTotalMapper; |
| | | import com.hx.phip.model.SyncOrderTotal; |
| | | import com.hx.phip.his.service.CreateTimeNoService; |
| | | import com.hx.phip.his.service.SyncNewOrderService; |
| | | import com.hx.phip.his.service.SyncOrderService; |
| | | import com.hx.phip.his.service.SyncTransactioalService; |
| | | import com.hx.phip.uti.HisHttpUtil; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.ExcelUtil; |
| | | import com.hx.util.StringUtils; |
| | | import com.mongodb.BasicDBObject; |
| | | import lombok.SneakyThrows; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * 同步订单 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/order/toVoid") |
| | | public class SyncOrderController { |
| | | private static Logger logger = LoggerFactory.getLogger(SyncOrderController.class); |
| | | |
| | | @Resource |
| | | private SyncOrderService saveHisProject; |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | @Resource |
| | | private CreateTimeNoService createTimeNoService; |
| | | @Resource |
| | | private SyncNewOrderService syncNewOrderService; |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | |
| | | @PostMapping("/syncSalesOrderTest") |
| | | public Result syncSalesOrderTest(@RequestBody JSONObject jsonObject){ |
| | | System.out.println(createTimeNoService.getOrderNo("SYNC",4, String.valueOf(System.currentTimeMillis()))); |
| | | return Result.success("初始化同步成功"); |
| | | } |
| | | /** 根据订单id获取订单信息*/ |
| | | @GetMapping("/getOrderById") |
| | | public Result getOrderById(String orderId) |
| | | { |
| | | return saveHisProject.getOrderById(orderId); |
| | | } |
| | | |
| | | /** 同步授权机构下的销售订单摘要数据 - 订单摘要信息*/ |
| | | @PostMapping("/syncSalesOrder/byId") |
| | | public Result syncSalesOrderbyId(String orderId){ |
| | | String at = saveHisProject.getToken(); |
| | | Map<String,String> header=new HashMap<>(); |
| | | header.put("x-access-token",at); |
| | | StringBuffer url=new StringBuffer(systemConfig.getApiUrl()+ HisUrl.BILLING_SALES_ORDER+"/"+orderId); |
| | | String result = HisHttpUtil.HttpURLUtilJson(url.toString() ,null, null, header, "GET"); |
| | | saveHisProject.syncOrderThread(JSONObject.fromObject(result)); |
| | | return Result.success("初始化同步成功"); |
| | | } |
| | | |
| | | |
| | | /** 同步授权机构下的销售订单摘要数据 - 订单摘要信息*/ |
| | | @PostMapping("/syncSalesOrder") |
| | | public Result syncSalesOrder(@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | SyncOrderTotal syncOrderTotal=new SyncOrderTotal(1,1,0,0); |
| | | |
| | | JSONObject returnJson= saveHisProject.syncSalesOrder(jsonObject,syncOrderTotal); |
| | | if(returnJson==null){ |
| | | logger.info("获取初始路径和页面错误"); |
| | | return; |
| | | }else { |
| | | logger.info("获取初始路径和页面成功数据;{}",returnJson.toString()); |
| | | } |
| | | //开12个线程池处理其它页 |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(5); |
| | | int MaxAgain=20;//定义请求超时重新发起请求最大次数 |
| | | try { |
| | | //3648 |
| | | for(int i = 0;i < returnJson.optInt("totalPage");i ++) |
| | | { |
| | | int page=i; |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | int num=0; |
| | | do{ |
| | | |
| | | try { |
| | | Boolean status= syncOrderThread(returnJson.optString("url"),page,syncOrderTotal); |
| | | if(status){ |
| | | num=MaxAgain; |
| | | }else { |
| | | logger.info(Thread.currentThread().getName()+" 执行第:"+page+" 页 Rtime Out 第"+num+"次"); |
| | | num++; |
| | | } |
| | | }catch (Exception e){ |
| | | logger.info(Thread.currentThread().getName()+" 执行第:"+page+" 页 Rtime Out 第"+num+"次"); |
| | | num++; |
| | | } |
| | | }while(num<MaxAgain); |
| | | } |
| | | }); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | threadPool.shutdown(); |
| | | while (true) { |
| | | if (threadPool.isTerminated()) { |
| | | syncOrderTotal.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncOrderTotalMapper.class,syncOrderTotal); |
| | | logger.info("结束了!"); |
| | | break; |
| | | }else { |
| | | try { |
| | | Thread.sleep(60000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | public Boolean syncOrderThread(String url,int page,SyncOrderTotal syncOrderTotal) { |
| | | String at = saveHisProject.getToken(); |
| | | Map<String,String> header=new HashMap<>(); |
| | | header.put("x-access-token",at); |
| | | logger.info("同步订单处理第"+page+"页"); |
| | | String result = HisHttpUtil.HttpURLUtilJson(url +"&page="+page,null, null, header, "GET"); |
| | | |
| | | |
| | | if(!StringUtils.isEmpty(result)) |
| | | { |
| | | JSONObject obj = JSONObject.fromObject(result); |
| | | if(obj != null) |
| | | { |
| | | JSONArray arr = obj.optJSONArray("content"); |
| | | if(arr != null && arr.size() > 0) |
| | | { |
| | | for(int j = 0;j < arr.size();j ++) |
| | | { |
| | | try { |
| | | saveHisProject.syncOrderThread(arr.getJSONObject(j)); |
| | | syncOrderTotal.setSuccessNumber(syncOrderTotal.getSuccessNumber()+1); |
| | | } catch (Exception e) { |
| | | syncOrderTotal.setFailNumber(syncOrderTotal.getFailNumber()+1); |
| | | logger.error("同步订单出错了:"+ arr.getJSONObject(j).optString("id") ,e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | logger.info("同步第{}页his接口错误,返回:{}",page,result); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** 主动同步创建订单到his - 订单摘要信息*/ |
| | | @PostMapping("/syncCreateOrder") |
| | | public Result syncCreateOrder( @RequestBody JSONObject order) |
| | | { |
| | | return syncNewOrderService.createOrder(order); |
| | | } |
| | | /** 修改用户卡包 - 订单摘要信息*/ |
| | | @PostMapping("/updateUserCard") |
| | | public Result updateUserCard( @RequestBody JSONObject order) |
| | | { |
| | | return syncNewOrderService.updateUserCard(order); |
| | | } |
| | | |
| | | /** 销售支付,支付后为已支付订单,受理所有订单流程*/ |
| | | @PostMapping("/syncOrderPayment") |
| | | public Result syncOrderPayment(@RequestBody JSONObject order) |
| | | { |
| | | if(StringUtils.isEmpty(order.optString("orderId"))) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"领建订单id必传"); |
| | | } |
| | | return syncNewOrderService.syncOrderPayment(order); |
| | | } |
| | | |
| | | /** 创建储值金与预定金订单 - 顾客信息*/ |
| | | @PostMapping("/prepaidOrder") |
| | | public Result prepaidOrder(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return saveHisProject.prepaidOrder(jsonObject); |
| | | |
| | | } |
| | | /** 销售订单废弃,未支付订单可废弃,废弃后订单不可操作*/ |
| | | @GetMapping("/syncOrderToVoid") |
| | | public Result syncOrderToVoid(String orderId) |
| | | { |
| | | if(StringUtils.isEmpty(orderId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要作废的订单id"); |
| | | } |
| | | return saveHisProject.syncOrderToVoid(orderId); |
| | | } |
| | | /** 订单退款,忽略审批流程*/ |
| | | @PostMapping("/syncOrderRefund") |
| | | public Result syncOrderRefund(@RequestBody JSONObject order) |
| | | { |
| | | return saveHisProject.syncOrderRefund(order); |
| | | } |
| | | |
| | | |
| | | /** 修改订单电商平台,电商平台订单号,备注*/ |
| | | @PostMapping("/updateOrder") |
| | | public Result updateOrder(@RequestBody BasicDBObject order ) |
| | | { |
| | | return saveHisProject.updateOrder(order); |
| | | } |
| | | |
| | | /** |
| | | * 直接修改领健订单为已退款 |
| | | * @return |
| | | */ |
| | | @PostMapping("/refundOrder") |
| | | public Result refundOrder(@RequestBody BasicDBObject order){ |
| | | return saveHisProject.refundOrder(order); |
| | | } |
| | | /** |
| | | * 直接修改领健订单为部分退款 |
| | | * @return |
| | | */ |
| | | @PostMapping("/partialRefund") |
| | | public Result partialRefund(@RequestBody BasicDBObject order){ |
| | | return saveHisProject.partialRefund(order); |
| | | } |
| | | |
| | | /** |
| | | * 未支付订单直接作废 |
| | | * @return |
| | | */ |
| | | @PostMapping("/cancelOrder") |
| | | public Result cancelOrder(@RequestBody BasicDBObject order){ |
| | | return saveHisProject.cancelOrder(order); |
| | | } |
| | | |
| | | /** |
| | | * 直接修改领健订单为已支付 |
| | | * @return |
| | | */ |
| | | @PostMapping("/paidOrder") |
| | | public Result paidOrder(@RequestBody BasicDBObject order){ |
| | | return saveHisProject.paidOrder(order); |
| | | } |
| | | |
| | | /** |
| | | * 初始化同步phis创建订单领建结账结账记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/orderPayRecord") |
| | | public Result orderPayRecord(){ |
| | | return saveHisProject.orderPayRecord(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/updateOrderOripice") |
| | | public Result updateOrderOripice(MultipartFile file) throws Exception { |
| | | |
| | | List<List<String>> datas = ExcelUtil.readExcelByeFileDataToXSSF(file,false); |
| | | StringBuffer url=new StringBuffer(systemConfig.getApiUrl()+ HisUrl.BILLING_SALES_ORDER); |
| | | /* String at; |
| | | Map<String,String> header=new HashMap<>(); |
| | | |
| | | String result=null; |
| | | for (int i = 0; i < datas.size(); i++) { |
| | | at = saveHisProject.getToken(); |
| | | header.put("x-access-token",at); |
| | | logger.info("开始处理第:{}数据", i); |
| | | try { |
| | | result = HisHttpUtil.HttpURLUtilJson(url.toString()+"/"+datas.get(i).get(0),null, null, header, "GET"); |
| | | saveHisProject.syncOrderThread(JSONObject.fromObject(result)); |
| | | } catch (Exception e) { |
| | | logger.error("同步订单出错了:"+ datas.get(i).get(0),e); |
| | | } |
| | | |
| | | }*/ |
| | | |
| | | //开20个线程池处理其它页 |
| | | int threadSize=5; |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(threadSize); |
| | | try { |
| | | for (int i = 0; i < datas.size(); i++) { |
| | | { |
| | | Integer pageNum = i; |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | try { |
| | | logger.info("开始处理第:{}数据", pageNum); |
| | | String at = saveHisProject.getToken(); |
| | | Map<String,String> header=new HashMap<>(); |
| | | header.put("x-access-token", at); |
| | | String result = HisHttpUtil.HttpURLUtilJson(url.toString() + "/" + datas.get(pageNum).get(0), null, null, header, "GET"); |
| | | saveHisProject.syncOrderThread(JSONObject.fromObject(result)); |
| | | } catch (Exception e) { |
| | | logger.error("同步订单出错了:" + datas.get(pageNum).get(0), e); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | threadPool.shutdown(); |
| | | } |
| | | |
| | | |
| | | |
| | | return Result.success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phiappt.model.prescription.PrescriptionTemplate; |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phiappt.dao.mapper.EmployeeMapper; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.service.GetTokenService; |
| | | import com.hx.phip.his.service.PrescriptionService; |
| | | import com.hx.phip.his.service.PrescriptionTemplateService; |
| | | import com.hx.phip.his.service.SyncTransactioalService; |
| | | import com.hx.phip.his.util.SyncMedicalPrescriptionUtil; |
| | | import com.hx.redis.RedisUtil; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步处方 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/prescription/toVoid") |
| | | public class SyncPrescriptionController { |
| | | |
| | | @Resource |
| | | private PrescriptionTemplateService prescriptionTemplateService; |
| | | |
| | | @Resource |
| | | private PrescriptionService prescriptionService; |
| | | // @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | @Resource |
| | | private GetTokenService getTokenService; |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | @Resource |
| | | private EmployeeMapper employeeMapper; |
| | | |
| | | public String getApplicationAccessToken(){ |
| | | String at = getTokenService.getApplicationAccessToken(systemParameterMapper, systemConfig.getCorpId(), systemConfig.getCorpMpSecret()); |
| | | return at; |
| | | } |
| | | |
| | | /**同步处方模板*/ |
| | | @RequestMapping("/his/prescription/template") |
| | | public Result syncMedicalRecordsTemplate() |
| | | { |
| | | try { |
| | | SyncBasicInformationRecord basicInformationRecord=new SyncBasicInformationRecord(1,15,0,0); |
| | | prescriptionTemplateService.saveHisPrescriptionTemplate(basicInformationRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /**同步处方*/ |
| | | @RequestMapping("/his/prescription") |
| | | public Result syncMedicalRecords() |
| | | { |
| | | try { |
| | | SyncBasicInformationRecord basicInformationRecord=new SyncBasicInformationRecord(1,16,0,0); |
| | | SyncMedicalPrescriptionUtil.syncPrescription(basicInformationRecord,prescriptionService,syncTransactioalService,mongoTemplate, |
| | | employeeMapper,systemConfig,getApplicationAccessToken()); |
| | | // prescriptionService.saveHisPrescription(basicInformationRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.model.SyncProjectRecord; |
| | | import com.hx.phip.his.service.SyncProjectTreeService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.ExcelUtil; |
| | | import com.hx.util.StringUtils; |
| | | import com.mongodb.BasicDBObject; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 同步项目 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/project/toVoid") |
| | | public class SyncProjectController { |
| | | |
| | | @Resource |
| | | private SyncProjectTreeService basicDataService; |
| | | |
| | | |
| | | /**同步项目树状结构*/ |
| | | @RequestMapping("/category/service/tree") |
| | | public Result categoryServiceTree() |
| | | { |
| | | try { |
| | | SyncProjectRecord syncProjectRecord=new SyncProjectRecord(1,1,0,0); |
| | | basicDataService.categoryServiceTree(syncProjectRecord); |
| | | return Result.success("初始化同步成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /**新增项目分类*/ |
| | | @RequestMapping("/add/service/tree") |
| | | public Result addServiceTree(@RequestBody BasicDBObject jsonObject) |
| | | { |
| | | try { |
| | | return basicDataService.addServiceTree(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /**修改项目分类*/ |
| | | @RequestMapping("/update/service/tree") |
| | | public Result updateServiceTree(@RequestBody BasicDBObject jsonObject) |
| | | { |
| | | if(StringUtils.isEmpty((String) jsonObject.get("id")) ){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"修改的项目分类id不能为空"); |
| | | } |
| | | |
| | | try { |
| | | return basicDataService.updateServiceTree(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /**主动同步项目到his*/ |
| | | @PostMapping("/add/project") |
| | | public Result syncAddProject(@RequestBody BasicDBObject jsonObject) |
| | | { |
| | | try { |
| | | return basicDataService.syncAddProject(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /**修改项目*/ |
| | | @PostMapping("/update/project") |
| | | public Result syncUpdateProject(@RequestBody BasicDBObject basicDBObject) |
| | | { |
| | | try { |
| | | return basicDataService.syncUpdateProject(basicDBObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /**同步所有项目*/ |
| | | @RequestMapping("/sync/his/project") |
| | | public Result syncHisProject() |
| | | { |
| | | try { |
| | | SyncProjectRecord syncProjectRecord=new SyncProjectRecord(1,2,0,0); |
| | | basicDataService.saveHisProject(syncProjectRecord); |
| | | return Result.success("初始化同步项目成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /**同步所有促销*/ |
| | | @RequestMapping("/promotion") |
| | | public Result syncHisPromotion(@RequestBody JSONObject jsonObject) |
| | | { |
| | | SyncProjectRecord syncProjectRecord=new SyncProjectRecord(1,4,0,0); |
| | | basicDataService.syncHisPromotion(syncProjectRecord,jsonObject); |
| | | return Result.success("初始化同步促销成功"); |
| | | } |
| | | /**同步所有卡项*/ |
| | | @PostMapping("/cardItem") |
| | | public Result syncHisCardItem(@RequestBody JSONObject jsonObject) |
| | | { |
| | | SyncProjectRecord syncProjectRecord=new SyncProjectRecord(1,3,0,0); |
| | | basicDataService.syncHisCardItem(jsonObject,syncProjectRecord); |
| | | return Result.success("初始化同步卡项成功"); |
| | | } |
| | | |
| | | /**延期促销*/ |
| | | @RequestMapping("/delay/promotion") |
| | | public Result delayPromotion() |
| | | { |
| | | |
| | | return Result.success("初始化同步促销成功"); |
| | | } |
| | | /** |
| | | * 表格导入获取数据 |
| | | */ |
| | | @RequestMapping("/import/excel") |
| | | public Result importExcel(MultipartFile file)throws Exception { |
| | | List<List<String>> datas = ExcelUtil.readExcelByeFileDataToXSSF(file,false); |
| | | System.out.println(datas.get(0).get(0)+"zhangxu"+datas.get(0).get(2)); |
| | | |
| | | for (List<String> data : datas) { |
| | | basicDataService.delayPromotion(data.get(0), Integer.parseInt(data.get(2))); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | |
| | | /**初始化同步phis疗程数*/ |
| | | @PostMapping("/update/project/treatmentItemsNum") |
| | | public Result syncUpdateTreatmentItemsNum() |
| | | { |
| | | basicDataService.syncUpdateTreatmentItemsNum(); |
| | | return Result.success("初始化同步促销成功"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.his.service.SyncSalesFinancialDataService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/sales/financial/toVoid") |
| | | public class SyncSalesFinancialDataController { |
| | | |
| | | @Resource |
| | | private SyncSalesFinancialDataService syncSalesFinancialDataService; |
| | | |
| | | /** 获取授权机构下的收银摘要数据 - 收银摘要列表*/ |
| | | @PostMapping("/payment") |
| | | public Result payment(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return syncSalesFinancialDataService.payment(jsonObject); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.service.SyncShopService; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步门店 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/shop/toVoid") |
| | | public class SyncShopController { |
| | | |
| | | @Resource |
| | | SyncShopService syncShopService; |
| | | /** |
| | | * 同步所有门店 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/syncShop") |
| | | public Result syncShop() |
| | | { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,6,0,0); |
| | | syncShopService.syncShop(syncBasicInformationRecord); |
| | | return Result.success("初始化同步所有门店成功"); |
| | | } |
| | | |
| | | /** |
| | | * 获取授权机构下医疗科室信息 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/medicalDepartment") |
| | | public Result synceMedicalDepartment() |
| | | { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,7,0,0); |
| | | syncShopService.synceMedicalDepartment(syncBasicInformationRecord); |
| | | return Result.success("初始化同步所有科室成功"); |
| | | } |
| | | |
| | | /** |
| | | * 查找指定诊所的治疗房间,手术房间 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/syncShopRoom") |
| | | public Result syncShopRoom(String shopId) |
| | | { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,8,0,0); |
| | | syncShopService.syncShopRoom(shopId,syncBasicInformationRecord); |
| | | return Result.success("同步科室成功"); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.service.SyncTagSetsService; |
| | | import com.hx.resultTool.Result; |
| | | import com.mongodb.BasicDBObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步标签 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/tags/toVoid") |
| | | public class SyncTagSetsController { |
| | | |
| | | @Resource |
| | | SyncTagSetsService syncTagSetsService; |
| | | |
| | | /** |
| | | * 同步所有标签信息 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/list") |
| | | public Result syncTags() |
| | | { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,9,0,0); |
| | | syncTagSetsService.tagsList(syncBasicInformationRecord); |
| | | return Result.success("初始化同步标签成功"); |
| | | } |
| | | /** |
| | | * 同步所有标签信息 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/getList") |
| | | public Result getList() |
| | | { |
| | | return syncTagSetsService.getList(); |
| | | } |
| | | /** |
| | | * 新增标签信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public Result addTags(@RequestBody BasicDBObject basicDBObject) |
| | | { |
| | | return syncTagSetsService.addTags(basicDBObject); |
| | | } |
| | | /** |
| | | * 修改标签信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public Result updateTags(@RequestBody BasicDBObject basicDBObject) |
| | | { |
| | | return syncTagSetsService.updateTags(basicDBObject); |
| | | } |
| | | /** |
| | | * 删除标签信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/delete") |
| | | public Result deleteTags(@RequestBody BasicDBObject basicDBObject) |
| | | { |
| | | return syncTagSetsService.deleteTags(basicDBObject); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户标签信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/update/user/tag") |
| | | public Result updateUserTags(@RequestBody BasicDBObject basicDBObject) |
| | | { |
| | | return syncTagSetsService.updateUserTags(basicDBObject); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.dao.mapper.syn.SyncUserCardRecordMapper; |
| | | import com.hx.phip.model.SyncUserCardRecord; |
| | | import com.hx.phip.his.service.SyncTransactioalService; |
| | | import com.hx.phip.his.service.SyncUserCardService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import com.mongodb.BasicDBObject; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.context.config.annotation.RefreshScope; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author 同步用户卡包 |
| | | */ |
| | | @RefreshScope |
| | | @RestController |
| | | @RequestMapping("/sync/user/card/toVoid") |
| | | public class SyncUserCardController { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SyncUserCardController.class); |
| | | |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | |
| | | @Resource |
| | | private SyncUserCardService syncUserCardService; |
| | | /** |
| | | * 同步用户卡包 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/list") |
| | | public Result list(@RequestBody JSONObject jsonObject) |
| | | { |
| | | SyncUserCardRecord syncUserCardRecord=new SyncUserCardRecord(jsonObject.toString(),1,0,0,new Date()); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | logger.info("开始处理同步用户卡包数据:{}"); |
| | | List<Map> mapList= syncUserCardService.list(jsonObject,syncUserCardRecord); |
| | | logger.info("处理用户卡包总数:{}",mapList.size()); |
| | | for (int i = 0; i < mapList.size(); i++) { |
| | | try { |
| | | syncUserCardService.handleList(mapList.get(i)); |
| | | syncUserCardRecord.setSuccessNumber(syncUserCardRecord.getSuccessNumber()+1); |
| | | } catch (Exception e) { |
| | | syncUserCardRecord.setFailNumber(syncUserCardRecord.getFailNumber()+1); |
| | | logger.error("同步卡包出错了:" + mapList.get(i),e); |
| | | } |
| | | } |
| | | syncUserCardRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncUserCardRecordMapper.class,syncUserCardRecord); |
| | | } |
| | | }).start(); |
| | | |
| | | return Result.success("初始化同步用户卡包信息成功"); |
| | | } |
| | | |
| | | /** |
| | | * 同步用户卡包 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUserCard") |
| | | public Result getUserCard(String orderId){ |
| | | if(StringUtils.isEmpty(orderId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"订单id不能为空"); |
| | | } |
| | | return syncUserCardService.getUserCard(orderId); |
| | | } |
| | | |
| | | /** |
| | | * 作废用户卡包 |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateUserCard") |
| | | public Result updateUserCard(@RequestBody BasicDBObject userCard){ |
| | | if(userCard.get("hisId")==null) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"卡包hisId不能为空"); |
| | | } |
| | | return syncUserCardService.updateUserCard(userCard); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.exception.ParamException; |
| | | import com.hx.exception.TipsException; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phip.dao.mapper.syn.SyncUserPictureMapper; |
| | | import com.hx.phip.model.SyncUserPictureRcord; |
| | | import com.hx.phip.his.service.SyncExecutionRecordService; |
| | | import com.hx.phip.his.service.SyncTransactioalService; |
| | | import com.hx.phip.his.service.SyncUserService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import com.hz.his.feign.service.phis.SFileService; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.apache.commons.fileupload.FileItem; |
| | | import org.apache.commons.fileupload.FileItemFactory; |
| | | import org.apache.commons.fileupload.disk.DiskFileItemFactory; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * 同步用户相关信息 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/user") |
| | | public class SyncUserController{ |
| | | private static Logger logger = LoggerFactory.getLogger(SyncUserController.class); |
| | | @Resource |
| | | private SyncUserService syncUserService; |
| | | |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | |
| | | @Resource |
| | | private SyncExecutionRecordService syncExecutionRecordService; |
| | | |
| | | /** |
| | | * 根据顾客id同步指定顾客 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @RequestMapping("/syncUserById/toVoid") |
| | | public Result syncUserById(String userId) |
| | | { |
| | | if(StringUtils.isEmpty(userId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择客户"); |
| | | } |
| | | |
| | | User u = syncUserService.selectOneByKey(userId); |
| | | if(u == null) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"找不到客户"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(u.getApiId())) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"在his上找不到该客户"); |
| | | |
| | | } |
| | | |
| | | try { |
| | | syncUserService.syncUserById(u.getApiId()); |
| | | return Result.success("初始化同步指定顾客成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步指定顾客,失败异常为:"+e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 同步领建用户项目,预约不存在就新增,存在就跳过 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/project/no-exist") |
| | | public Result userProjectNoExist(String startTime,String endTime,String customerId,String CIQ) { |
| | | |
| | | //startTime开始时间-格式yyyy-MM-dd |
| | | //endTime结束时间-格式yyyy-MM-dd |
| | | //customerId领建用户标识 |
| | | //CIQ领建用户CIQ |
| | | |
| | | if(StringUtils.isEmpty(startTime) |
| | | &&StringUtils.isEmpty(endTime) |
| | | &&StringUtils.isEmpty(customerId) |
| | | &&StringUtils.isEmpty(CIQ)){ |
| | | throw new TipsException("查询条件必填一个"); |
| | | } |
| | | |
| | | syncExecutionRecordService.handleexecutableRecordNoExist(startTime,endTime,customerId,CIQ); |
| | | |
| | | |
| | | return Result.success("初始化成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** 查询his客户 */ |
| | | @RequestMapping("/getHisUserList/toVoid") |
| | | public Result getHisUserList(Integer pageSize, Integer pageNum, String keyword){ |
| | | |
| | | if(StringUtils.isEmpty(keyword)){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"查询关键字为空"); |
| | | } |
| | | if(pageNum == null || pageNum < 0){ |
| | | pageNum = 0; |
| | | }else{ |
| | | pageNum -- ; |
| | | } |
| | | if(pageSize == null || pageSize <= 0){ |
| | | pageSize = 20; |
| | | } |
| | | |
| | | //查询 |
| | | String result = syncUserService.getHisUserList(pageSize,pageNum,keyword); |
| | | |
| | | JSONObject obj = null; |
| | | JSONArray arr = null; |
| | | |
| | | JSONObject json = null; |
| | | JSONArray list = null; |
| | | if(!StringUtils.isEmpty(result)) |
| | | { |
| | | obj = JSONObject.fromObject(result); |
| | | if(obj != null) |
| | | { |
| | | arr = obj.optJSONArray("content"); |
| | | } |
| | | } |
| | | |
| | | return Result.success(com.alibaba.fastjson.JSONArray.parse(arr.toString())); |
| | | } |
| | | /** 查询his客户 */ |
| | | @RequestMapping("/getUserById/toVoid") |
| | | public Result getUserById( String id){ |
| | | //查询 |
| | | String result = syncUserService.getUserById(id); |
| | | return Result.success(result); |
| | | } |
| | | |
| | | /** his用户json数据同步 */ |
| | | @PostMapping("/syncUserByJson/toVoid") |
| | | public Result syncUserByJson(@RequestBody String jsonStr){ |
| | | |
| | | if(StringUtils.isEmpty(jsonStr)){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"同步客户数据为空"); |
| | | } |
| | | |
| | | JSONObject json = JSONObject.fromObject(jsonStr); |
| | | try { |
| | | syncUserService.syncUserByJson(json.toString()); |
| | | return Result.success("初始化同步指定顾客成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步指定顾客,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 同步所有数据 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @PostMapping("/syncUser/toVoid") |
| | | public Result syncUser(@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | syncUserService.syncUser(jsonObject); |
| | | } |
| | | }).start(); |
| | | return Result.success("初始化同步顾客成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步顾客,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** 主动同步创建顾客到his - 顾客信息*/ |
| | | @PostMapping("/syncCreateUser/toVoid") |
| | | public Result syncCreateUser(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return syncUserService.syncCreateUser(jsonObject); |
| | | } |
| | | |
| | | /** 商汤创建访客 - 顾客信息*/ |
| | | @RequestMapping("/senselinkCustomer") |
| | | public Result senselinkCustomer(String userId,String type) throws Exception { |
| | | if(StringUtils.isEmpty(userId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要在商汤创建访客的用户"); |
| | | } |
| | | if(StringUtils.isEmpty(type)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"操作类型不能为空"); |
| | | } |
| | | return syncUserService.senselinkCustomer(userId,type); |
| | | } |
| | | |
| | | /** 根据客户Id获取授权机构下的账户余额 给自己初始化使用 - 顾客信息*/ |
| | | @RequestMapping("/syncUserAccount/toVoid") |
| | | public Result syncUserAccount(String userId) |
| | | { |
| | | try { |
| | | syncUserService.syncUserAccount(userId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return Result.success("同步用户账户余额成功"); |
| | | } |
| | | /** 根据客户Id获取授权机构下的账户余额 - 顾客信息*/ |
| | | @RequestMapping("/syncUser/account/toVoid") |
| | | public Result userAccount(String userId) |
| | | { |
| | | return syncUserService.userAccount(userId); |
| | | } |
| | | |
| | | /** 根据客户ID进行积分增减操作 - 顾客信息*/ |
| | | @PostMapping("/modifyIntegral/toVoid") |
| | | public Result modifyIntegral(@RequestBody JSONObject jsonObject) |
| | | { |
| | | if(!jsonObject.has("userid")){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"用户id不能为空"); |
| | | } |
| | | if(!jsonObject.has("amount")){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"操作金额不能为空"); |
| | | } |
| | | if(!jsonObject.has("externalOrderNo")){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"交易单号"); |
| | | } |
| | | return syncUserService.modifyIntegral(jsonObject); |
| | | /* return Result.success("同步用户账户余额成功");*/ |
| | | |
| | | } |
| | | /** 根据客户ID进行增值金增减操作 - 顾客信息*/ |
| | | @PostMapping("/ModifyVat/toVoid") |
| | | public Result ModifyVat(@RequestBody JSONObject jsonObject) |
| | | { |
| | | |
| | | if(!jsonObject.has("userid")){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"用户id不能为空"); |
| | | } |
| | | if(!jsonObject.has("amount")){ |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"操作金额不能为空"); |
| | | } |
| | | return syncUserService.ModifyVat(jsonObject); |
| | | |
| | | } |
| | | |
| | | /** 获取前后对比照数据 - 顾客信息*/ |
| | | @RequestMapping("/photoCompares/byCiq/toVoid") |
| | | public Result photoComparesByCiq(String ciq) throws Exception { |
| | | User user = syncUserService.selectOneByCiq(ciq); |
| | | if(user==null){ |
| | | throw new ParamException("用户不存在"); |
| | | } |
| | | return photoCompares(user.getId()); |
| | | |
| | | } |
| | | |
| | | |
| | | /** 获取前后对比照数据 - 顾客信息*/ |
| | | @RequestMapping("/photoCompares/toVoid") |
| | | public Result photoCompares(String userId) throws Exception { |
| | | logger.info("同步用户:{}对比照片", userId); |
| | | if (!StringUtils.isEmpty(userId)) { |
| | | User user = syncUserService.selectOneByKey(userId); |
| | | if (user == null) { |
| | | throw new ParamException("用户不存在"); |
| | | } |
| | | if (user.getApiId() == null) { |
| | | throw new ParamException("当前用户还未同步his用户"); |
| | | } |
| | | SyncUserPictureRcord syncUserPictureRcord = new SyncUserPictureRcord(); |
| | | syncUserPictureRcord.setRequestParameters(userId); |
| | | syncUserPictureRcord.setStartTime(new Date()); |
| | | syncUserPictureRcord.setType(1); |
| | | syncUserPictureRcord.setSuccessNumber(0); |
| | | syncUserPictureRcord.setFailNumber(0); |
| | | try { |
| | | this.HandleUserPhotoCompares(user.getId(), user.getApiId(), syncUserPictureRcord); |
| | | } catch (Exception e) { |
| | | logger.error("同步用户:{},对比照失败", userId, e); |
| | | } |
| | | syncUserPictureRcord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncUserPictureMapper.class, syncUserPictureRcord); |
| | | } else { |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | Integer page = 0;//条数 |
| | | Integer number = 10;//条数 |
| | | List<User> userList; |
| | | //处理同步日志 |
| | | SyncUserPictureRcord syncUserPictureRcord = new SyncUserPictureRcord(); |
| | | syncUserPictureRcord.setRequestParameters(userId); |
| | | syncUserPictureRcord.setStartTime(new Date()); |
| | | syncUserPictureRcord.setType(1); |
| | | syncUserPictureRcord.setSuccessNumber(0); |
| | | syncUserPictureRcord.setFailNumber(0); |
| | | //开5个线程池处理其它页 |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(5); |
| | | do { |
| | | map.put("page", page * number); |
| | | map.put("number", number); |
| | | sqlSentence.setM(map); |
| | | sqlSentence.setSqlSentence("select id,apiId from user where apiId is NOT NULL ORDER BY createTime LIMIT #{m.page},#{m.number} "); |
| | | userList = syncUserService.selectList(sqlSentence); |
| | | logger.info("同步第:{}页对比照用户数量:{}", page, userList.size()); |
| | | try { |
| | | for (int i = 0; i < userList.size(); i++) { |
| | | int count = i; |
| | | String userIds = userList.get(count).getId(); |
| | | String apiId = userList.get(count).getApiId(); |
| | | threadPool.execute(() -> { |
| | | try { |
| | | this.HandleUserPhotoCompares(userIds, apiId, syncUserPictureRcord); |
| | | } catch (Exception e) { |
| | | logger.error(Thread.currentThread().getName() + " 执行第:" + count + "条错误:", e); |
| | | } |
| | | }); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("同步对比照循环执行异常", e); |
| | | } |
| | | page++; |
| | | } while (userList.size() == number); |
| | | threadPool.shutdown(); |
| | | syncUserPictureRcord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncUserPictureMapper.class, syncUserPictureRcord); |
| | | |
| | | } |
| | | return Result.success("同步用户对比照成功"); |
| | | } |
| | | |
| | | public synchronized void HandleUserPhotoCompares(String userId, String hisId, SyncUserPictureRcord syncUserPictureRcord) { |
| | | List<Map> photoCompares = syncUserService.photoCompares(hisId); |
| | | if (photoCompares.size() > 0) { |
| | | // 清理下用户原来的信息 |
| | | syncUserService.cleanUserBeforeRecord(userId); |
| | | // 打印日志 |
| | | logger.info("开始同步用户:{},对比照数量:{}", userId, photoCompares.size()); |
| | | } |
| | | // 处理数据 |
| | | JSONObject jsonObject = null; |
| | | for (Map map : photoCompares) { |
| | | try { |
| | | jsonObject = JSONObject.fromObject(map); |
| | | syncUserService.handlephotoCompares(jsonObject, userId); |
| | | syncUserPictureRcord.setSuccessNumber(syncUserPictureRcord.getSuccessNumber() + 1); |
| | | } catch (Exception e) { |
| | | logger.info("同步对比照失败"); |
| | | syncUserPictureRcord.setFailNumber(syncUserPictureRcord.getFailNumber() + 1); |
| | | } |
| | | } |
| | | logger.info("结束同步用户:{},对比照数量:{}", userId, photoCompares.size()); |
| | | } |
| | | |
| | | |
| | | /** 同步商汤用户 - 顾客信息*/ |
| | | @RequestMapping("/shangTangUser/toVoid") |
| | | public Object shangTangUser(@RequestBody JSONObject jsonObject){ |
| | | syncUserService.shangTangUser(jsonObject); |
| | | return Result.success("同步商汤用户成功"); |
| | | } |
| | | |
| | | |
| | | /** 同步商汤用户 - 顾客信息*/ |
| | | @RequestMapping("/releaseOnTheHighSeas/toVoid") |
| | | public Object releaseOnTheHighSeas(){ |
| | | syncUserService.releaseOnTheHighSeas(); |
| | | return Result.success("同步商汤用户成功"); |
| | | } |
| | | |
| | | /** 主动同步创建顾客到his - 修改用户ciq和会员等级*/ |
| | | @PostMapping("/updateMembership/toVoid") |
| | | public Result updateMembership(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return syncUserService.updateMembership(jsonObject); |
| | | } |
| | | |
| | | /** 用户第一次到访时间,第一次预约时间,第一次消费时间,最后一次到访时间,最后一次预约时间,最后一次消费时间初始化级*/ |
| | | @PostMapping("/update/userConsumptionTime") |
| | | public Result userConsumptionTime(@RequestBody JSONObject jsonObject) |
| | | { |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | |
| | | Integer page=0; |
| | | Integer pageNum=50; |
| | | List<User> userList; |
| | | StringBuffer stringBuffer=new StringBuffer("select * from user where isDel='0'"); |
| | | String id=jsonObject.optString("userId"); |
| | | if(id!=null && !StringUtils.isEmpty(id)){ |
| | | stringBuffer.append(" and id=#{m.id} "); |
| | | map.put("id",id); |
| | | } |
| | | stringBuffer.append(" ORDER BY createTime LIMIT #{m.page},#{m.pageNum} "); |
| | | |
| | | //开5个线程池处理其它页 |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(5); |
| | | try { |
| | | do { |
| | | map.put("page",page*pageNum); |
| | | map.put("pageNum",pageNum); |
| | | sqlSentence.setSqlSentence(stringBuffer.toString()); |
| | | logger.info("sql:{},M:{}",sqlSentence.getSqlSentence(),sqlSentence.getM()); |
| | | userList=syncUserService.selectList(sqlSentence); |
| | | for (User user : userList) { |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | try { |
| | | syncUserService.userConsumptionTime(user); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | page++; |
| | | }while (userList.size()==pageNum); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | threadPool.shutdown(); |
| | | } |
| | | return Result.success("正在初始化"); |
| | | } |
| | | |
| | | @Resource |
| | | private SFileService sFileService; |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | @PostMapping("/update/userTesst") |
| | | public Result userTesst(@RequestBody JSONObject jsonObject) |
| | | { |
| | | MultipartFile file = createFileItem(jsonObject.optString("image")); |
| | | logger.info("图片名称:{}",file.getOriginalFilename()); |
| | | Result result=null; |
| | | try { |
| | | logger.info("开始上传"); |
| | | result = sFileService.upload(file, "phi_appt/synchro_his",systemConfig.getCosBucketName()); |
| | | logger.info("上传成功"); |
| | | }catch (Exception e){ |
| | | logger.info("上传失败"); |
| | | } |
| | | file=null; |
| | | if(!result.checkCode()){ |
| | | logger.error("上传图片失败:"+ com.alibaba.fastjson.JSONObject.toJSONString(result)); |
| | | throw new TipsException("上传图片失败!"); |
| | | } |
| | | com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(com.alibaba.fastjson.JSONObject.toJSONString(result.getData())); |
| | | String fileUrl=""; |
| | | if(object!=null){ |
| | | fileUrl = object.getString("fileUrl"); |
| | | |
| | | } |
| | | return Result.success("正在初始化"); |
| | | } |
| | | private MultipartFile createFileItem(String url) { |
| | | |
| | | FileItem item = null; |
| | | try { |
| | | HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(); |
| | | conn.setReadTimeout(30000); |
| | | conn.setConnectTimeout(30000); |
| | | //设置应用程序要从网络连接读取数据 |
| | | conn.setDoInput(true); |
| | | conn.setRequestMethod("GET"); |
| | | if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { |
| | | InputStream is = conn.getInputStream(); |
| | | // 创建工厂对象 |
| | | FileItemFactory factory = new DiskFileItemFactory(16, null); |
| | | // 通过工厂对象创建 item 对象 |
| | | item = factory.createItem("60214fade88a45808197b3d8f8fa76bd.jpg", ContentType.IMAGE_JPEG.toString(), false, "60214fade88a45808197b3d8f8fa76bd.jpg"); |
| | | OutputStream os = item.getOutputStream(); |
| | | int bytesRead = 0; |
| | | byte[] buffer = new byte[8192]; |
| | | while ((bytesRead = is.read(buffer, 0, 8192)) != -1) { |
| | | os.write(buffer, 0, bytesRead); |
| | | } |
| | | os.close(); |
| | | is.close(); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("文件下载失败", e); |
| | | } |
| | | |
| | | return new CommonsMultipartFile(item); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/recognition/quality") |
| | | public Result recognitionQuality(@RequestParam("file") MultipartFile file) throws IOException { |
| | | return syncUserService.recognitionQuality(file); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.his.service.SyncWarehouseService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步仓库 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/warehouse/toVoid") |
| | | public class SyncWarehouseController{ |
| | | |
| | | @Resource |
| | | SyncWarehouseService syncWarehouseService; |
| | | |
| | | /** |
| | | * 同步所有仓库信息 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/information") |
| | | public Result information() |
| | | { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,10,0,0); |
| | | syncWarehouseService.syncWarehouse(syncBasicInformationRecord); |
| | | return Result.success("初始化同步所有仓库信息成功"); |
| | | } |
| | | /** |
| | | * 同步所有仓库所有商品信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/inventory/stockItem") |
| | | public Result inventoryGoods(@RequestBody JSONObject jsonObject) |
| | | { |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,11,0,0); |
| | | syncWarehouseService.inventoryGoods(jsonObject,syncBasicInformationRecord); |
| | | return Result.success("初始化同步所有仓库商品信息成功"); |
| | | } |
| | | |
| | | /** |
| | | * 获取授权机构下出/入库类别 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/inventory/changeType") |
| | | public Result changeType() |
| | | { |
| | | syncWarehouseService.changeType(); |
| | | return Result.success("初始化同步获取授权机构下出/入库类别信息成功"); |
| | | } |
| | | /** |
| | | * 物料入库记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/inventory/entry/record") |
| | | public Result inventoryEntryRecord(@RequestBody JSONObject jsonObject) |
| | | { |
| | | syncWarehouseService.inventoryEntryRecord(jsonObject); |
| | | return Result.success("获取物料入库记录成功"); |
| | | } |
| | | /** |
| | | * 物料出库记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/inventory/out/record") |
| | | public Result inventoryOutRecord(@RequestBody JSONObject jsonObject) |
| | | { |
| | | syncWarehouseService.inventoryOutRecord(jsonObject); |
| | | return Result.success("获取物料出库记录成功"); |
| | | } |
| | | /** |
| | | * 物料出入库操作 |
| | | * @param shopWarehouseChangeId 出库或入库单ID |
| | | * @return |
| | | */ |
| | | @RequestMapping("/inventory/inOut") |
| | | public Result inventoryInOut(String shopWarehouseChangeId) |
| | | { |
| | | if(StringUtils.isEmpty(shopWarehouseChangeId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要同步的订单"); |
| | | } |
| | | return syncWarehouseService.inventoryInOut(shopWarehouseChangeId); |
| | | |
| | | } |
| | | /** |
| | | * 作废物料出入库操作 |
| | | * @param shopWarehouseChangeId 出库或入库单ID |
| | | * @return |
| | | */ |
| | | @RequestMapping("/inventory/nullifyInOut") |
| | | public Result nullifyInOut(String shopWarehouseChangeId) |
| | | { |
| | | if(StringUtils.isEmpty(shopWarehouseChangeId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要同步的订单"); |
| | | } |
| | | return syncWarehouseService.nullifyInOut(shopWarehouseChangeId); |
| | | } |
| | | /** |
| | | * 物料调拨操作记录 |
| | | * @return |
| | | */ |
| | | @PostMapping("/inventory/transfer/record") |
| | | public Result transferRecord(@RequestBody JSONObject jsonObject) |
| | | { |
| | | syncWarehouseService.transferRecord(jsonObject); |
| | | return Result.success("物料出入库操作成功"); |
| | | } |
| | | /** |
| | | * 物料调拨操作 |
| | | * @param shopWarehouseAllotId 仓库调拨单ID |
| | | * @return |
| | | */ |
| | | @RequestMapping("/inventory/transfer") |
| | | public Result transfer(String shopWarehouseAllotId) |
| | | { |
| | | if(StringUtils.isEmpty(shopWarehouseAllotId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要同步的订单"); |
| | | } |
| | | return syncWarehouseService.transfer(shopWarehouseAllotId); |
| | | |
| | | } |
| | | /** |
| | | * 作废物料调拨操作 |
| | | * @param shopWarehouseAllotId 仓库调拨单ID |
| | | * @return |
| | | */ |
| | | @RequestMapping("/inventory/nullifyTransfer") |
| | | public Result nullifyTransfer(String shopWarehouseAllotId) |
| | | { |
| | | if(StringUtils.isEmpty(shopWarehouseAllotId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择需要同步的订单"); |
| | | } |
| | | return syncWarehouseService.shopWarehouseAllotId(shopWarehouseAllotId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.his; |
| | | |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.phip.model.SyncExecutionRecord; |
| | | import com.hx.phip.his.service.SyncExecutionRecordService; |
| | | import com.hx.phip.his.service.SyncUserService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user/consumption/data/toVoid") |
| | | public class UserConsumptionDataController { |
| | | private static Logger logger = LoggerFactory.getLogger(UserConsumptionDataController.class); |
| | | @Resource |
| | | private SyncUserService syncUserService; |
| | | |
| | | @Resource |
| | | private SyncOrderController syncOrderController; |
| | | |
| | | @Resource |
| | | private SyncExecutionRecordService syncExecutionRecordService; |
| | | |
| | | @PostMapping("/list") |
| | | public Result userList(String userId){ |
| | | logger.info("艾芯荟请求同步用户:{}基本信息,资金,订单,划扣",userId); |
| | | if(StringUtils.isEmpty(userId)) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"请选择客户"); |
| | | } |
| | | |
| | | User u = syncUserService.selectOneByKey(userId); |
| | | if(u == null) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"找不到客户"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(u.getApiId())) |
| | | { |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"在his上找不到该客户"); |
| | | |
| | | } |
| | | |
| | | //同步用户 |
| | | syncUserService.syncUserById(u.getApiId()); |
| | | |
| | | //同步用户资金 |
| | | syncUserService.syncUserAccount(u.getId()); |
| | | |
| | | //同步订单 |
| | | JSONObject userJson=new JSONObject(); |
| | | userJson.put("customerId",u.getApiId()); |
| | | syncOrderController.syncSalesOrder(userJson); |
| | | //同步可划扣 |
| | | SyncExecutionRecord syncExecutionRecord=new SyncExecutionRecord(userJson.toString(),null,1,2,0,0,new Date()); |
| | | syncExecutionRecordService.executable(userJson,syncExecutionRecord); |
| | | |
| | | //同步已划扣 |
| | | SyncExecutionRecord syncExecutionRecord1=new SyncExecutionRecord(userJson.toString(),null,1,3,0,0,new Date()); |
| | | syncExecutionRecordService.obtain(userJson,syncExecutionRecord1); |
| | | |
| | | //处理可划扣his新增一个,phis新增一个出现两个的问题 |
| | | syncExecutionRecordService.deleteExecutable(u.getId()); |
| | | |
| | | |
| | | return Result.success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.koap; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | |
| | | import com.hx.phip.his.service.KoapSyncBasicInformationService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步KOAP科室等一些列初始数据 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/koap/basic") |
| | | public class BasicInformationController { |
| | | |
| | | @Resource |
| | | private KoapSyncBasicInformationService koapSyncDepartmentService; |
| | | /** |
| | | * 获取科室信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/department/list") |
| | | public Result departmentList (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncDepartmentService.departmentList(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取康博嘉科室失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取医生信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/doctor/list") |
| | | public Result doctorList (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncDepartmentService.doctorList(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取康博嘉医生失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取排班信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/doctor/scheduling/list") |
| | | public Result appointmentList (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncDepartmentService.appointmentList(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取康博嘉医生失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取诊所时段信息 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/visit/interval/list") |
| | | public Result intervalList () |
| | | { |
| | | try { |
| | | return koapSyncDepartmentService.intervalList(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取康博嘉医生失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.koap; |
| | | |
| | | import com.hx.phip.his.service.KoapSyncBillReportService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/koap/my") |
| | | public class BillReportController { |
| | | |
| | | @Resource |
| | | private KoapSyncBillReportService koapSyncBillReportService; |
| | | /** |
| | | * 获取KBJ获取患者缴费账单信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/fee/receipt/list") |
| | | public Result feeReceiptList (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncBillReportService.feeReceiptList(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取KBJ获取患者缴费账单信息,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取患者检验记录信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/lab/inspection/record") |
| | | public Result inspectionRecord (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncBillReportService.inspectionRecord(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取患者检验记录信息,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取患者检验报告信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/lab/inspection/report") |
| | | public Result inspectionReport (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncBillReportService.inspectionReport(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取患者检验报告信息,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取患者检查记录信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/exam/inspection/record") |
| | | public Result examInspectionRecord (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncBillReportService.examInspectionRecord(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取患者检查记录信息,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取患者检查报告信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/exam/inspection/report") |
| | | public Result examInspectionReport (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncBillReportService.examInspectionReport(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取患者检查报告信息,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.koap; |
| | | |
| | | |
| | | import com.hx.phip.his.service.KoapSyncFeeService; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.DateUtil; |
| | | import net.sf.json.JSONObject; |
| | | import org.joda.time.DateTime; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 同步KOAP缴费信息 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/koap/fee") |
| | | public class SyncKoapFeeController { |
| | | |
| | | @Resource |
| | | private KoapSyncFeeService koapSyncFeeService; |
| | | |
| | | /** |
| | | * 获取患者待缴费信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/charge/unpaid") |
| | | public Result chargeUnpaid (@RequestBody JSONObject jsonObject) |
| | | { |
| | | return koapSyncFeeService.chargeUnpaid(jsonObject); |
| | | // return Result.success("获取患者信息信息成功"); |
| | | } |
| | | |
| | | /** |
| | | * 根据就诊编码重新获取患者待缴费信息到本地数据库 |
| | | * @return |
| | | */ |
| | | @PostMapping("/charge/unpaid/byVisitNo") |
| | | public Result chargeUnpaidByVisitNo (@RequestBody JSONObject jsonObject) |
| | | { |
| | | return koapSyncFeeService.chargeUnpaidByVisitNo(jsonObject); |
| | | // return Result.success("获取患者信息信息成功"); |
| | | } |
| | | /** |
| | | * 创建患者缴费账单信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/receipt/pay") |
| | | public Result receiptPay (@RequestBody JSONObject jsonObject) |
| | | { |
| | | return koapSyncFeeService.receiptPay(jsonObject); |
| | | // return Result.success("获取患者信息信息成功"); |
| | | } |
| | | |
| | | /** |
| | | * 创建患者退费账单信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/receipt/refund") |
| | | public Result receiptRefund (@RequestBody JSONObject jsonObject) |
| | | { |
| | | return koapSyncFeeService.receiptRefund(jsonObject); |
| | | // return Result.success("获取患者信息信息成功"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.koap; |
| | | |
| | | |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.phip.his.service.KoapSyncUserService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 同步KOAP用户信息 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sync/koap") |
| | | public class SyncKoapUserController { |
| | | |
| | | @Resource |
| | | private KoapSyncUserService koapSyncUserService; |
| | | |
| | | /** |
| | | * 获取患者信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/patient/list") |
| | | public Result basePatientList (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | koapSyncUserService.basePatientList(jsonObject); |
| | | return Result.success("初始化同步KOAP患者信息信息成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步KOAP患者信息信息失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取患者信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/patient/getList") |
| | | public Result getBasePatientList (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncUserService.getBasePatientList(jsonObject); |
| | | // return Result.success("初始化同步KOAP患者信息信息成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("获取KOAP患者信息信息失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建患者信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/patient/create") |
| | | public Result basePatientCreate (@RequestBody JSONObject jsonObject) |
| | | { |
| | | return koapSyncUserService.basePatientCreate(jsonObject); |
| | | } |
| | | /** |
| | | * 修改患者信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/patient/modify") |
| | | public Result basePatientModify (@RequestBody JSONObject jsonObject) |
| | | { |
| | | return koapSyncUserService.basePatientModify(jsonObject); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 预约用户同步到康博嘉 |
| | | * @return |
| | | */ |
| | | @PostMapping("/user/phisToKbj") |
| | | public Result phisToKbj (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Boolean status=true; |
| | | do { |
| | | List<User> userList = koapSyncUserService.phisToKbjList(); |
| | | if(userList!=null && userList.size()>0){ |
| | | for(int i = 0;i < userList.size();i ++) |
| | | { |
| | | koapSyncUserService.phisToKbj(userList.get(i)); |
| | | } |
| | | }else { |
| | | status=false; |
| | | } |
| | | try { |
| | | Thread.sleep(10000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | }while (status); |
| | | |
| | | |
| | | } |
| | | }).start(); |
| | | return Result.success("正在初始化phis用户同步到康博嘉"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("初始化同步KOAP患者信息信息失败,失败异常为:"+e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.koap; |
| | | |
| | | import com.hx.phip.his.service.KoapSyncAppointmentService; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author 同步kaop预约数据 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/koap/appointment") |
| | | public class appointmentController { |
| | | |
| | | @Resource |
| | | private KoapSyncAppointmentService koapSyncAppointmentService; |
| | | /** |
| | | * 创建预约 |
| | | * @return |
| | | */ |
| | | @PostMapping("/create") |
| | | public Result create (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncAppointmentService.create(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("创建预约,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 修改预约 |
| | | * @return |
| | | */ |
| | | @PostMapping("/modify") |
| | | public Result modify (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncAppointmentService.modify(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("修改预约,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 作废预约 |
| | | * @return |
| | | */ |
| | | @PostMapping("/cancel") |
| | | public Result cancel (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncAppointmentService.cancel(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("作废预约,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询预约 |
| | | * @return |
| | | */ |
| | | @PostMapping("/list") |
| | | public Result list (@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | return koapSyncAppointmentService.list(jsonObject); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return Result.success("创建预约,失败异常为:"+e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.meituan; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.phiappt.model.meituan.MeituanCoupons; |
| | | import com.hx.phip.his.service.meituan.MeituanCouponsService; |
| | | import com.hx.resultTool.Result; |
| | | import com.platform.exception.PlatTipsException; |
| | | import com.platform.resultTool.PlatformCode; |
| | | import com.platform.resultTool.PlatformResult; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 美团优惠卷 |
| | | * @USER: 张旭 |
| | | * @DATE: 2022/07/27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/meituan/coupons") |
| | | public class MeituanCouponsController { |
| | | |
| | | @Resource |
| | | private MeituanCouponsService meituanCouponsService; |
| | | |
| | | |
| | | /** |
| | | * 新增待验证优惠卷 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/check",method = RequestMethod.POST) |
| | | public Result check(@RequestBody JSONObject jsonObject) { |
| | | if(jsonObject.get("serialNumber")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"优惠卷编码不能为空"); |
| | | } |
| | | if(jsonObject.get("shopId")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"优惠卷对应的门店不能为空"); |
| | | } |
| | | if(jsonObject.get("operatorId")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"操作人不能为空"); |
| | | } |
| | | MeituanCoupons meituanCoupons= JSON.toJavaObject(jsonObject,MeituanCoupons.class); |
| | | int count= meituanCouponsService.insert(meituanCoupons); |
| | | if(count!=1){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_SYSTEM,"新增失败"); |
| | | } |
| | | return handlemeituanCoupons(meituanCoupons.getId(),1); |
| | | } |
| | | |
| | | public Result handlemeituanCoupons(String id,int count){ |
| | | MeituanCoupons meituanCoupons= meituanCouponsService.selectOneByKey(id); |
| | | if(meituanCoupons.getStatus().equals(MeituanCoupons.STATUS_FAIL)){ |
| | | return Result.failure(PlatformCode.ERROR_TIPS,meituanCoupons.getMessage()); |
| | | }else if(meituanCoupons.getStatus().equals(MeituanCoupons.STATUS_SUCCESS)){ |
| | | return Result.success(meituanCoupons.getMessage()); |
| | | }else { |
| | | try { |
| | | Thread.sleep(10000);//等待10秒,等前端那边验卷完成 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | count++; |
| | | if(count>6){ |
| | | return Result.failure(PlatformCode.ERROR_TIPS,"校验失败,请稍后继续"); |
| | | } |
| | | return handlemeituanCoupons(id,count); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取所有待验证的优惠卷 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getCoupons",method = RequestMethod.GET) |
| | | public Result getCoupons() { |
| | | return meituanCouponsService.getCoupons(); |
| | | } |
| | | |
| | | /** |
| | | * 修改待验证的优惠卷状态 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/updateCoupons",method = RequestMethod.POST) |
| | | public Result updateCoupons(@RequestBody JSONObject jsonObject) { |
| | | if(jsonObject.get("id")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"id不能为空"); |
| | | } |
| | | if(jsonObject.get("status")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"验卷状态不能为空"); |
| | | } |
| | | return meituanCouponsService.updateCoupons(jsonObject); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.meituan; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.phip.his.service.meituan.MeituanPrepaidOrderService; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 美团预付订单 |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/meituan/prepaid/order") |
| | | public class MeituanPrepaidOrderController { |
| | | |
| | | @Resource |
| | | private MeituanPrepaidOrderService meituanPrepaidOrderService; |
| | | |
| | | /** |
| | | * 同步美团订单 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/orderList",method = RequestMethod.POST) |
| | | public Result orderList(@RequestBody JSONObject json) { |
| | | JSONArray jsonArray=json.getJSONArray("list"); |
| | | if(jsonArray!=null || jsonArray.size()>0){ |
| | | JSONObject jsonObject; |
| | | for (Object o : jsonArray) { |
| | | jsonObject=(JSONObject) JSONObject.toJSON(o); |
| | | meituanPrepaidOrderService.handleOrderList(jsonObject); |
| | | } |
| | | } |
| | | return Result.success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.meituan; |
| | | |
| | | import com.hx.phip.his.service.meituan.MeituanTaskService; |
| | | import com.hx.resultTool.Result; |
| | | import com.platform.resultTool.PlatformCode; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/meituan/task") |
| | | public class MeituanTaskController { |
| | | |
| | | @Resource |
| | | private MeituanTaskService meituanTaskService; |
| | | |
| | | |
| | | /** |
| | | * 新增待处理的工作任务 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/addTask",method = RequestMethod.POST) |
| | | public Result addTask(@RequestBody JSONObject jsonObject) { |
| | | if(jsonObject.get("type")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"任务类型不能为空"); |
| | | } |
| | | if(jsonObject.get("queryStartTime")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"查询开始时间不能为空"); |
| | | } |
| | | if(jsonObject.get("queryEndTime")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"查询结束时间不能为空"); |
| | | } |
| | | |
| | | return meituanTaskService.addTask(jsonObject); |
| | | } |
| | | /** |
| | | * 获取所有待处理的工作任务 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/list",method = RequestMethod.GET) |
| | | public Result list() { |
| | | return meituanTaskService.list(); |
| | | } |
| | | |
| | | /** |
| | | * 修改工作任务撞他 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/updateTask",method = RequestMethod.POST) |
| | | public Result updateTask(@RequestBody JSONObject jsonObject) { |
| | | if(jsonObject.get("id")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"任务id不能为空"); |
| | | } |
| | | if(jsonObject.get("status")==null){ |
| | | return Result.failure(PlatformCode.ERROR_PARAMETER_NULL,"任务状态不能为空"); |
| | | } |
| | | return meituanTaskService.updateTask(jsonObject); |
| | | } |
| | | } |
New file |
| | |
| | | /* |
| | | package com.hx.phip.his.controller.mq; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.phip.config.rabbitmq.RabbitMqConfig; |
| | | import com.rabbitmq.client.Channel; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.amqp.core.Message; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping("/demo") |
| | | @Component |
| | | public class DemoController { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(DemoController.class); |
| | | @Resource |
| | | private RabbitTemplate rabbitTemplate; |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 发送队列消息 |
| | | * |
| | | * |
| | | *//* |
| | | |
| | | |
| | | @GetMapping("/test") |
| | | public String test() { |
| | | String messageId = String.valueOf(UUID.randomUUID()); |
| | | String messageData = "test message, hello!"; |
| | | String createTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | JSONObject jsonObject=new JSONObject(); |
| | | |
| | | for (int i = 0; i < 20; i++) { |
| | | jsonObject.put("sum",i); |
| | | jsonObject.put("date",createTime); |
| | | //将消息携带绑定键值:TestDirectRouting 发送到交换机TestDirectExchange |
| | | rabbitTemplate.convertAndSend(RabbitMqConfig.Exchange_TESTDIRECTEXCHANGE, RabbitMqConfig.man, jsonObject.toJSONString()); |
| | | |
| | | } |
| | | |
| | | |
| | | return "ok"; |
| | | |
| | | } |
| | | |
| | | @GetMapping("/test1") |
| | | public String test1() { |
| | | String messageId = String.valueOf(UUID.randomUUID()); |
| | | String messageData = "message: woman is all "; |
| | | String createTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | JSONObject jsonObject=new JSONObject(); |
| | | for (int i = 0; i < 20; i++) { |
| | | jsonObject.put("sum",i); |
| | | jsonObject.put("date",createTime); |
| | | //将消息携带绑定键值:TestDirectRouting 发送到交换机TestDirectExchange |
| | | rabbitTemplate.convertAndSend(RabbitMqConfig.Exchange_TESTDIRECTEXCHANGE, RabbitMqConfig.woman, jsonObject.toJSONString()); |
| | | |
| | | } |
| | | return "ok"; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 消费信息 |
| | | * |
| | | * @param message |
| | | * @throws Exception |
| | | *//* |
| | | |
| | | |
| | | |
| | | @RabbitListener(queues = {"topic.man"}) |
| | | public void handleMessage(Message message, Channel channel) throws Exception { |
| | | // 处理消息 |
| | | try { |
| | | //告诉服务器收到这条消息 已经被我消费了 可以在队列删掉 这样以后就不会再发了 |
| | | // 否则消息服务器以为这条消息没处理掉 后续还会在发 |
| | | |
| | | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
| | | System.out.println("消费队列一:"+new String(message.getBody())); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | channel.basicNack(message.getMessageProperties().getDeliveryTag(), false,false); |
| | | //丢弃这条消息 |
| | | // System.out.println("receiver fail"); |
| | | } |
| | | |
| | | } |
| | | @RabbitListener(queues = {"topic.woman"}) |
| | | public void handleMessage2(Message message, Channel channel) throws Exception { |
| | | // 处理消息 |
| | | try { |
| | | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
| | | System.out.println("消费队列二:"+new String(message.getBody())); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | channel.basicNack(message.getMessageProperties().getDeliveryTag(), false,false); |
| | | } |
| | | } |
| | | @RabbitListener(queues = {"topic.woman"}) |
| | | public void handleMessage3(Message message, Channel channel) throws Exception { |
| | | // 处理消息 |
| | | try { |
| | | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
| | | System.out.println("消费队列三:"+new String(message.getBody())); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | channel.basicNack(message.getMessageProperties().getDeliveryTag(), false,false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | */ |
New file |
| | |
| | | package com.hx.phip.his.controller.other; |
| | | |
| | | import com.dtflys.forest.annotation.Get; |
| | | import com.hx.phip.his.service.ArriveVisitService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RestController |
| | | @RequestMapping("/arrive/visit") |
| | | public class ArriveVisitController { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ArriveVisitController.class); |
| | | |
| | | @Resource |
| | | private ArriveVisitService arriveVisitService; |
| | | /** |
| | | * 用户到访信息 |
| | | * @return |
| | | */ |
| | | @PostMapping("/information") |
| | | public Result information(@RequestBody JSONObject jsonObject) { |
| | | logger.info("商汤到访回调参数:{}",jsonObject.toString()); |
| | | // 不管是操作成功还是失败都需要返回200 商汤才会继续推送过来 |
| | | try { |
| | | arriveVisitService.information(jsonObject); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | |
| | | } |
| | | /** |
| | | * 手机号解密 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/getDecryptMobile") |
| | | public Result getDecryptMobile(String mobile) |
| | | { |
| | | // 不管是操作成功还是失败都需要返回200 商汤才会继续推送过来 |
| | | try { |
| | | return Result.success(arriveVisitService.getDecryptMobile(mobile)); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.other; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.phip.his.service.HeartbeatReceiveService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RestController |
| | | @RequestMapping("/heartbeat/receive/toVoid") |
| | | public class HeartbeatReceiveController { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(HeartbeatReceiveController.class); |
| | | |
| | | @Resource |
| | | private HeartbeatReceiveService heartbeatReceiveService; |
| | | |
| | | |
| | | /** |
| | | * 增加订阅接口 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @PostMapping("/addHeartbeatReceive") |
| | | public Result addHeartbeatReceive(@RequestBody JSONObject jsonObject) |
| | | { |
| | | return heartbeatReceiveService.addHeartbeatReceive(jsonObject); |
| | | } |
| | | |
| | | /** |
| | | * 用户新增,修改,作废心跳 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @PostMapping("/user") |
| | | public Result user(@RequestBody JSONArray jsonArray) |
| | | { |
| | | // logger.info("用户心跳数据"+jsonArray); |
| | | // 不管是操作成功还是失败都需要返回200 领健才会继续推送过来 |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | heartbeatReceiveService.user(jsonArray); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 项目,卡项 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @PostMapping("/project") |
| | | public Result project(@RequestBody JSONArray jsonArray) |
| | | { |
| | | // logger.info("用户心跳数据"+jsonArray); |
| | | // 不管是操作成功还是失败都需要返回200 领健才会继续推送过来 |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | heartbeatReceiveService.project(jsonArray); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 商品新增心跳 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @PostMapping("/commodity") |
| | | public Result commodity(@RequestBody JSONArray jsonArray) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | heartbeatReceiveService.commodity(jsonArray); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 员工心跳 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @PostMapping("/employee") |
| | | public Result employee(@RequestBody JSONArray jsonArray) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | heartbeatReceiveService.employee(jsonArray); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 订单心跳 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @PostMapping("/order") |
| | | public Result order(@RequestBody JSONArray jsonArray) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | heartbeatReceiveService.order(jsonArray); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 仓库变动心跳 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @PostMapping("/stock-transfer") |
| | | public Result stockTransfer(@RequestBody JSONArray jsonArray) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | heartbeatReceiveService.stockTransfer(jsonArray); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.other; |
| | | |
| | | import com.hx.phip.his.service.KBJHeartbeatReceiveService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/kbj/heartbeat/receive") |
| | | public class KBJHeartbeatReceiveController { |
| | | |
| | | |
| | | @Resource |
| | | KBJHeartbeatReceiveService kbjHeartbeatReceiveService; |
| | | |
| | | /** |
| | | * 用户新增心跳 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @PostMapping("/patientcreate") |
| | | public Object patientcreate(@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | kbjHeartbeatReceiveService.patientcreate(jsonObject); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 用户修改心跳 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @PostMapping("/patientmodify") |
| | | public Object patientmodify(@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | kbjHeartbeatReceiveService.patientmodify(jsonObject); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 用户作废心跳 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @PostMapping("/patientdefunct") |
| | | public Object patientdefunct(@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | kbjHeartbeatReceiveService.patientdefunct(jsonObject); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 推送患者就诊状态 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @PostMapping("/visitstatusmodify") |
| | | public Object visitstatusmodify(@RequestBody JSONObject jsonObject) |
| | | { |
| | | try { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | kbjHeartbeatReceiveService.visitstatusmodify(jsonObject); |
| | | } |
| | | }).start(); |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | }catch (Exception e){ |
| | | return Result.failure(ResponseCode.ERROR_TIPS,"success"); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.controller.weixin; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.resultTool.Result; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/weixin") |
| | | public class WeiXinController { |
| | | |
| | | /** |
| | | * 新增待验证优惠卷 |
| | | * @param jsonObject |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/user/unionID",method = RequestMethod.POST) |
| | | public Result getUserUnionID (@RequestBody JSONObject jsonObject) { |
| | | |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.interceptor; |
| | | |
| | | import com.hx.phip.his.config.CustomParameter; |
| | | import com.hx.redis.RedisUtil; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import com.platform.entity.ThirtApplication; |
| | | import com.platform.resultTool.PlatformCode; |
| | | import com.platform.resultTool.PlatformResult; |
| | | import com.platform.verification.ApplicationTool; |
| | | import com.platform.verification.VerificationTool; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 前端设计一拦截器 |
| | | * 拦截请求的校验 |
| | | * @Author: ChenJiaHe |
| | | * @Date: 2021-10-20 |
| | | */ |
| | | /*@Aspect |
| | | @Component*/ |
| | | public class UserInterceptor { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UserInterceptor.class.getName()); |
| | | |
| | | @Resource |
| | | private CustomParameter rsaParameter; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | /**有效时间(秒)*/ |
| | | private static final long ttlMillis = 42300; |
| | | |
| | | /**设置拦截的位置 |
| | | * 拦截要校验的包 |
| | | */ |
| | | @Pointcut("within(com.hx.phip.his.controller.his.*))") |
| | | public void checkSign() { |
| | | } |
| | | |
| | | /* *设置拦截的位置的操作 |
| | | * @param joinPoint |
| | | * @return |
| | | * @throws Throwable*/ |
| | | public HttpServletRequest getRequest() { |
| | | //获取参数对象 |
| | | ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
| | | return attributes.getRequest(); |
| | | } |
| | | |
| | | @Around("checkSign()") |
| | | public Object doBefore(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | //获取签名 |
| | | HttpServletRequest request = getRequest(); |
| | | /*RequestAttributes ra = RequestContextHolder.getRequestAttributes(); |
| | | ServletRequestAttributes sra = (ServletRequestAttributes) ra; |
| | | HttpServletRequest request = sra.getRequest(); |
| | | Map<String, String> header = HttpServletRequestUtil.getHeader(request);*/ |
| | | String sign = request.getHeader("sign"); |
| | | String appId = request.getHeader("appId"); |
| | | if(StringUtils.isEmpty(appId)){ |
| | | appId = request.getHeader("appid"); |
| | | } |
| | | ThirtApplication thirtApplication = ApplicationTool.jsonToEntity(appId,redisUtil); |
| | | //校验 |
| | | PlatformResult platformResult = VerificationTool.verification(appId,sign,thirtApplication,request); |
| | | if(!PlatformCode.SUCCESS.equals(platformResult.getCode())){ |
| | | // return platformResult; |
| | | return Result.failure(ResponseCode.ERROR_SIGN, "签名错误!"); |
| | | } |
| | | |
| | | return joinPoint.proceed(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface ArriveVisitService { |
| | | |
| | | void information(JSONObject jsonObject); |
| | | |
| | | String getDecryptMobile(String mobile); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface CreateTimeNoService { |
| | | String getOrderNo(String key, int length, String format); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phiappt.model.Employee; |
| | | import com.hx.phiappt.model.EmployeeRole; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | public interface EmployeeService { |
| | | |
| | | int selectCount(SqlSentence sqlSentence); |
| | | |
| | | void insert(Employee employee); |
| | | |
| | | List<Employee> selectList(SqlSentence sqlSentence); |
| | | |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | |
| | | Employee selectOne(SqlSentence sqlSentence); |
| | | |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | |
| | | Employee selectOneByKey(Object object); |
| | | |
| | | Employee selectOneByKeyBlob(Object object); |
| | | |
| | | void updateAll(Employee employee); |
| | | |
| | | void updateWhere(SqlSentence sqlSentence); |
| | | |
| | | void deleteOne(String delId); |
| | | |
| | | Employee selectByApiId(String apiId); |
| | | |
| | | void add(Employee employee, EmployeeRole employeeRole); |
| | | |
| | | void add(Employee employee, List<EmployeeRole> roleList); |
| | | |
| | | void edit(Employee employee, EmployeeRole employeeRole); |
| | | |
| | | void edit(Employee employee, List<EmployeeRole> roleList, Set<String> delSet); |
| | | |
| | | void editUpdate(Employee employee, List<EmployeeRole> roleList); |
| | | |
| | | /** 批量增加 */ |
| | | void batchAdd(Map<Employee, EmployeeRole> map); |
| | | |
| | | |
| | | /** 更新其他员工 */ |
| | | void updateEmployee(Employee employee, List<EmployeeRole> roleList); |
| | | |
| | | /** 查询员工 By id and role */ |
| | | Employee selectOneByIdAndRole(String id, String roleUniqueStr); |
| | | |
| | | /** 查询员工 By name and role */ |
| | | Employee selectOneByNameAndRole(String name, String roleUniqueStr); |
| | | |
| | | /** 查询员工 和 角色标识 By id */ |
| | | Employee selectOneAndRoleStrById(String id); |
| | | |
| | | /** 查询员工 和 角色标识 By userId */ |
| | | Employee selectOneAndRoleStrByUserId(String userId); |
| | | |
| | | /** 查询员工和角色list By id */ |
| | | Employee selectOneRoleListById(String id); |
| | | |
| | | /** 查询员工和角色list By userId */ |
| | | Employee selectOneRoleListByUserId(String userId); |
| | | |
| | | /** 查询员工和角色list By employeeNo */ |
| | | Employee selectOneRoleListByEmployeeNo(String employeeNo); |
| | | |
| | | /** 更新员工角色id */ |
| | | void updateRoleIdById(String id, String roleId); |
| | | |
| | | /** 查询员工apiId */ |
| | | String selectApiIdById(String id); |
| | | |
| | | |
| | | void insertOpenId(String openId, String unionId, Employee employee, SystemConfig systemConfig); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface ErpSyncGoodsService { |
| | | |
| | | void productAll(JSONObject jsonObject); |
| | | |
| | | void productInventoryAll(); |
| | | |
| | | Result updateStockBatch(JSONObject jsonObject); |
| | | Result insertRecord(JSONObject jsonObject); |
| | | |
| | | Result updateStockTable(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface GetTokenService { |
| | | |
| | | String getHisToken(SystemParameterMapper service |
| | | , String appId, String code, String secret |
| | | , String baseUrl); |
| | | |
| | | String getKbjToken(SystemParameterMapper service |
| | | , String appId, String code, String secret |
| | | , String baseUrl); |
| | | |
| | | String getApplicationAccessToken(SystemParameterMapper systemParameterMapper,String corpId, String appSecret); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.resultTool.Result; |
| | | |
| | | public interface HeartbeatReceiveService { |
| | | |
| | | Result addHeartbeatReceive(JSONObject jsonObject); |
| | | |
| | | void user(JSONArray jsonArray); |
| | | |
| | | void project(JSONArray jsonArray); |
| | | |
| | | void commodity(JSONArray jsonArray); |
| | | |
| | | void employee(JSONArray jsonArray); |
| | | |
| | | void order(JSONArray jsonArray); |
| | | |
| | | void stockTransfer(JSONArray jsonArray); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface HisInitializeDataService { |
| | | |
| | | void visitRecord(); |
| | | void hisOrderItem(); |
| | | void hisExecutionRecord(); |
| | | void hisAccountJournal(); |
| | | |
| | | /** |
| | | * 转换到访记录 |
| | | * @return |
| | | */ |
| | | void phisVisitRecord(); |
| | | /** |
| | | * 转换未执行项目记录 |
| | | * @return |
| | | */ |
| | | void phisOrderItem(); |
| | | /** |
| | | * 转换执行项目记录 |
| | | * @return |
| | | */ |
| | | void phisExecutionRecord(); |
| | | /** |
| | | * 转换所有资金变动记录 |
| | | * @return |
| | | */ |
| | | void phisAccountJournal(); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface HisTokenService { |
| | | Result getToken(); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface KBJHeartbeatReceiveService { |
| | | |
| | | void patientcreate(JSONObject jsonObject); |
| | | void patientmodify(JSONObject jsonObject); |
| | | void patientdefunct(JSONObject jsonObject); |
| | | void visitstatusmodify(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface KoapSyncAppointmentService { |
| | | |
| | | Result create(JSONObject jsonObject); |
| | | Result modify(JSONObject jsonObject); |
| | | Result cancel(JSONObject jsonObject); |
| | | Result list(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface KoapSyncBasicInformationService { |
| | | |
| | | Result departmentList(JSONObject jsonObject); |
| | | Result doctorList(JSONObject jsonObject); |
| | | Result appointmentList(JSONObject jsonObject); |
| | | Result intervalList(); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface KoapSyncBillReportService { |
| | | |
| | | Result feeReceiptList(JSONObject jsonObject); |
| | | Result inspectionRecord(JSONObject jsonObject); |
| | | Result inspectionReport(JSONObject jsonObject); |
| | | Result examInspectionRecord(JSONObject jsonObject); |
| | | Result examInspectionReport(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface KoapSyncFeeService { |
| | | |
| | | Result chargeUnpaid(JSONObject jsonObject); |
| | | Result chargeUnpaidByVisitNo(JSONObject jsonObject); |
| | | |
| | | Result receiptPay(JSONObject jsonObject); |
| | | Result receiptRefund(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface KoapSyncUserService { |
| | | |
| | | void basePatientList(JSONObject jsonObject); |
| | | Result getBasePatientList(JSONObject jsonObject); |
| | | |
| | | Result basePatientCreate(JSONObject jsonObject); |
| | | Result basePatientModify(JSONObject jsonObject); |
| | | |
| | | List<User> phisToKbjList(); |
| | | |
| | | |
| | | void phisToKbj(User user); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface OrderTotalService { |
| | | |
| | | List<Map<String, Object>> selectList(SqlSentence sqlSentence); |
| | | |
| | | void initOrderConsultant(String orderId,String hisOrderId,String hisOrderNo); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.phiappt.model.prescription.Prescription; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface PrescriptionService { |
| | | |
| | | int selectCount(SqlSentence sqlSentence); |
| | | |
| | | void insert(Prescription prescription); |
| | | |
| | | List<Prescription> selectList(SqlSentence sqlSentence); |
| | | |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | |
| | | Prescription selectOne(SqlSentence sqlSentence); |
| | | |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | |
| | | Prescription selectOneByKey(Object object); |
| | | |
| | | Prescription selectOneByKeyBlob(Object object); |
| | | |
| | | void updateAll(Prescription prescription); |
| | | |
| | | void updateWhere(SqlSentence sqlSentence); |
| | | |
| | | void deleteOne(String delId); |
| | | |
| | | |
| | | void saveHisPrescription(SyncBasicInformationRecord basicInformationRecord); |
| | | |
| | | /** |
| | | * 处理处方数据 |
| | | * @param |
| | | */ |
| | | void handleHisPrescription(JSONObject fromObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.phiappt.model.prescription.PrescriptionTemplate; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface PrescriptionTemplateService { |
| | | |
| | | int selectCount(SqlSentence sqlSentence); |
| | | |
| | | void insert(PrescriptionTemplate prescriptionTemplate); |
| | | |
| | | List<PrescriptionTemplate> selectList(SqlSentence sqlSentence); |
| | | |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | |
| | | PrescriptionTemplate selectOne(SqlSentence sqlSentence); |
| | | |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | |
| | | PrescriptionTemplate selectOneByKey(Object object); |
| | | |
| | | PrescriptionTemplate selectOneByKeyBlob(Object object); |
| | | |
| | | void updateAll(PrescriptionTemplate prescriptionTemplate); |
| | | |
| | | void updateWhere(SqlSentence sqlSentence); |
| | | |
| | | void deleteOne(String delId); |
| | | |
| | | |
| | | void saveHisPrescriptionTemplate(SyncBasicInformationRecord basicInformationRecord); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.Shop; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface ShopService { |
| | | |
| | | int selectCount(SqlSentence sqlSentence); |
| | | |
| | | void insert(Shop shop); |
| | | |
| | | List<Shop> selectList(SqlSentence sqlSentence); |
| | | |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | |
| | | Shop selectOne(SqlSentence sqlSentence); |
| | | |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | |
| | | Shop selectOneByKey(Object object); |
| | | |
| | | Shop selectOneByKeyBlob(Object object); |
| | | |
| | | void updateAll(Shop shop); |
| | | |
| | | void updateWhere(SqlSentence sqlSentence); |
| | | |
| | | void deleteOne(String delId); |
| | | |
| | | void add(String at, Shop shop); |
| | | |
| | | void edit(String at, Shop shop); |
| | | |
| | | void delete(String at, Shop shop); |
| | | |
| | | Shop selectOneByName(Object object); |
| | | |
| | | Shop selectOneByApiId(Object object); |
| | | |
| | | String getApiId(Object object); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface SyncAppointmentService { |
| | | |
| | | void syncAppointment(JSONObject jsonObject); |
| | | |
| | | Result addAppointment(JSONObject jsonObject); |
| | | Result cancelAppointment(JSONObject jsonObject); |
| | | Result confirmAppointment(JSONObject jsonObject); |
| | | Result partialAppointment(JSONObject jsonObject); |
| | | Result visit(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | |
| | | public interface SyncChannelService { |
| | | |
| | | void SyncChannel(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface SyncConsultationService { |
| | | |
| | | void record(JSONObject jsonObject, SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | void handleRecords(String userId,JSONObject jsonObject, SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | Result establishRecord(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface SyncCouponService { |
| | | |
| | | Result list(JSONObject jsonObject); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import net.sf.json.JSONArray; |
| | | |
| | | public interface SyncDeviceService { |
| | | |
| | | void syncDevice(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | void update(String hisid, JSONArray array); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | |
| | | public interface SyncEmployeeService { |
| | | /** |
| | | * 根据id同步员工 |
| | | */ |
| | | void syncEmployeeById(String id); |
| | | |
| | | /** |
| | | * 同步所有员工 |
| | | */ |
| | | void syncEmployee(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import net.sf.json.JSONObject; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface SyncExecutionRecordNewService { |
| | | |
| | | /** |
| | | * 处理同步可执行记录 |
| | | * @param obj |
| | | */ |
| | | void handleexecutableRecord(JSONObject obj); |
| | | |
| | | /** |
| | | * 处理同步可执行记录,在领建存在,但是在预约不存在的 |
| | | * |
| | | * @param obj |
| | | */ |
| | | void handleexecutableRecordNoExist(JSONObject obj); |
| | | |
| | | /** |
| | | * 处理同步已执行记录 |
| | | * @param obj |
| | | */ |
| | | void handleExecutionRecord(JSONObject obj); |
| | | |
| | | /** |
| | | * 处理同步已执行记录,划扣金额保存 |
| | | * @param obj |
| | | */ |
| | | void handleExecutionRecordAmount(JSONObject obj); |
| | | |
| | | /** |
| | | * 转换同步可执行记录 |
| | | * @param obj |
| | | */ |
| | | void conversionExecutableRecord(JSONObject obj,String hisOrderItem); |
| | | |
| | | /** |
| | | * 转换同步已执行记录 |
| | | * @param obj |
| | | */ |
| | | void conversionExecutionRecord(JSONObject obj); |
| | | |
| | | void initializationExecutionRecord(String id,String deductionSingleId); |
| | | |
| | | void updateDeductionAmount(String id, Integer usedTotal, BigDecimal deductionTotalAmount); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncExecutionRecord; |
| | | import com.hx.resultTool.Result; |
| | | import com.mongodb.BasicDBObject; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface SyncExecutionRecordService { |
| | | |
| | | Result created(String deductionProjectId); |
| | | Result createdHis(JSONObject jsonObject); |
| | | |
| | | |
| | | void obtain(JSONObject jsonObject, SyncExecutionRecord syncExecutionRecord); |
| | | |
| | | void handleExecutionRecordAmount(JSONObject jsonObject); |
| | | |
| | | Result getObtain(JSONObject jsonObject); |
| | | |
| | | |
| | | void executable(JSONObject jsonObject,SyncExecutionRecord syncExecutionRecord); |
| | | Result getExecutable(JSONObject jsonObject); |
| | | |
| | | |
| | | void deleteExecutable(String userId); |
| | | |
| | | |
| | | /** |
| | | * 处理同步可执行记录,在领建存在,但是在预约不存在的 |
| | | * |
| | | */ |
| | | void handleexecutableRecordNoExist(String startTime,String endTime,String customerId,String CIQ); |
| | | |
| | | Result updateUserProjectItem(BasicDBObject order); |
| | | |
| | | Result updateExecutionRecord(BasicDBObject basicDBObject); |
| | | Result deleteExecutionRecord(BasicDBObject basicDBObject); |
| | | |
| | | /** |
| | | * 初始化划扣记录表里面找不到对应的用户项目id |
| | | * @return |
| | | */ |
| | | void initializationExecutionRecord(); |
| | | |
| | | void updateDeductionAmount(); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.resultTool.Result; |
| | | import com.hz.his.dto.material.ConsumablesDto; |
| | | import com.hz.his.dto.material.ConsumablesTypeDto; |
| | | |
| | | public interface SyncGoodsTreeService { |
| | | |
| | | |
| | | /**获取授权机构下的物料(商品)类数据分类(树状结构)*/ |
| | | void categoryGoodsTree(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | /**根据id同步物料*/ |
| | | void catalogProductGoodsById(String id); |
| | | |
| | | /**同步所有物料*/ |
| | | void catalogProductGoods(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | |
| | | /**同步所有供应商数据*/ |
| | | void inventorySupplier(); |
| | | |
| | | |
| | | |
| | | /**指定类型下创建分类新节点 - 各类型通用*/ |
| | | Result addCategory(ConsumablesTypeDto consumablesType); |
| | | /**修改指定ID分类节点 - 各类型通用*/ |
| | | Result updateCategory(ConsumablesTypeDto consumablesType); |
| | | /**删除指定ID分类节点 - 各类型通用*/ |
| | | Result deleteCategory(ConsumablesTypeDto consumablesType); |
| | | /**新建物料类数据*/ |
| | | Result addProduct(ConsumablesDto consumablesDto); |
| | | /**修改物料类数据*/ |
| | | Result updateProduct(ConsumablesDto consumablesDto); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface SyncMedicalRecordsService { |
| | | void saveHisMedicalRecordsTemplate(SyncBasicInformationRecord basicInformationRecord); |
| | | |
| | | void saveHisMedicalRecords(SyncBasicInformationRecord basicInformationRecord); |
| | | |
| | | void handleHisMedicalRecords(JSONObject fromObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface SyncMemberCenterService { |
| | | |
| | | void syncComplaint(); |
| | | |
| | | void returnVisit(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phiappt.model.Project; |
| | | import com.hx.phiappt.model.cardItem.CardItem; |
| | | import com.hx.phiappt.model.consumables.Consumables; |
| | | import com.hx.phiappt.model.promotion.Promotion; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public interface SyncNewOrderService { |
| | | |
| | | Result createOrder(JSONObject order); |
| | | |
| | | /** 修改用户卡包 - 订单摘要信息*/ |
| | | Result updateUserCard(JSONObject order); |
| | | |
| | | Result syncOrderPayment(JSONObject order); |
| | | |
| | | |
| | | Project addProject(String apiId,String name,String specification,String unit); |
| | | |
| | | Consumables addConsumables(String apiId, String name, String specification, String unit); |
| | | |
| | | |
| | | CardItem addCardItem(String apiId, String name, BigDecimal total); |
| | | |
| | | Promotion addPromotion(String apiId, String name, BigDecimal total); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.phip.model.HisAccountJournal; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface SyncNewUserService { |
| | | User handleUser(JSONObject obj,SyncUserService syncUserService); |
| | | |
| | | void addUserMoneyLog(HisAccountJournal hisAccountJournal); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phiappt.model.order.OrdersTotal; |
| | | import com.hx.phip.model.SyncOrderTotal; |
| | | import com.hx.resultTool.Result; |
| | | import com.mongodb.BasicDBObject; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface SyncOrderService { |
| | | |
| | | void syncSalesOrderById(String id); |
| | | |
| | | String getToken(); |
| | | |
| | | JSONObject syncSalesOrder(JSONObject jsonObject, SyncOrderTotal syncOrderTotal); |
| | | |
| | | Result getOrderById(String orderId); |
| | | |
| | | OrdersTotal syncOrderThread(JSONObject obj); |
| | | |
| | | /* Result createOrder(JSONObject order); |
| | | |
| | | Result syncOrderPayment(JSONObject order);*/ |
| | | |
| | | /** 创建储值金与预定金订单 - 订单*/ |
| | | Result prepaidOrder(JSONObject jsonObject); |
| | | |
| | | |
| | | Result syncOrderToVoid(String orderId); |
| | | |
| | | Result syncOrderRefund(JSONObject order); |
| | | |
| | | Result updateOrder(BasicDBObject order); |
| | | |
| | | Result refundOrder(BasicDBObject order); |
| | | Result partialRefund(BasicDBObject order); |
| | | Result paidOrder(BasicDBObject order); |
| | | Result cancelOrder(BasicDBObject order); |
| | | |
| | | |
| | | void update() throws InterruptedException; |
| | | |
| | | Result orderPayRecord(); |
| | | |
| | | List<Map> getOrderRefundRecordList(Date startTime, Date endTime, String id); |
| | | |
| | | void handlerOrderRefundRecord(JSONObject data); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncProjectRecord; |
| | | import com.hx.resultTool.Result; |
| | | import com.mongodb.BasicDBObject; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public interface SyncProjectTreeService { |
| | | |
| | | |
| | | /**同步项目树状结构*/ |
| | | void categoryServiceTree(SyncProjectRecord syncProjectRecord); |
| | | /**新增项目分类*/ |
| | | Result addServiceTree(BasicDBObject jsonObject); |
| | | /**修改项目分类*/ |
| | | Result updateServiceTree(BasicDBObject jsonObject); |
| | | |
| | | /** 根据id同步授权机构下的服务类项目数据 - 服务项目*/ |
| | | void saveHisProjectById(String id); |
| | | /**主动同步项目到his*/ |
| | | Result syncAddProject(BasicDBObject jsonObject); |
| | | /**修改项目*/ |
| | | Result syncUpdateProject(BasicDBObject basicDBObject); |
| | | |
| | | /** 同步授权机构下的服务类项目数据 - 服务项目*/ |
| | | void saveHisProject(SyncProjectRecord syncProjectRecord); |
| | | |
| | | |
| | | /**同步所有促销*/ |
| | | void syncHisPromotion(SyncProjectRecord syncProjectRecord,JSONObject jsonObject); |
| | | /**延期促销*/ |
| | | void delayPromotion(String id,int day); |
| | | /**同步所有卡项*/ |
| | | void syncHisCardItem(JSONObject jsonObject, SyncProjectRecord syncProjectRecord); |
| | | |
| | | boolean projectSpa(String projectTypeId); |
| | | |
| | | |
| | | void syncUpdateTreatmentItemsNum(); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface SyncSalesFinancialDataService { |
| | | |
| | | Result payment(JSONObject jsonObject); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | |
| | | public interface SyncShopService { |
| | | |
| | | void syncShop( SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | void synceMedicalDepartment(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | void syncShopRoom(String shopId, SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.resultTool.Result; |
| | | import com.mongodb.BasicDBObject; |
| | | |
| | | public interface SyncTagSetsService { |
| | | |
| | | /** |
| | | * 同步所有标签信息 |
| | | * @return |
| | | */ |
| | | void tagsList(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | /** |
| | | * 同步所有标签信息 |
| | | * @return |
| | | */ |
| | | Result getList(); |
| | | |
| | | /** |
| | | * 新增标签信息 |
| | | * @return |
| | | */ |
| | | Result addTags(BasicDBObject basicDBObject); |
| | | |
| | | /** |
| | | * 修改标签信息 |
| | | * @return |
| | | */ |
| | | Result updateTags(BasicDBObject basicDBObject); |
| | | /** |
| | | * 修改标签信息 |
| | | * @return |
| | | */ |
| | | Result deleteTags(BasicDBObject basicDBObject); |
| | | /** |
| | | * 修改用户标签信息 |
| | | * @return |
| | | */ |
| | | Result updateUserTags(BasicDBObject basicDBObject); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface SyncTransactioalService { |
| | | |
| | | /**新增,返回主键 |
| | | * @param mapperClass mapper类 |
| | | * @param entity 实体类 |
| | | * @return 条数 |
| | | */ |
| | | <T extends Serializable> int insert(Class<?> mapperClass, T entity); |
| | | |
| | | <T extends Serializable> int update(Class<?> mapperClass, T entity); |
| | | |
| | | <T extends Serializable> T selectOne(Class<?> mapperClass, SqlSentence sqlSentence); |
| | | |
| | | <T extends Serializable> List<T> selectList(Class<?> mapperClass, SqlSentence sqlSentence); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.phip.model.SyncUserCardRecord; |
| | | import com.hx.resultTool.Result; |
| | | import com.mongodb.BasicDBObject; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface SyncUserCardService { |
| | | |
| | | List<Map> list(JSONObject jsonObject, SyncUserCardRecord syncUserCardRecord); |
| | | |
| | | void handleList(Map map); |
| | | |
| | | Result getUserCard(String orderId); |
| | | |
| | | Result updateUserCard(BasicDBObject userCard); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import net.sf.json.JSONObject; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface SyncUserLevelRecordService { |
| | | |
| | | void handlerUserLevelRecord(JSONObject data); |
| | | |
| | | List<Map> getUserLevelRecordList(Date startTime, Date endTime, String id); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface SyncUserService { |
| | | |
| | | User selectOneByKey(String userId); |
| | | |
| | | User selectOneByCiq(String ciq); |
| | | |
| | | List<User> selectList(SqlSentence sqlSentence); |
| | | |
| | | /** 根据顾客id同步指定顾客*/ |
| | | User syncUserById(String userId); |
| | | |
| | | /** his用户json数据同步*/ |
| | | User syncUserByJson( String json); |
| | | |
| | | String getHisUserList(Integer pageSize, Integer pageNum, String keyword); |
| | | |
| | | String getUserById(String id); |
| | | |
| | | /** 根据时间同步所有数据*/ |
| | | void syncUser(JSONObject jsonObject); |
| | | |
| | | /** 主动同步创建顾客到his - 顾客信息*/ |
| | | Result syncCreateUser(JSONObject jsonObject); |
| | | |
| | | /** 商汤创建访客*/ |
| | | Result senselinkCustomer(String userId,String type) throws Exception; |
| | | |
| | | /** 根据客户Id获取授权机构下的账户余额 - 顾客信息*/ |
| | | void syncUserAccount(String id); |
| | | |
| | | |
| | | Result userAccount(String id); |
| | | |
| | | /** 根据客户ID进行积分增减操作 - 顾客信息*/ |
| | | Result modifyIntegral(JSONObject jsonObject); |
| | | |
| | | /** 根据客户ID进行增值金增减操作 - 顾客信息*/ |
| | | Result ModifyVat(JSONObject jsonObject); |
| | | |
| | | |
| | | |
| | | /** 根据用户his查询his数据库对比照信息 - 顾客信息*/ |
| | | List<Map> photoCompares(String hisId); |
| | | |
| | | void handlephotoCompares(JSONObject json,String userid); |
| | | |
| | | /** 同步商汤用户 - 顾客信息*/ |
| | | void shangTangUser(JSONObject jsonObject); |
| | | /** 查询昨天释放的公海用户 - 顾客信息*/ |
| | | void releaseOnTheHighSeas(); |
| | | |
| | | /** 主动同步创建顾客到his - 修改用户ciq和会员等级*/ |
| | | Result updateMembership(JSONObject jsonObject); |
| | | |
| | | /** 主动同步创建顾客到his - 修改用户ciq和会员等级*/ |
| | | void userConsumptionTime(User user); |
| | | |
| | | /** 校验商汤图片是否合法*/ |
| | | Result recognitionQuality(MultipartFile file) throws IOException; |
| | | |
| | | /** 先清理下原来的用户信息*/ |
| | | void cleanUserBeforeRecord(String userId); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.phip.model.HisVisitRecord; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | public interface SyncVisitRecordService { |
| | | |
| | | /** |
| | | * 转换到访记录 |
| | | */ |
| | | void handleVisitRecord(HisVisitRecord hisVisitRecord); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.resultTool.Result; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | import java.util.Set; |
| | | |
| | | public interface SyncWarehouseService { |
| | | |
| | | void syncWarehouse(SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | void inventoryGoods(JSONObject jsonObject,SyncBasicInformationRecord syncBasicInformationRecord); |
| | | |
| | | void changeType(); |
| | | |
| | | Set getinventoryEntryRecord(String id); |
| | | void inventoryEntryRecord(JSONObject jsonObject); |
| | | |
| | | Set getinventoryOutRecord(String id); |
| | | void inventoryOutRecord(JSONObject jsonObject); |
| | | |
| | | Result inventoryInOut(String shopWarehouseChangeId); |
| | | |
| | | Result nullifyInOut(String shopWarehouseChangeId); |
| | | |
| | | void transferRecord(JSONObject jsonObject); |
| | | |
| | | Set getTransferRecord(String id); |
| | | |
| | | Result transfer(String shopWarehouseAllotId); |
| | | |
| | | Result shopWarehouseAllotId(String shopWarehouseAllotId); |
| | | |
| | | void inventoryGoodsByNumbers(String number); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.SystemParameter; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface SystemParameterService { |
| | | |
| | | int selectCount(SqlSentence sqlSentence); |
| | | |
| | | void insert(SystemParameter systemParameter); |
| | | |
| | | List<SystemParameter> selectList(SqlSentence sqlSentence); |
| | | |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | |
| | | SystemParameter selectOne(SqlSentence sqlSentence); |
| | | |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | |
| | | SystemParameter selectOneByKey(Object object); |
| | | |
| | | SystemParameter selectOneByKeyBlob(Object object); |
| | | |
| | | void updateAll(SystemParameter systemParameter); |
| | | |
| | | void updateWhere(SqlSentence sqlSentence); |
| | | |
| | | void deleteOne(String delId); |
| | | |
| | | SystemParameter selectOneByName(String name); |
| | | |
| | | Date handlerLastSyncUserLevelRecordDate(Date lastSyncDate); |
| | | |
| | | Date handlerLastSyncOrderRefundRecordDate(Date lastSyncDate); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.UserFrom; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface UserFromService { |
| | | |
| | | int selectCount(SqlSentence sqlSentence); |
| | | |
| | | void insert(UserFrom userFrom); |
| | | |
| | | List<UserFrom> selectList(SqlSentence sqlSentence); |
| | | |
| | | List<Map<String,Object>> selectListMap(SqlSentence sqlSentence); |
| | | |
| | | UserFrom selectOne(SqlSentence sqlSentence); |
| | | |
| | | Map<String,Object> selectOneMap(SqlSentence sqlSentence); |
| | | |
| | | UserFrom selectOneByKey(Object object); |
| | | |
| | | UserFrom selectOneByKeyBlob(Object object); |
| | | |
| | | void updateAll(UserFrom userFrom); |
| | | |
| | | void updateWhere(SqlSentence sqlSentence); |
| | | |
| | | void deleteOne(String delId); |
| | | |
| | | void edit(UserFrom userFrom, int nameChange, String oldName); |
| | | |
| | | void add(UserFrom userFrom, List<UserFrom> list); |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.phip.his.config.CustomParameter; |
| | | import com.hx.phiappt.dao.mapper.UserMapper; |
| | | import com.hx.phiappt.dao.mapper.UserArriveVisitMapper; |
| | | import com.hx.phiappt.model.sync.UserArriveVisit; |
| | | import com.hx.phip.his.service.ArriveVisitService; |
| | | import com.hx.phip.his.service.SyncTransactioalService; |
| | | import com.hx.redis.RedisUtil; |
| | | import com.hx.util.DateUtil; |
| | | import com.hx.util.HttpMethodUtil; |
| | | import com.hx.util.StringUtils; |
| | | import com.hx.util.mysql.aes.MysqlHexAesTool; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.*; |
| | | |
| | | |
| | | |
| | | @Service |
| | | public class ArriveVisitServiceImpl implements ArriveVisitService { |
| | | private static Logger logger = LoggerFactory.getLogger(GetTokenServiceImpl.class); |
| | | |
| | | |
| | | @Resource |
| | | private UserMapper userMapper; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | @Resource |
| | | private UserArriveVisitMapper userArriveVisitMapper; |
| | | |
| | | @Resource |
| | | private CustomParameter customParameter; |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | |
| | | private static String YYYY_MM_DD_HH_mm_ss = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | | @Override |
| | | public void information(JSONObject jsonObject) { |
| | | JSONObject data=jsonObject.optJSONObject("data"); |
| | | String userId=data.optString("userId");//商汤用户id,后续需要his那边提供一个根据id查询用户的接口 |
| | | if("0".equals(userId) || StringUtils.isEmpty(userId) || "null".equals(userId) || StringUtils.isEmpty(userId)){ |
| | | return; //如果userid为0的话是扫描到的路人不处理 |
| | | }else { |
| | | Date now = new Date(); |
| | | UserArriveVisit userArriveVisit=new UserArriveVisit(jsonObject.toString()); |
| | | userArriveVisit.setCreateTime(now); |
| | | |
| | | String createAt=data.optString("createAt"); |
| | | String sn=data.optString("sn"); |
| | | //识别时间(秒级) |
| | | String signTimeStr = data.optString("signTime", null); |
| | | |
| | | String mobile=decryptMobile(data.optString("mobile")); |
| | | userArriveVisit.setTel(mobile); |
| | | mobile= MysqlHexAesTool.encryptData(mobile, customParameter.getAesFixedKey(),null); |
| | | userArriveVisit.setEditTime(new Date()); |
| | | userArriveVisit.setTel(userArriveVisit.getTel()+","+ mobile); |
| | | syncTransactioalService.insert(UserArriveVisitMapper.class,userArriveVisit); |
| | | // userArriveVisitMapper.updateAll(userArriveVisit); |
| | | |
| | | //避免总部员工上班触发用户到访工能 小荔枝提的需求 3月3号加的 |
| | | //总部8楼PASS |
| | | if("SPS-6607c8466c446f0fca3d6401a9f20c2a".equals(sn) |
| | | //静安20层大门 |
| | | || "SPS-093c4610d413ab32185dbdff1f114750".equals(sn) |
| | | //静安20层左门 |
| | | || "SPS-1c50b6dc7572d8145be3cb58d62ee6dc".equals(sn) |
| | | //静安20层右门 |
| | | || "SPS-8de324dcc8175545abb226a2c7d37f54".equals(sn) |
| | | //总部20楼小会议室 |
| | | || "SPS-aabe515e82b54590f31de56491e2c21b".equals(sn) |
| | | //静安20楼大会议室 |
| | | || "SPS-a4078b6214eb28aef53fe540e97a019f".equals(sn) |
| | | ){ |
| | | return; |
| | | } |
| | | |
| | | |
| | | //判断识别时间为空或长度异常则不处理 |
| | | if(StringUtils.isEmpty(signTimeStr) || signTimeStr.length() < 10){ |
| | | return; |
| | | } |
| | | |
| | | //时间戳转换日期 |
| | | Long signTime = Long.parseLong(signTimeStr); |
| | | if(signTimeStr.length() == 10){ |
| | | signTime = signTime * 1000; |
| | | } |
| | | Date signDate = DateUtil.timestampToDate(signTime, YYYY_MM_DD_HH_mm_ss); |
| | | //判断当天日期和设备日期不是同一天,则不做任何处理 |
| | | if(DateUtil.differDay(now, signDate) != 0){ |
| | | return; |
| | | } |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | sqlSentence.setSqlSentence("select * from user where shangTangId = #{m.shangTangId} and isDel = 0 "); |
| | | map.put("shangTangId", userId); |
| | | List<User> userList=userMapper.selectList(sqlSentence); |
| | | |
| | | Set set=new HashSet(); |
| | | if(userList!=null && userList.size()>0){ |
| | | for (User user : userList) { |
| | | set.add(user.getId()); |
| | | } |
| | | } |
| | | |
| | | |
| | | if(StringUtils.isEmpty(data.optString("mobile")) || "null".equals(data.optString("mobile"))){ |
| | | return; |
| | | } |
| | | sqlSentence.setSqlSentence("select * from user where tel = #{m.tel} and isDel = 0"); |
| | | map.put("tel", mobile); |
| | | userList=userMapper.selectList(sqlSentence); |
| | | if(userList!=null && userList.size()>0){ |
| | | for (User user : userList) { |
| | | set.add(user.getId()); |
| | | } |
| | | } |
| | | |
| | | if(userList==null || userList.size()==0){ |
| | | return; |
| | | } |
| | | JSONObject object=null; |
| | | |
| | | createAt= DateUtil.formatDate(DateUtil.parseString_1(createAt)); |
| | | for (Object o : set) { |
| | | object=new JSONObject(); |
| | | object.put("createAt",createAt); |
| | | redisUtil.hashSet("user_visit_record",String.valueOf(o) ,object.toString()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static void main(String args[]){ |
| | | Long signTime = 1685706384L; |
| | | //时间戳转换日期 |
| | | Date signDate = DateUtil.timestampToDate(signTime * 1000, YYYY_MM_DD_HH_mm_ss); |
| | | Date now = new Date(); |
| | | //判断当天日期和设备日期不是同一天,则不做任何处理 |
| | | System.out.println(DateUtil.differDay(now, signDate)); |
| | | } |
| | | |
| | | |
| | | public String decryptMobile(String mobile){ |
| | | long timestamp=System.currentTimeMillis(); |
| | | String appKey= "236aab70c81a97f6"; |
| | | String appSecret= "c5fe4f5dd771e6bea698493519e39611"; |
| | | String sign=MD5(timestamp+"#"+appSecret); |
| | | |
| | | List<String> list=new ArrayList<>(); |
| | | list.add(mobile); |
| | | JSONObject object=new JSONObject(); |
| | | object.put("list",list); |
| | | |
| | | String result = HttpMethodUtil.HttpURLUtilJson("https://link.bi.sensetime.com/api/v3/decrypt?app_key="+appKey+"&sign="+sign+"×tamp="+timestamp, object.toString(), null, null, "POST"); |
| | | if(result !=null){ |
| | | JSONObject jsonObject=JSONObject.fromObject(result); |
| | | if("200".equals(jsonObject.optString("code"))){ |
| | | JSONObject data=jsonObject.optJSONObject("data"); |
| | | mobile=data.optString(mobile); |
| | | } |
| | | } |
| | | return mobile; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String getDecryptMobile(String mobile) { |
| | | long timestamp=System.currentTimeMillis(); |
| | | String appKey= "236aab70c81a97f6"; |
| | | String appSecret= "c5fe4f5dd771e6bea698493519e39611"; |
| | | String sign=MD5(timestamp+"#"+appSecret); |
| | | |
| | | List<String> list=new ArrayList<>(); |
| | | list.add(mobile); |
| | | JSONObject object=new JSONObject(); |
| | | object.put("list",list); |
| | | logger.info("解密手机号:{}",mobile); |
| | | String result = HttpMethodUtil.HttpURLUtilJson("https://link.bi.sensetime.com/api/v3/decrypt?app_key="+appKey+"&sign="+sign+"×tamp="+timestamp, object.toString(), null, null, "POST"); |
| | | logger.info("解密手机号:{},返回:{}",mobile,result); |
| | | if(result !=null){ |
| | | JSONObject jsonObject=JSONObject.fromObject(result); |
| | | if("200".equals(jsonObject.optString("code"))){ |
| | | JSONObject data=jsonObject.optJSONObject("data"); |
| | | mobile=data.optString(mobile); |
| | | } |
| | | } |
| | | return mobile; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private static String MD5(String sourceStr) { |
| | | String result = ""; |
| | | try { |
| | | MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | md.update(sourceStr.getBytes()); |
| | | byte b[] = md.digest(); |
| | | int i; |
| | | StringBuffer buf = new StringBuffer(""); |
| | | for (int offset = 0; offset < b.length; offset++) { |
| | | i = b[offset]; |
| | | if (i < 0) |
| | | i += 256; |
| | | if (i < 16) |
| | | buf.append("0"); |
| | | buf.append(Integer.toHexString(i)); |
| | | } |
| | | result = buf.toString(); |
| | | /*System.out.println("MD5(" + sourceStr + ",32) = " + result); |
| | | System.out.println("MD5(" + sourceStr + ",16) = " + buf.toString().substring(8, 24));*/ |
| | | } catch (NoSuchAlgorithmException e) { |
| | | System.out.println(e); |
| | | } |
| | | return result; |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.his.service.CreateTimeNoService; |
| | | import com.hx.phip.uti.CreateNo; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) |
| | | @Service |
| | | public class CreateTimeNoServiceImpl implements CreateTimeNoService { |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | @Override |
| | | public synchronized String getOrderNo(String key, int length, String format) { |
| | | |
| | | return CreateNo.createTimeNo(systemParameterMapper,key,length,format); //随机生成 |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.hx.exception.TipsException; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phip.common.RoleType; |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phiappt.dao.mapper.EmployeeMapper; |
| | | import com.hx.phiappt.dao.mapper.EmployeeRoleMapper; |
| | | import com.hx.phiappt.dao.mapper.EmployeeRoleTypeMapper; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import com.hx.phiappt.model.Employee; |
| | | import com.hx.phiappt.model.EmployeeRole; |
| | | import com.hx.phiappt.model.EmployeeRoleType; |
| | | import com.hx.phip.his.service.EmployeeService; |
| | | import com.hx.util.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | @Transactional |
| | | @Service |
| | | public class EmployeeServiceImpl implements EmployeeService { |
| | | |
| | | @Resource |
| | | private EmployeeMapper employeeMapper; |
| | | @Resource |
| | | private EmployeeRoleMapper employeeRoleMapper; |
| | | @Resource |
| | | private EmployeeRoleTypeMapper employeeRoleTypeMapper; |
| | | // @Resource |
| | | // private EmployeeBindMapper employeeBindMapper; |
| | | |
| | | /**查询列表*/ |
| | | @Override |
| | | public List<Employee> selectList(SqlSentence sqlSentence) { |
| | | return employeeMapper.selectList(sqlSentence); |
| | | } |
| | | |
| | | /**查询列表*/ |
| | | @Override |
| | | public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) { |
| | | return employeeMapper.selectListMap(sqlSentence); |
| | | } |
| | | |
| | | /**查询单个*/ |
| | | @Override |
| | | public Employee selectOne(SqlSentence sqlSentence) { |
| | | return employeeMapper.selectOne(sqlSentence); |
| | | } |
| | | |
| | | /**查询单个*/ |
| | | @Override |
| | | public Map<String,Object> selectOneMap(SqlSentence sqlSentence) { |
| | | return employeeMapper.selectOneMap(sqlSentence); |
| | | } |
| | | |
| | | /**查询单个,大数据不拿取*/ |
| | | @Override |
| | | public Employee selectOneByKey(Object object) { |
| | | return employeeMapper.selectOneByKey(object); |
| | | } |
| | | |
| | | /**查询单个,大数据拿取*/ |
| | | @Override |
| | | public Employee selectOneByKeyBlob(Object object) { |
| | | return employeeMapper.selectOneByKeyBlob(object); |
| | | } |
| | | |
| | | /**新增*/ |
| | | @Override |
| | | public void insert(Employee employee) { |
| | | int count = employeeMapper.insert(employee); |
| | | if(count != 1) { |
| | | throw new TipsException("新增失败!"); |
| | | } |
| | | } |
| | | |
| | | /**修改*/ |
| | | @Override |
| | | public void updateAll(Employee employee) { |
| | | int count = employeeMapper.updateAll(employee); |
| | | if(count!=1) { |
| | | throw new TipsException("保存失败!"); |
| | | } |
| | | } |
| | | |
| | | /**修改*/ |
| | | @Override |
| | | public void updateWhere(SqlSentence sqlSentence) { |
| | | int count = employeeMapper.updateWhere(sqlSentence); |
| | | if(count!=1) { |
| | | throw new TipsException("保存失败!"); |
| | | } |
| | | } |
| | | |
| | | /**删除一个*/ |
| | | @Override |
| | | public void deleteOne(String delId) { |
| | | int count = employeeMapper.deleteById(delId); |
| | | if(count!=1) { |
| | | throw new TipsException("删除失败!"); |
| | | } |
| | | } |
| | | |
| | | /**查询条数*/ |
| | | @Override |
| | | public int selectCount(SqlSentence sqlSentence) { |
| | | int count = employeeMapper.selectCount(sqlSentence); |
| | | return count; |
| | | } |
| | | |
| | | @Override |
| | | public Employee selectByApiId(String apiId) { |
| | | return employeeMapper.selectByApiId(apiId); |
| | | } |
| | | |
| | | @Override |
| | | public void add(Employee employee, EmployeeRole employeeRole) { |
| | | int count = employeeMapper.insert(employee); |
| | | if(count != 1){ |
| | | throw new TipsException("新增失败"); |
| | | } |
| | | |
| | | employeeRole.setEmployeeId(employee.getId()); |
| | | count = employeeRoleMapper.insert(employeeRole); |
| | | if(count != 1){ |
| | | throw new TipsException("新增失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void add(Employee employee, List<EmployeeRole> roleList) { |
| | | int count = employeeMapper.insert(employee); |
| | | if(count != 1){ |
| | | throw new TipsException("新增失败"); |
| | | } |
| | | |
| | | for(EmployeeRole employeeRole : roleList){ |
| | | employeeRole.setEmployeeId(employee.getId()); |
| | | count = employeeRoleMapper.insert(employeeRole); |
| | | if(count != 1){ |
| | | throw new TipsException("新增失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void edit(Employee employee, EmployeeRole employeeRole) { |
| | | int count = employeeMapper.updateAll(employee); |
| | | if(count != 1){ |
| | | throw new TipsException("编辑失败"); |
| | | } |
| | | |
| | | count = employeeRoleMapper.updateAll(employeeRole); |
| | | if(count != 1){ |
| | | throw new TipsException("编辑失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void edit(Employee employee, List<EmployeeRole> roleList, Set<String> delSet) { |
| | | int count = employeeMapper.updateAll(employee); |
| | | if(count != 1){ |
| | | throw new TipsException("编辑员工信息失败"); |
| | | } |
| | | |
| | | //新增 |
| | | for(EmployeeRole employeeRole : roleList){ |
| | | employeeRole.setEmployeeId(employee.getId()); |
| | | count = employeeRoleMapper.insert(employeeRole); |
| | | if(count != 1){ |
| | | throw new TipsException("编辑员工角色失败"); |
| | | } |
| | | } |
| | | |
| | | //删除 |
| | | if(delSet != null && delSet.size() > 0){ |
| | | for(String delId : delSet){ |
| | | if(employeeRoleMapper.deleteById(delId) != 1){ |
| | | throw new TipsException("删除员工角色失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void editUpdate(Employee employee, List<EmployeeRole> roleList) { |
| | | int count = employeeMapper.updateAll(employee); |
| | | if(count != 1){ |
| | | throw new TipsException("编辑失败1"); |
| | | } |
| | | |
| | | for(EmployeeRole employeeRole : roleList){ |
| | | if(StringUtils.isEmpty(employeeRole.getId())){ |
| | | count = employeeRoleMapper.insert(employeeRole); |
| | | if(count != 1){ |
| | | throw new TipsException("编辑失败2"); |
| | | } |
| | | }else{ |
| | | count = employeeRoleMapper.updateAll(employeeRole); |
| | | if(count != 1){ |
| | | throw new TipsException("编辑失败3"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /** 批量增加 */ |
| | | @Override |
| | | public void batchAdd(Map<Employee, EmployeeRole> map) { |
| | | |
| | | Employee employee = null; |
| | | EmployeeRole employeeRole = null; |
| | | EmployeeRoleType employeeRoleType = null; |
| | | Map<String, String> idMap = new HashMap<>(); |
| | | for(Map.Entry<Employee, EmployeeRole> entry : map.entrySet()){ |
| | | |
| | | employee = entry.getKey(); |
| | | employeeRole = entry.getValue(); |
| | | |
| | | if(StringUtils.isEmpty(employee.getApiId()) || !idMap.containsKey(employee.getApiId())){ |
| | | employeeMapper.insert(employee); |
| | | idMap.put(employee.getApiId(), employee.getId()); |
| | | }else{ |
| | | employee.setId(idMap.get(employee.getApiId())); |
| | | } |
| | | |
| | | |
| | | employeeRoleType = employeeRoleTypeMapper.selectByUniqueStr(employeeRole.getRoleUniqueStr()); |
| | | if(employeeRoleType != null){ |
| | | employeeRole.setRoleTypeId(employeeRoleType.getId()); |
| | | employeeRole.setEmployeeId(employee.getId()); |
| | | employeeRoleMapper.insert(employeeRole); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** 更新其他员工 */ |
| | | @Override |
| | | public void updateEmployee(Employee employee, List<EmployeeRole> roleList) { |
| | | |
| | | //员工 |
| | | if(StringUtils.isEmpty(employee.getId())){ |
| | | if(employeeMapper.insert(employee) != 1){ |
| | | throw new TipsException("新增员工信息失败"); |
| | | } |
| | | }else{ |
| | | //2021-10-25 为解决员工userId重复问题,将更新屏蔽(三少抛出问题) |
| | | // if(employeeMapper.updateAll(employee) != 1){ |
| | | // throw new TipsException("更新员工信息失败"); |
| | | // } |
| | | } |
| | | |
| | | //判断如果员工被标记为不同步角色 |
| | | if(employee.getIsSyncRole() == BaseEntity.NO){ |
| | | return; |
| | | } |
| | | |
| | | //员工角色 |
| | | Set<String> delSet = new HashSet<>(); |
| | | if(roleList != null || roleList.size() > 0) |
| | | { |
| | | //查询旧的角色出来 |
| | | List<EmployeeRole> oldList = employeeRoleMapper.selectListByEmployeeId(employee.getId()); |
| | | if(oldList != null && oldList.size() > 0){ |
| | | for(EmployeeRole er : oldList){ |
| | | //非MIC角色 |
| | | if(!er.getRoleUniqueStr().equals(RoleType.UNIQUE_STR_MIC)){ |
| | | delSet.add(er.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | int isExist = 0; |
| | | EmployeeRoleType employeeRoleType = null; |
| | | Map<String, EmployeeRoleType> tMap = new HashMap<>(); |
| | | for(EmployeeRole employeeRole : roleList) |
| | | { |
| | | isExist = 0; |
| | | //遍历 |
| | | for(EmployeeRole er : oldList){ |
| | | //判断如果门店和角色相同则不处理 |
| | | if(employeeRole.getShopId().equals(er.getShopId()) |
| | | && employeeRole.getRoleUniqueStr().equals(er.getRoleUniqueStr())){ |
| | | delSet.remove(er.getId()); |
| | | isExist = 1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if(isExist == 0) |
| | | { |
| | | if(tMap.containsKey(employeeRole.getRoleUniqueStr())){ |
| | | employeeRoleType = tMap.get(employeeRole.getRoleUniqueStr()); |
| | | }else{ |
| | | employeeRoleType = employeeRoleTypeMapper.selectByUniqueStr(employeeRole.getRoleUniqueStr()); |
| | | if(employeeRoleType == null){ |
| | | throw new TipsException("找不到角色类型信息"); |
| | | } |
| | | tMap.put(employeeRole.getRoleUniqueStr(), employeeRoleType); |
| | | } |
| | | |
| | | employeeRole.setEmployeeId(employee.getId()); |
| | | employeeRole.setRoleTypeId(employeeRoleType.getId()); |
| | | if(employeeRoleMapper.insert(employeeRole) != 1){ |
| | | throw new TipsException("新增员工角色失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | //如果删除的角色id里面包含员工最后选择的角色id,则要清空 |
| | | if(delSet.contains(employee.getRoleId())){ |
| | | employee.setRoleId(null); |
| | | if(employeeMapper.updateAll(employee) != 1){ |
| | | throw new TipsException("更新员工信息失败"); |
| | | } |
| | | } |
| | | |
| | | //删除要被删除的id |
| | | for(String delId : delSet){ |
| | | if(employeeRoleMapper.deleteById(delId) != 1){ |
| | | throw new TipsException("删除员工角色失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** 查询员工 By id and role */ |
| | | @Override |
| | | public Employee selectOneByIdAndRole(String id, String roleUniqueStr) { |
| | | return employeeMapper.selectOneByIdAndRole(id, roleUniqueStr); |
| | | } |
| | | |
| | | /** 查询员工 By name and role */ |
| | | @Override |
| | | public Employee selectOneByNameAndRole(String name, String roleUniqueStr) { |
| | | return employeeMapper.selectOneByNameAndRole(name, roleUniqueStr); |
| | | } |
| | | |
| | | /** 查询员工 和 角色标识 By id */ |
| | | @Override |
| | | public Employee selectOneAndRoleStrById(String id) { |
| | | return employeeMapper.selectOneAndRoleStrById(id); |
| | | } |
| | | |
| | | /** 查询员工 和 角色标识 By userId */ |
| | | @Override |
| | | public Employee selectOneAndRoleStrByUserId(String userId) { |
| | | return employeeMapper.selectOneAndRoleStrByUserId(userId); |
| | | } |
| | | |
| | | /** 查询员工和角色list By id */ |
| | | @Override |
| | | public Employee selectOneRoleListById(String id) { |
| | | return employeeMapper.selectOneRoleListById(id); |
| | | } |
| | | |
| | | /** 查询员工和角色list By userId */ |
| | | @Override |
| | | public Employee selectOneRoleListByUserId(String userId) { |
| | | return employeeMapper.selectOneRoleListByUserId(userId); |
| | | } |
| | | |
| | | /** 查询员工和角色list By employeeNo */ |
| | | @Override |
| | | public Employee selectOneRoleListByEmployeeNo(String employeeNo) { |
| | | return employeeMapper.selectOneRoleListByEmployeeNo(employeeNo); |
| | | } |
| | | |
| | | /** 更新员工角色id */ |
| | | @Override |
| | | public void updateRoleIdById(String id, String roleId) { |
| | | int count = employeeMapper.updateRoleIdById(id, roleId); |
| | | if(count != 1){ |
| | | throw new TipsException("更新失败"); |
| | | } |
| | | } |
| | | |
| | | /** 查询员工apiId */ |
| | | @Override |
| | | public String selectApiIdById(String id) { |
| | | return employeeMapper.selectApiIdById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void insertOpenId(String openId, String unionId, Employee employee, SystemConfig systemConfig) { |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> values = new HashMap<>(); |
| | | |
| | | values.put("fromName","his助手"); |
| | | values.put("fromAppId",systemConfig.getAppId()); |
| | | values.put("unionId",unionId); |
| | | values.put("openId",openId); |
| | | values.put("fromCode",systemConfig.getAppId()); |
| | | values.put("fromId",employee.getUserId()); |
| | | sqlSentence.sqlUpdate("fromName = #{m.fromName},fromAppId = #{m.fromAppId},unionId = #{m.unionId},openId = #{m.openId},fromId = #{m.fromId}" + |
| | | " WHERE fromCode = #{m.fromCode} AND openId = #{m.openId}",values); |
| | | |
| | | // int updateNum = employeeBindMapper.updateWhere(sqlSentence); |
| | | |
| | | // if(updateNum==0){ |
| | | // //保存小程序登录的数据 |
| | | // EmployeeBind employeeBind = new EmployeeBind(); |
| | | // employeeBind.setEmployeeId(employee.getId()); |
| | | // employeeBind.setFromCode(systemConfig.getAppId()); |
| | | // employeeBind.setFromName("his助手"); |
| | | // employeeBind.setFromAppId(systemConfig.getAppId()); |
| | | // employeeBind.setUnionId(unionId); |
| | | // employeeBind.setOpenId(openId); |
| | | // employeeBind.setFromId(employee.getUserId()); |
| | | //// employeeBindMapper.insert(employeeBind); |
| | | // }else if(updateNum > 1){ |
| | | // throw new TipsException("更新员工信息失败"); |
| | | // } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.common.ConsumablesTypeConstants; |
| | | import com.hx.phiappt.common.DictionariesConstants; |
| | | import com.hx.phiappt.model.Dictionaries; |
| | | import com.hx.phiappt.model.consumables.Consumables; |
| | | import com.hx.phiappt.model.consumables.ConsumablesType; |
| | | import com.hx.phiappt.model.warehouse.ShopWarehouse; |
| | | import com.hx.phiappt.model.warehouse.ShopWarehouseItem; |
| | | import com.hx.phip.common.ErpUrl; |
| | | import com.hx.phip.his.config.ErpConfig; |
| | | import com.hx.phiappt.dao.mapper.*; |
| | | import com.hx.phip.his.service.ErpSyncGoodsService; |
| | | import com.hx.phip.uti.CreateNo; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.DateUtil; |
| | | import com.hx.util.HttpMethodUtil; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | @Transactional |
| | | @Service |
| | | public class ErpSyncGoodsServiceImpl implements ErpSyncGoodsService { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ErpSyncGoodsServiceImpl.class); |
| | | |
| | | @Resource |
| | | private ErpConfig erpConfig; |
| | | |
| | | @Resource |
| | | private ConsumablesMapper consumablesMapper; |
| | | |
| | | @Resource |
| | | private DictionariesMapper dictionariesMapper; |
| | | |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | |
| | | @Resource |
| | | private ConsumablesTypeMapper consumablesTypeMapper; |
| | | |
| | | @Resource |
| | | private ShopWarehouseMapper shopWarehouseMapper; |
| | | |
| | | @Resource |
| | | private ShopWarehouseItemMapper shopWarehouseItemMapper; |
| | | /** |
| | | * 同步erp全部产品信息 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void productAll(JSONObject jsonObject) { |
| | | String result = HttpMethodUtil.HttpURLUtilJson(erpConfig.getUrl() + ErpUrl.SELECT_PRODUCT_ALL + "?token="+erpConfig.getToken()+"&page.page=1&page.pagesize=200", null, null, null, "GET"); |
| | | if (!StringUtils.isEmpty(result)) { |
| | | JSONObject obj = JSONObject.fromObject(result); |
| | | JSONArray arr = obj.optJSONArray("data"); |
| | | if (arr != null && arr.size() > 0) { |
| | | for (int i = 0; i < arr.size(); i++) { |
| | | try { |
| | | hangdleProductAll(arr.getJSONObject(i)); |
| | | } catch (Exception e) { |
| | | logger.error("同步产品出错了:" + arr.getJSONObject(i).toString() + " " + e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | int totalPage = obj.optJSONObject("page").optInt("countpage", 1); |
| | | //开12个线程池处理其它页 |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(3); |
| | | int MaxAgain = 10;//定义请求超时重新发起请求最大次数 |
| | | try { |
| | | |
| | | for (int i = 1; i < totalPage; i++) { |
| | | int page = i; |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | int num = 0; |
| | | do { |
| | | try { |
| | | Boolean status = syncProductAll(page); |
| | | if (status) { |
| | | num = MaxAgain; |
| | | } else { |
| | | System.out.println(Thread.currentThread().getName() + " 执行第:" + page + " 页 Rtime Out 第" + num + "次"); |
| | | num++; |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println(Thread.currentThread().getName() + " 执行第:" + page + " 页 Rtime Out 第" + num + "次"); |
| | | num++; |
| | | } |
| | | } while (num < MaxAgain); |
| | | |
| | | |
| | | } |
| | | }); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | threadPool.shutdown(); |
| | | } |
| | | } |
| | | } |
| | | //同步其他也页 |
| | | public Boolean syncProductAll(int page) { |
| | | logger.info("同步erp产品第"+page+"页"); |
| | | String result = HttpMethodUtil.HttpURLUtilJson(erpConfig.getUrl() + ErpUrl.SELECT_PRODUCT_ALL + "?token="+erpConfig.getToken()+"&page.page=" + page + "&page.pagesize=200", null, null, null, "GET"); |
| | | if (!StringUtils.isEmpty(result)) { |
| | | JSONObject obj = JSONObject.fromObject(result); |
| | | JSONArray arr = obj.optJSONArray("data"); |
| | | if (arr != null && arr.size() > 0) { |
| | | for (int i = 0; i < arr.size(); i++) { |
| | | try { |
| | | hangdleProductAll(arr.getJSONObject(i)); |
| | | } catch (Exception e) { |
| | | logger.error("同步产品出错了:" + arr.getJSONObject(i).toString() + "错误信息 " + e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | logger.info("erp接口错误,返回:{}", result); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private void hangdleProductAll(JSONObject obj) { |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | sqlSentence.setSqlSentence("select * from consumables where isDel = 0 and name = #{m.name} and serialNumber = #{m.serialNumber} "); |
| | | map.put("name", obj.optString("Name")); |
| | | map.put("serialNumber", obj.optString("Product")); |
| | | Consumables consumables=consumablesMapper.selectOne(sqlSentence); |
| | | |
| | | |
| | | if(consumables==null){ |
| | | consumables=new Consumables(); |
| | | consumables.setBrand(obj.optString("Brand")); |
| | | consumables.setName(obj.optString("Name")); |
| | | consumables.setIsUp(0); |
| | | consumables.setType(1); |
| | | consumables.setSerialNumber(obj.optString("Product")); |
| | | consumables.setSpec(obj.optString("Specifications")); |
| | | String unit=obj.optString("unit"); |
| | | sqlSentence.setSqlSentence("select * from dictionaries where isDel = 0 and name = #{m.name} "); |
| | | map.put("name", unit); |
| | | Dictionaries dictionaries= dictionariesMapper.selectOne(sqlSentence); |
| | | if(dictionaries==null){ |
| | | dictionaries= addDictionaries(unit); |
| | | } |
| | | consumables.setUnitIdCode(dictionaries.getNumberNo()); |
| | | consumables.setUnitName(dictionaries.getName()); |
| | | ConsumablesType consumablesType=handleConsumablesType(obj.optString("Major"),obj.optString("Subclass")); |
| | | consumables.setConsumablesTypeId(consumablesType.getId()); |
| | | consumables.setConsumablesTypeName(consumablesType.getName()); |
| | | consumables.setPurchaseTypeName(obj.optString("Ownership")); |
| | | consumablesMapper.insert(consumables); |
| | | } |
| | | |
| | | } |
| | | public ConsumablesType handleConsumablesType(String major,String subclass){ |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | sqlSentence.setSqlSentence("select * from consumables_type where isDel = 0 and name = #{m.name} "); |
| | | map.put("name", major); |
| | | ConsumablesType majorConsumablesType = consumablesTypeMapper.selectOne(sqlSentence); |
| | | if(majorConsumablesType==null){ |
| | | majorConsumablesType=new ConsumablesType(); |
| | | majorConsumablesType.setAppId(major); |
| | | majorConsumablesType.setName(major); |
| | | majorConsumablesType.setLevel(1); |
| | | majorConsumablesType.setParentId(null); |
| | | majorConsumablesType.setIsUp(1); |
| | | majorConsumablesType.setType(ConsumablesTypeConstants.GOODS); |
| | | consumablesTypeMapper.insert(majorConsumablesType); |
| | | } |
| | | sqlSentence.setSqlSentence("select * from consumables_type where isDel = 0 and name = #{m.name} and parentId = #{m.parentId} "); |
| | | map.put("name", subclass); |
| | | map.put("parentId", majorConsumablesType.getId()); |
| | | ConsumablesType subclassConsumablesType = consumablesTypeMapper.selectOne(sqlSentence); |
| | | if(subclassConsumablesType==null){ |
| | | subclassConsumablesType=new ConsumablesType(); |
| | | subclassConsumablesType.setAppId(subclass); |
| | | subclassConsumablesType.setName(subclass); |
| | | subclassConsumablesType.setLevel(2); |
| | | subclassConsumablesType.setParentId(majorConsumablesType.getId()); |
| | | subclassConsumablesType.setIsUp(1); |
| | | subclassConsumablesType.setType(ConsumablesTypeConstants.GOODS); |
| | | consumablesTypeMapper.insert(subclassConsumablesType); |
| | | } |
| | | return subclassConsumablesType; |
| | | |
| | | } |
| | | |
| | | public Dictionaries addDictionaries(String name){ |
| | | Dictionaries dictionaries=new Dictionaries(); |
| | | dictionaries.setNumberNo(CreateNo.createTimeNo(systemParameterMapper,"DW",3,"yyyyMMdd")); |
| | | dictionaries.setName(name); |
| | | dictionaries.setType(DictionariesConstants.TYPE_UNIT); |
| | | dictionaries.setIsUp(1); |
| | | dictionaries.setRemarks("同步erp商品单位"); |
| | | dictionariesMapper.insert(dictionaries); |
| | | return dictionaries; |
| | | } |
| | | |
| | | /** |
| | | * 同步erp全部产品的所有库存批次信息 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void productInventoryAll() { |
| | | String result = HttpMethodUtil.HttpURLUtilJson(erpConfig.getUrl() + ErpUrl.SELECT_STOCK + "?token="+erpConfig.getToken()+"&page.page=1&page.pagesize=200", null, null, null, "GET"); |
| | | if (!StringUtils.isEmpty(result)) { |
| | | JSONObject obj = JSONObject.fromObject(result); |
| | | JSONArray arr = obj.optJSONArray("data"); |
| | | if (arr != null && arr.size() > 0) { |
| | | for (int i = 0; i < arr.size(); i++) { |
| | | try { |
| | | handleInventoryGoods(arr.getJSONObject(i)); |
| | | } catch (Exception e) { |
| | | logger.error("同步erp库存出错了:{},json:{}" ,e.getMessage(), arr.getJSONObject(i).toString()); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | int totalPage = obj.optJSONObject("page").optInt("countpage", 1); |
| | | //开12个线程池处理其它页 |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(3); |
| | | int MaxAgain = 10;//定义请求超时重新发起请求最大次数 |
| | | try { |
| | | |
| | | for (int i = 1; i < totalPage; i++) { |
| | | int page = i; |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | int num = 0; |
| | | do { |
| | | try { |
| | | Boolean status = syncproductInventoryAll(page); |
| | | if (status) { |
| | | num = MaxAgain; |
| | | } else { |
| | | System.out.println(Thread.currentThread().getName() + " 执行第:" + page + " 页 Rtime Out 第" + num + "次"); |
| | | num++; |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println(Thread.currentThread().getName() + " 执行第:" + page + " 页 Rtime Out 第" + num + "次"); |
| | | num++; |
| | | } |
| | | } while (num < MaxAgain); |
| | | |
| | | |
| | | } |
| | | }); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | threadPool.shutdown(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //同步其他也页 |
| | | public Boolean syncproductInventoryAll(int page) { |
| | | logger.info("同步erp库存第"+page+"页"); |
| | | String result = HttpMethodUtil.HttpURLUtilJson(erpConfig.getUrl() + ErpUrl.SELECT_STOCK + "?token="+erpConfig.getToken()+"&page.page="+page+"&page.pagesize=200", null, null, null, "GET"); |
| | | if (!StringUtils.isEmpty(result)) { |
| | | JSONObject obj = JSONObject.fromObject(result); |
| | | JSONArray arr = obj.optJSONArray("data"); |
| | | if (arr != null && arr.size() > 0) { |
| | | for (int i = 0; i < arr.size(); i++) { |
| | | try { |
| | | handleInventoryGoods(arr.getJSONObject(i)); |
| | | } catch (Exception e) { |
| | | logger.error("同步erp库存出错了:" + arr.getJSONObject(i).toString() + "错误信息 " + e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | logger.info("erp接口错误,返回:{}", result); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 处理库存 |
| | | * |
| | | * @param json |
| | | */ |
| | | public void handleInventoryGoods(JSONObject json) { |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | sqlSentence.setSqlSentence("select * from consumables where isDel = 0 and name = #{m.name} and serialNumber = #{m.serialNumber} "); |
| | | map.put("name", json.optString("Name")); |
| | | map.put("serialNumber", json.optString("Product")); |
| | | Consumables consumables=consumablesMapper.selectOne(sqlSentence); |
| | | if (consumables == null) { |
| | | logger.info("请先同步耗材,名称:{},批次:{}" ,json.optString("Name"), json.optString("Product")); |
| | | return; |
| | | } |
| | | |
| | | sqlSentence.setSqlSentence("SELECT * FROM shop_warehouse WHERE isDel = 0 and name = #{m.name} "); |
| | | map.put("name", json.optString("Warehouse")); |
| | | ShopWarehouse shopWarehouse = shopWarehouseMapper.selectOne(sqlSentence); |
| | | if (shopWarehouse == null) { |
| | | shopWarehouse=handleShopWarehouse(json.optString("Warehouse")); |
| | | } |
| | | |
| | | |
| | | String sd = json.optString("TermOfValidity"); |
| | | |
| | | sqlSentence.setSqlSentence("SELECT * FROM shop_warehouse_item WHERE isDel = 0 and shopWarehouseId = #{m.shopWarehouseId} and goodId = #{m.goodId} and batchNo =#{m.batchNo} and goodType =#{m.goodType} and expiryDate =#{m.expiryDate}"); |
| | | map.put("shopWarehouseId", shopWarehouse.getId()); |
| | | map.put("goodId", consumables.getId()); |
| | | map.put("batchNo", json.optString("Batch")); |
| | | map.put("goodType", 1); |
| | | map.put("expiryDate", sd); |
| | | List<ShopWarehouseItem> shopWarehouseItemList = shopWarehouseItemMapper.selectList(sqlSentence); |
| | | if (shopWarehouseItemList != null && shopWarehouseItemList.size()>0) { |
| | | sqlSentence.setSqlSentence(" isDel = 0 and shopWarehouseId = #{m.shopWarehouseId} and goodId = #{m.goodId} and batchNo =#{m.batchNo} and goodType =#{m.goodType} and expiryDate =#{m.expiryDate}"); |
| | | shopWarehouseItemMapper.deleteWhere(sqlSentence); |
| | | } |
| | | |
| | | ShopWarehouseItem shopWarehouseItem = new ShopWarehouseItem(); |
| | | shopWarehouseItem.setShopWarehouseId(shopWarehouse.getId()); |
| | | shopWarehouseItem.setGoodType(1); |
| | | shopWarehouseItem.setGoodId(consumables.getId()); |
| | | shopWarehouseItem.setGoodAlert(0); |
| | | shopWarehouseItem.setStatus(0); |
| | | |
| | | shopWarehouseItem.setBatchNo(json.optString("Batch")); |
| | | shopWarehouseItem.setGoodNum(json.optInt("Smallstock", 0)); |
| | | |
| | | Date expiryDate = DateUtil.parseString_2(sd); |
| | | |
| | | shopWarehouseItem.setExpiryDate(expiryDate); |
| | | shopWarehouseItem.setPrice(new BigDecimal("null".equals(json.optString("UnitPrice", "0")) ? "0" : json.optString("UnitPrice", "0"))); |
| | | |
| | | shopWarehouseItem.setTotalPrice(new BigDecimal("null".equals(json.optString("TotalPrice", "0")) ? "0" : json.optString("TotalPrice", "0"))); |
| | | shopWarehouseItemMapper.insert(shopWarehouseItem); |
| | | } |
| | | //处理仓库 |
| | | public ShopWarehouse handleShopWarehouse(String name){ |
| | | ShopWarehouse shopWarehouse = new ShopWarehouse(); |
| | | shopWarehouse.setShopId(""); |
| | | shopWarehouse.setName(name); |
| | | shopWarehouse.setIsUp(0); |
| | | shopWarehouse.setIsSmall(0); |
| | | shopWarehouse.setIsAdmin(1); |
| | | shopWarehouse.setHisId(name); |
| | | shopWarehouse.setType(""); |
| | | shopWarehouse.setAdmin(""); |
| | | shopWarehouse.setGoodType(""); |
| | | shopWarehouse.setIsUse(1); |
| | | shopWarehouseMapper.insert(shopWarehouse); |
| | | return shopWarehouse; |
| | | } |
| | | |
| | | /** |
| | | * 更改erp库存批次表单 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result updateStockBatch(JSONObject jsonObject) { |
| | | |
| | | StringBuffer url=new StringBuffer(ErpUrl.UPDATE_BATCH+"?token="+erpConfig.getToken()); |
| | | |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Smallinventory",null))) |
| | | url.append("&Smallinventory="+jsonObject.optString("Smallinventory")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Stock",null))) |
| | | url.append("&Stock="+jsonObject.optString("Stock")); |
| | | |
| | | if(!StringUtils.isEmpty(jsonObject.optString("UnitPrice",null))) |
| | | url.append("&UnitPrice="+jsonObject.optString("UnitPrice")); |
| | | |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Accruals",null))) |
| | | url.append("&Accruals="+jsonObject.optString("Accruals")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Accumulated",null))) |
| | | url.append("&Accumulated="+jsonObject.optString("Accumulated")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("WarehouseID",null))) |
| | | url.append("&WarehouseID="+jsonObject.optString("WarehouseID")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Product",null))) |
| | | url.append("&Product="+jsonObject.optString("Product")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Batch",null))) |
| | | url.append("&Batch="+jsonObject.optString("Batch")); |
| | | |
| | | String result = HttpMethodUtil.HttpURLUtilJson(erpConfig.getUrl() + url, null, null, null, "GET"); |
| | | if(result!=null){ |
| | | JSONObject resultJson=JSONObject.fromObject(result); |
| | | if(resultJson.optString("code","500").equals("0")){ |
| | | return Result.success(resultJson.optString("data")); |
| | | }else { |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,result); |
| | | } |
| | | }else { |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,result); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Result insertRecord(JSONObject jsonObject) { |
| | | StringBuffer url=new StringBuffer(ErpUrl.INSERT_RECORD+"?token="+erpConfig.getToken()); |
| | | |
| | | if(!StringUtils.isEmpty(jsonObject.optString("WarehouseID",null))) |
| | | url.append("&WarehouseID="+jsonObject.optString("WarehouseID")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Productnumber",null))) |
| | | url.append("&Productnumber="+jsonObject.optString("Productnumber")); |
| | | |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Stock",null))) |
| | | url.append("&Stock="+jsonObject.optString("Stock")); |
| | | |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Batch",null))) |
| | | url.append("&Batch="+jsonObject.optString("Batch")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Unitprice",null))) |
| | | url.append("&Unitprice="+jsonObject.optString("Unitprice")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("TotalPrice",null))) |
| | | url.append("&TotalPrice="+jsonObject.optString("TotalPrice")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Changedby",null))) |
| | | url.append("&Changedby="+jsonObject.optString("Changedby")); |
| | | |
| | | String result = HttpMethodUtil.HttpURLUtilJson(erpConfig.getUrl() + url, null, null, null, "GET"); |
| | | if(result!=null){ |
| | | JSONObject resultJson=JSONObject.fromObject(result); |
| | | if(resultJson.optString("code","500").equals("0")){ |
| | | return Result.success(resultJson.optString("data")); |
| | | }else { |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,result); |
| | | } |
| | | }else { |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,result); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Result updateStockTable(JSONObject jsonObject) { |
| | | StringBuffer url=new StringBuffer(ErpUrl.UPDATE_INVENTORY_TABLE+"?token="+erpConfig.getToken()); |
| | | |
| | | if(!StringUtils.isEmpty(jsonObject.optString("WarehouseID",null))) |
| | | url.append("&WarehouseID="+jsonObject.optString("WarehouseID")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Productnumber",null))) |
| | | url.append("&Productnumber="+jsonObject.optString("Productnumber")); |
| | | |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Stock",null))) |
| | | url.append("&Stock="+jsonObject.optString("Stock")); |
| | | |
| | | if(!StringUtils.isEmpty(jsonObject.optString("SmallInventory",null))) |
| | | url.append("&SmallInventory="+jsonObject.optString("SmallInventory")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("Warehousing",null))) |
| | | url.append("&Warehousing="+jsonObject.optString("Warehousing")); |
| | | if(!StringUtils.isEmpty(jsonObject.optString("CumulativeOut",null))) |
| | | url.append("&CumulativeOut="+jsonObject.optString("CumulativeOut")); |
| | | String result = HttpMethodUtil.HttpURLUtilJson(erpConfig.getUrl() + url, null, null, null, "GET"); |
| | | if(result!=null){ |
| | | JSONObject resultJson=JSONObject.fromObject(result); |
| | | if(resultJson.optString("code","500").equals("0")){ |
| | | return Result.success(resultJson.optString("data")); |
| | | }else { |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,result); |
| | | } |
| | | }else { |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,result); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.his.service.GetTokenService; |
| | | import com.hx.phip.uti.ApiUtil; |
| | | import com.hx.phip.uti.WeiXinCorpMpUtil; |
| | | import com.hx.redis.RedisUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) |
| | | @Service |
| | | public class GetTokenServiceImpl implements GetTokenService { |
| | | private static Logger logger = LoggerFactory.getLogger(GetTokenServiceImpl.class); |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Override |
| | | public String getHisToken(SystemParameterMapper service, String appId, String code, String secret, String baseUrl) { |
| | | String at=null; |
| | | try { |
| | | at =ApiUtil.getOpenApiAccessToken(service, appId, code, secret, baseUrl); |
| | | }catch (Exception e){ |
| | | logger.error("获取领建token错误错误异常:",e); |
| | | } |
| | | |
| | | return at; |
| | | } |
| | | @Override |
| | | public String getKbjToken(SystemParameterMapper service, String appId, String code, String secret, String baseUrl) { |
| | | String at=null; |
| | | try { |
| | | at =ApiUtil.getKoapApiAccessToken(service, appId, code, secret, baseUrl); |
| | | }catch (Exception e){ |
| | | logger.info("获取康博嘉token错误错误异常:",e); |
| | | } |
| | | return at; |
| | | } |
| | | |
| | | @Override |
| | | public String getApplicationAccessToken(SystemParameterMapper systemParameterMapper, String corpId, String appSecret) { |
| | | String at=null; |
| | | try { |
| | | at = WeiXinCorpMpUtil.getApplicationAccessToken(systemParameterMapper, corpId, appSecret); |
| | | }catch (Exception e){ |
| | | logger.info("获取企业微信token错误异常:",e); |
| | | } |
| | | return at; |
| | | } |
| | | |
| | | /* @Override |
| | | public String getKbjToken(SystemParameterMapper service, String appId, String code, String secret, String baseUrl) { |
| | | |
| | | JSONObject tokens= (JSONObject) redisUtil.get(appId); |
| | | if(tokens==null){ |
| | | |
| | | } |
| | | |
| | | return at; |
| | | } |
| | | |
| | | |
| | | public String getNewKbjToken(String appId,String code,String secret,String baseUrl,int count){ |
| | | JSONObject param = new JSONObject(); |
| | | param.put("client_id", appId); |
| | | param.put("client_secret", secret); |
| | | param.put("grant_type", code); |
| | | String datas = HisHttpUtil.HttpURLUtilJson(baseUrl+ KoapUrl.OBTAIN_TOKEN, null, param, null, "POST"); |
| | | boolean resend=false; |
| | | String at=null; |
| | | if(!StringUtils.isEmpty(datas)) |
| | | { |
| | | JSONObject reObj = JSONObject.fromObject(datas); |
| | | if(reObj != null) |
| | | { |
| | | at = reObj.optString("access_token"); |
| | | if(!StringUtils.isEmpty(at)) |
| | | { |
| | | logger.info("重新获取token正常,准备校验获取的token"); |
| | | |
| | | }else{ |
| | | resend=true; |
| | | } |
| | | }else{ |
| | | resend=true; |
| | | } |
| | | }else{ |
| | | resend=true; |
| | | logger.error("获取token,返回没有"); |
| | | if(count<3){ |
| | | count++; |
| | | getNewKbjToken(appId,code,secret,baseUrl,count); |
| | | } |
| | | } |
| | | if(resend){ |
| | | logger.error("时间:{},获取第:{}次康博嘉token失败返回:{}",new Date(),count,datas); |
| | | if(count<3){ |
| | | count++; |
| | | getNewKbjToken(appId,code,secret,baseUrl,count); |
| | | } |
| | | } |
| | | return at; |
| | | |
| | | }*/ |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.dao.mapper.OrdersTotalMapper; |
| | | import com.hx.phiappt.dao.mapper.UserMapper; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.phiappt.model.order.OrdersTotal; |
| | | import com.hx.phip.his.config.CustomParameter; |
| | | import com.hx.phiappt.dao.mapper.HeartbeatReceiveMapper; |
| | | import com.hx.phiappt.model.sync.HeartbeatReceive; |
| | | import com.hx.phip.his.service.*; |
| | | import com.hx.phip.model.SyncBasicInformationRecord; |
| | | import com.hx.phip.model.SyncProjectRecord; |
| | | import com.hx.redis.RedisUtil; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.HttpMethodUtil; |
| | | import com.hx.util.StringUtils; |
| | | import com.hx.util.mysql.aes.MysqlHexAesTool; |
| | | import com.hz.his.dto.order.OrderRefundDto; |
| | | import com.hz.his.feign.service.platform.SPhipOrderService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | @Transactional |
| | | @Service |
| | | public class HeartbeatReceiveServiceImpl implements HeartbeatReceiveService { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(HeartbeatReceiveServiceImpl.class); |
| | | |
| | | @Resource |
| | | private SyncUserService syncUserService; |
| | | |
| | | @Resource |
| | | private UserMapper userMapper; |
| | | |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | |
| | | @Resource |
| | | private SyncProjectTreeService basicDataService; |
| | | @Resource |
| | | SyncEmployeeService syncEmployeeService; |
| | | @Resource |
| | | private SyncGoodsTreeService syncGoodsTreeService; |
| | | @Resource |
| | | private SyncOrderService syncOrderService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | @Resource |
| | | private CustomParameter customParameter; |
| | | @Resource |
| | | SyncWarehouseService syncWarehouseService; |
| | | |
| | | @Resource |
| | | private SPhipOrderService sPhipOrderService; |
| | | |
| | | @Resource |
| | | private OrdersTotalMapper ordersTotalMapper; |
| | | |
| | | private static String hashKey="subscription_template"; |
| | | |
| | | @Override |
| | | public Result addHeartbeatReceive(JSONObject jsonObject) { |
| | | String callbackUrl=jsonObject.getString("callbackUrl"); |
| | | String type=jsonObject.getString("type"); |
| | | |
| | | if(StringUtils.isEmpty(callbackUrl)) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"回调地址不能为空"); |
| | | if(StringUtils.isEmpty(type)) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"类型不能为空"); |
| | | Map<Object, Object> visitrecordMp = redisUtil.hashGetAll(hashKey); |
| | | Set<String> list=null; |
| | | for(Object key:visitrecordMp.keySet()){ |
| | | Object typeName = key; |
| | | if(type.equals(typeName)){ |
| | | list= (Set<String>) visitrecordMp.get(key); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | if(list==null){ |
| | | list=new HashSet<>(); |
| | | list.add(callbackUrl); |
| | | |
| | | }else { |
| | | list.add(callbackUrl); |
| | | } |
| | | redisUtil.hashSet(hashKey,type,list); |
| | | return Result.success(); |
| | | } |
| | | |
| | | /** |
| | | * 用户新增,修改,作废心跳 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void user(JSONArray jsonArray) { |
| | | String tpc=null; |
| | | String id=null; |
| | | User user=null; |
| | | HeartbeatReceive heartbeatReceive=null; |
| | | JSONObject jsonObject=null; |
| | | try { |
| | | Thread.sleep(60000);//休眠一分钟避免是我们这边创建过去的,出现两条重复的数据 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | tpc= jsonArray.getJSONObject(i).getString("tpc"); |
| | | heartbeatReceive=new HeartbeatReceive(tpc,jsonArray.toJSONString(),1); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | if("customer.created".equals(tpc) ){ |
| | | try { |
| | | Thread.sleep(120000);//新增情况想休眠两分钟,避免出现重复的领健id |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | syncUserService.syncUserById(jsonArray.getJSONObject(i).getString("eid")); |
| | | }else if("customer.modified".equals(tpc)){ |
| | | |
| | | User user1= syncUserService.syncUserById(jsonArray.getJSONObject(i).getString("eid")); |
| | | |
| | | jsonObject=new JSONObject(); |
| | | jsonObject.put("tel",MysqlHexAesTool.decryptData(user1.getTel(), customParameter.getAesFixedKey(),null)); |
| | | Map<Object, Object> visitrecordMp = redisUtil.hashGetAll(hashKey); |
| | | Set<String> list=null; |
| | | Object typeName=null; |
| | | for(Object key:visitrecordMp.keySet()){ |
| | | typeName = key; |
| | | if(tpc.equals(typeName)){ |
| | | list=(Set<String>) visitrecordMp.get(key); |
| | | for (String s : list) { |
| | | HttpMethodUtil.HttpURLUtilJson(s, jsonObject.toJSONString(), null, null, "POST"); |
| | | } |
| | | } |
| | | } |
| | | }else if("customer.deleted".equals(tpc)){ |
| | | //用户删除改变我们数据库对应的状态 |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | id= jsonArray.getJSONObject(i).getString("eid"); |
| | | sqlSentence.setSqlSentence("select * from user where isDel = 0 and apiId = #{m.id} "); |
| | | map.put("id", id); |
| | | user = userMapper.selectOne(sqlSentence); |
| | | if(user!=null){ |
| | | user.setIsDel(BaseEntity.YES); |
| | | userMapper.updateAll(user); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 项目修改 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void project(JSONArray jsonArray) { |
| | | String tpc=""; |
| | | String eid=null; |
| | | HeartbeatReceive heartbeatReceive=null; |
| | | JSONObject jsonObject=null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | jsonObject=new JSONObject(); |
| | | |
| | | tpc= jsonArray.getJSONObject(i).getString("tpc"); |
| | | eid= jsonArray.getJSONObject(i).getString("eid"); |
| | | jsonObject.put("id",eid); |
| | | heartbeatReceive=new HeartbeatReceive(tpc,jsonArray.toJSONString(),1); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | if("care-service.modified".equals(tpc) ){//项目 |
| | | try { |
| | | Thread.sleep(60000);//全部停两秒,避免预约系统修改事务提交太慢,心跳就把旧值给覆盖了 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | basicDataService.saveHisProjectById(eid); |
| | | }else if(tpc.indexOf("fusion-card")!=-1){//卡项 |
| | | try { |
| | | Thread.sleep(60000);//全部停两秒,避免预约系统修改事务提交太慢,心跳就把旧值给覆盖了 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | SyncProjectRecord syncProjectRecord=new SyncProjectRecord(4,3,0,0); |
| | | basicDataService.syncHisCardItem(net.sf.json.JSONObject.fromObject(jsonObject),syncProjectRecord); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 商品修改 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void commodity(JSONArray jsonArray) { |
| | | String tpc=""; |
| | | String eid=null; |
| | | HeartbeatReceive heartbeatReceive=null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | tpc= jsonArray.getJSONObject(i).getString("tpc"); |
| | | eid= jsonArray.getJSONObject(i).getString("eid"); |
| | | heartbeatReceive=new HeartbeatReceive(tpc,jsonArray.toJSONString(),1); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | if("product.created".equals(tpc) ){ |
| | | try { |
| | | Thread.sleep(60000);//全部停两秒,避免预约系统修改事务提交太慢,心跳就把旧值给覆盖了 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | syncGoodsTreeService.catalogProductGoodsById(eid); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 员工心跳 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void employee(JSONArray jsonArray) { |
| | | |
| | | String tpc=""; |
| | | String eid=null; |
| | | HeartbeatReceive heartbeatReceive=null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | tpc= jsonArray.getJSONObject(i).getString("tpc"); |
| | | eid= jsonArray.getJSONObject(i).getString("eid"); |
| | | heartbeatReceive=new HeartbeatReceive(tpc,jsonArray.toJSONString(),1); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | if(tpc.indexOf("employee")!=-1){ |
| | | try { |
| | | Thread.sleep(60000);//全部停两秒,避免预约系统修改事务提交太慢,心跳就把旧值给覆盖了 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | syncEmployeeService.syncEmployeeById(eid); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 订单心跳 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void order(JSONArray jsonArray) { |
| | | String tpc=""; |
| | | String eid=null; |
| | | HeartbeatReceive heartbeatReceive=null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | tpc= jsonArray.getJSONObject(i).getString("tpc"); |
| | | eid= jsonArray.getJSONObject(i).getString("eid"); |
| | | heartbeatReceive=new HeartbeatReceive(tpc,jsonArray.toJSONString(),1); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | if("order.refunded".equals(tpc)){ |
| | | String finalEid = eid; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | sqlSentence.setSqlSentence("select * from orders_total where hisOrderId = #{m.hisOrderId} AND isDel = 0 "); |
| | | map.put("hisOrderId", finalEid); |
| | | OrdersTotal ordersTotal=ordersTotalMapper.selectOne(sqlSentence); |
| | | |
| | | |
| | | OrderRefundDto orderRefundDto=new OrderRefundDto(); |
| | | orderRefundDto.setHisOrderId(finalEid); |
| | | logger.info("开始告诉phis订单退款:{}",finalEid); |
| | | if("3816410df04411ebb06bb8599f4cafbe".equals(ordersTotal.getUserId())){ |
| | | Result result= sPhipOrderService.synRefund(orderRefundDto,"PhiSkin"); |
| | | logger.info("开始告诉phis订单退款:{},返回:{}",finalEid, JSON.toJSONString(result)); |
| | | } |
| | | |
| | | } |
| | | }).start(); |
| | | }else if(tpc.indexOf("order")!=-1){ |
| | | if(tpc.indexOf("order.created")!=-1){ |
| | | try { |
| | | Thread.sleep(60000);//休眠一分钟避免是我们这边创建过去的,出现两条重复的数据 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | syncOrderService.syncSalesOrderById(eid); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 有新的物料变动产生 |
| | | * @param jsonArray |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void stockTransfer(JSONArray jsonArray) { |
| | | // logger.info("有新的物料变动产生:{}",jsonArray); |
| | | String tpc=""; |
| | | String eid=null; |
| | | HeartbeatReceive heartbeatReceive=null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | tpc= jsonArray.getJSONObject(i).getString("tpc"); |
| | | eid= jsonArray.getJSONObject(i).getString("eid"); |
| | | heartbeatReceive=new HeartbeatReceive(tpc,jsonArray.toJSONString(),1); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | if(tpc.indexOf("stock-transfer.created")!=-1){ |
| | | try { |
| | | Thread.sleep(60000);//全部停两秒,避免预约系统修改事务提交太慢,心跳就把旧值给覆盖了 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Set set= syncWarehouseService.getTransferRecord(eid); |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,11,0,0); |
| | | JSONObject object=new JSONObject(); |
| | | object.put("ids",set); |
| | | syncWarehouseService.inventoryGoods(net.sf.json.JSONObject.fromObject(object),syncBasicInformationRecord); |
| | | }else if(tpc.indexOf("stock-in.created")!=-1){ |
| | | try { |
| | | Thread.sleep(60000);//全部停两秒,避免预约系统修改事务提交太慢,心跳就把旧值给覆盖了 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Set set= syncWarehouseService.getinventoryEntryRecord(eid); |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,11,0,0); |
| | | JSONObject object=new JSONObject(); |
| | | object.put("ids",set); |
| | | syncWarehouseService.inventoryGoods(net.sf.json.JSONObject.fromObject(object),syncBasicInformationRecord); |
| | | }else if(tpc.indexOf("stock-out.created")!=-1){ |
| | | try { |
| | | Thread.sleep(60000);//全部停两秒,避免预约系统修改事务提交太慢,心跳就把旧值给覆盖了 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Set set= syncWarehouseService.getinventoryOutRecord(eid); |
| | | SyncBasicInformationRecord syncBasicInformationRecord=new SyncBasicInformationRecord(1,11,0,0); |
| | | JSONObject object=new JSONObject(); |
| | | object.put("ids",set); |
| | | syncWarehouseService.inventoryGoods(net.sf.json.JSONObject.fromObject(object),syncBasicInformationRecord); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import com.hx.phip.dao.mapper.syn.*; |
| | | import com.hx.phip.his.service.*; |
| | | import com.hx.phip.model.HisAccountJournal; |
| | | import com.hx.phip.model.HisExecutionRecord; |
| | | import com.hx.phip.model.HisOrderItem; |
| | | import com.hx.phip.model.HisVisitRecord; |
| | | import com.hx.util.DateUtil; |
| | | import com.mongodb.BasicDBObject; |
| | | import com.mongodb.DBObject; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.BasicQuery; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * @Author 领建初始化接口 |
| | | */ |
| | | @Service |
| | | public class HisInitializeDataServiceImpl implements HisInitializeDataService { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(HisInitializeDataServiceImpl.class); |
| | | // @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | @Resource |
| | | private SyncVisitRecordService syncVisitRecordService; |
| | | @Resource |
| | | private SyncExecutionRecordNewService syncExecutionRecordNewService; |
| | | @Resource |
| | | private SyncNewUserService syncNewUserService; |
| | | /** |
| | | * 同步所有到访记录 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void visitRecord() { |
| | | |
| | | Integer pageSize=1; |
| | | Query query = new Query(); |
| | | Criteria criteria=new Criteria(); |
| | | criteria.and("metadata.tenantId").is("0001"); |
| | | query.addCriteria(criteria); |
| | | long total= mongoTemplate.count(query, Map.class,"analytic-visit"); |
| | | Integer pageCount= Math.toIntExact(total / pageSize + 1); |
| | | logger.info("初始化所有到访记录页数:{},条数:{}",pageCount,total); |
| | | //开20个线程池处理其它页 |
| | | int threadSize=20; |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(threadSize); |
| | | try { |
| | | for(int i = 1;i <= pageCount;i ++) |
| | | { |
| | | Integer pageNum=i; |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | try { |
| | | handleVisitRecord(pageNum,pageSize); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | logger.info("同步到访数据报错第几页:{}",pageNum); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | threadPool.shutdown(); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void handleVisitRecord(Integer pageNum,Integer pageSize) { |
| | | |
| | | |
| | | /* DBObject dbObject = new BasicDBObject(); |
| | | DBObject fieldObject = new BasicDBObject(); |
| | | fieldObject.put("_id", true); |
| | | fieldObject.put("customer", true); |
| | | fieldObject.put("organization", true); |
| | | fieldObject.put("arriveTime", true); |
| | | fieldObject.put("receptTime", true); |
| | | fieldObject.put("leaveTime", true); |
| | | Query query = new BasicQuery(dbObject.toString(), fieldObject.toString());*/ |
| | | Query query = new Query(); |
| | | Criteria criteria=new Criteria(); |
| | | criteria.and("metadata.tenantId").is("0001"); |
| | | query.with(Sort.by(Sort.Direction.ASC, "_id")); |
| | | query.with(PageRequest.of(pageNum - 1, pageSize)); |
| | | query.addCriteria(criteria); |
| | | List<BasicDBObject> maps = mongoTemplate.find(query, BasicDBObject.class, "analytic-visit"); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | | sqlSentence.setSqlSentence("select * from his_v_visit_record WHERE hisId = #{m.hisId} "); |
| | | |
| | | HisVisitRecord hisVisitRecord; |
| | | for (BasicDBObject map : maps) { |
| | | |
| | | try{ |
| | | sqlMap.put("hisId",map.get("_id")); |
| | | hisVisitRecord=syncTransactioalService.selectOne(HisVisitRecordMapper.class,sqlSentence); |
| | | if(hisVisitRecord==null){ |
| | | hisVisitRecord=new HisVisitRecord(); |
| | | hisVisitRecord.setHisId(String.valueOf(map.get("_id"))); |
| | | hisVisitRecord.setUserId(JSONObject.fromObject(map).optJSONObject("customer").optString("_id")); |
| | | hisVisitRecord.setUserName(JSONObject.fromObject(map).optJSONObject("customer").optString("name")); |
| | | hisVisitRecord.setShopId(JSONObject.fromObject(map).optJSONObject("organization").optString("_id")); |
| | | hisVisitRecord.setShopName(JSONObject.fromObject(map).optJSONObject("organization").optString("name")); |
| | | hisVisitRecord.setArrivalTime(DateUtil.timestampToDate(JSONObject.fromObject(map).optJSONObject("arriveTime").optLong("time"),"")); |
| | | hisVisitRecord.setReceptTime(map.get("receptTime")==null?null:DateUtil.timestampToDate(JSONObject.fromObject(map).optJSONObject("receptTime").optLong("time"),"")); |
| | | hisVisitRecord.setLeaveTime(map.get("leaveTime")==null?null:DateUtil.timestampToDate(JSONObject.fromObject(map).optJSONObject("leaveTime").optLong("time"),"")); |
| | | syncTransactioalService.insert(HisVisitRecordMapper.class,hisVisitRecord); |
| | | }else { |
| | | hisVisitRecord.setUserId(JSONObject.fromObject(map).optJSONObject("customer").optString("_id")); |
| | | hisVisitRecord.setUserName(JSONObject.fromObject(map).optJSONObject("customer").optString("name")); |
| | | hisVisitRecord.setShopId(JSONObject.fromObject(map).optJSONObject("organization").optString("_id")); |
| | | hisVisitRecord.setShopName(JSONObject.fromObject(map).optJSONObject("organization").optString("name")); |
| | | hisVisitRecord.setArrivalTime(DateUtil.timestampToDate(JSONObject.fromObject(map).optJSONObject("arriveTime").optLong("time"),"")); |
| | | hisVisitRecord.setReceptTime(map.get("receptTime")==null?null:DateUtil.timestampToDate(JSONObject.fromObject(map).optJSONObject("receptTime").optLong("time"),"")); |
| | | hisVisitRecord.setLeaveTime(map.get("leaveTime")==null?null:DateUtil.timestampToDate(JSONObject.fromObject(map).optJSONObject("leaveTime").optLong("time"),"")); |
| | | hisVisitRecord.setWhetherToHandle(0); |
| | | syncTransactioalService.update(HisVisitRecordMapper.class,hisVisitRecord); |
| | | } |
| | | }catch (Exception e){ |
| | | logger.info("同步到访记录:{},失败",map.get("_id")); |
| | | } |
| | | |
| | | } |
| | | } |
| | | @Override |
| | | public void hisOrderItem() { |
| | | Integer pageSize=1; |
| | | Query query = new Query(); |
| | | Criteria criteria=new Criteria(); |
| | | criteria.and("metadata.tenantId").is("0001"); |
| | | criteria.and("item.type").is("service"); |
| | | criteria.and("_id").is("ac343beaa0c34602bac900834cbe4542"); |
| | | query.addCriteria(criteria); |
| | | long total= mongoTemplate.count(query, Map.class,"his-order-item"); |
| | | Integer pageCount= Math.toIntExact(total / pageSize + 1); |
| | | logger.info("初始化所有未执行记录页数:{},条数:{}",pageCount,total); |
| | | |
| | | //开20个线程池处理其它页 |
| | | int threadSize=20; |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(threadSize); |
| | | try { |
| | | for(int i = 1;i <= pageCount;i ++) |
| | | { |
| | | Integer pageNum=i; |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | try { |
| | | logger.info("同步未执行记录数据第{}页",pageNum); |
| | | handleHisOrderItem(pageNum,pageSize); |
| | | }catch (Exception e){ |
| | | logger.info("同步未执行记录数据报错第几页:{}",pageNum); |
| | | } |
| | | } |
| | | }); |
| | | if(i%1000==0){ |
| | | try { |
| | | Thread.sleep(5000);//每跑一千条等待5秒,避免线程堵塞 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | threadPool.shutdown(); |
| | | } |
| | | } |
| | | |
| | | public void handleHisOrderItem(Integer pageNum,Integer pageSize) { |
| | | Query query = new Query(); |
| | | Criteria criteria=new Criteria(); |
| | | criteria.and("metadata.tenantId").is("0001"); |
| | | criteria.and("item.type").is("service"); |
| | | criteria.and("_id").is("ac343beaa0c34602bac900834cbe4542"); |
| | | //db.getCollection("his-order-item").find({"metadata.tenantId" : "0001","item.type":"service"}).sort({'metadata.createTimestamp': 1}).limit(5) |
| | | query.with(Sort.by(Sort.Direction.ASC, "_id")); |
| | | query.with(PageRequest.of(pageNum - 1, pageSize)); |
| | | query.addCriteria(criteria); |
| | | List<BasicDBObject> maps = mongoTemplate.find(query, BasicDBObject.class, "his-order-item"); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | | sqlSentence.setSqlSentence("select * from his_order_item WHERE itemId = #{m.itemId} "); |
| | | |
| | | HisOrderItem hisOrderItem; |
| | | for (BasicDBObject map : maps) { |
| | | |
| | | try{ |
| | | |
| | | String itemId=map.get("_id")==null?null:String.valueOf(map.get("_id")); |
| | | String orderId =map.get("orderId")==null?null:String.valueOf(map.get("orderId"));//订单号 |
| | | String transferId=map.get("transferId")==null?null:String.valueOf(map.get("transferId"));//转增id |
| | | |
| | | JSONObject items=map.get("item")==null?null:JSONObject.fromObject(map.get("item")); |
| | | String item = items.toString();//条目信息 |
| | | |
| | | JSONObject sku=new JSONObject(); |
| | | sku.put("skuId",map.get("skuId")==null?null:String.valueOf(map.get("skuId"))); |
| | | sku.put("skuName",map.get("skuName")==null?null:String.valueOf(map.get("skuName"))); |
| | | String skuInfo =sku.toString();//订单行SKU |
| | | |
| | | String amount = items.optString("totalTransactionPrice")==null?null:items.optString("totalTransactionPrice");//执行总金额 |
| | | |
| | | String remain = items.optJSONObject("amortization").optJSONArray("payment").toString();//未执行划扣金额 |
| | | |
| | | String clinic=map.get("organization")==null?null:JSONObject.fromObject(map.get("organization")).toString();//门店集合 |
| | | |
| | | String customer=map.get("customer")==null?null:JSONObject.fromObject(map.get("customer")).toString();//客户集合 |
| | | |
| | | String totalTimes=items.optString("executableNumber")==null?null:items.optString("executableNumber");//可执行总次数 |
| | | String quantity=items.optString("quantity")==null?null:items.optString("quantity");//可执行总次数(冗余) |
| | | String refunded=items.optString("refunded")==null?null:items.optString("refunded");//退款次数 |
| | | String executedNumber=items.optString("executedNumber")==null?null:items.optString("executedNumber");//已执行次数 |
| | | String leftTimes=String.valueOf(Integer.parseInt(items.optString("executableNumber"))-Integer.parseInt(items.optString("refunded"))-Integer.parseInt(items.optString("executedNumber")));//已执行次数 |
| | | |
| | | String status=map.get("status")==null?null:JSONObject.fromObject(map.get("status")).optJSONArray("codes").toString();//状态 |
| | | String type=map.get("type")==null?null:String.valueOf(map.get("type"));//项目类型 |
| | | |
| | | String createdAt=map.get("orderTime")==null?null:DateUtil.formatDate_2(DateUtil.timestampToDate(JSONObject.fromObject(map.get("orderTime")).optLong("time"),""));//创建时间 |
| | | |
| | | |
| | | |
| | | sqlMap.put("itemId",itemId); |
| | | hisOrderItem=syncTransactioalService.selectOne(HisOrderItemMapper.class,sqlSentence); |
| | | if(hisOrderItem==null){ |
| | | hisOrderItem=new HisOrderItem(itemId,orderId,transferId,item,skuInfo,amount,remain,clinic,customer,totalTimes,quantity |
| | | ,refunded,executedNumber,leftTimes,status,type,createdAt); |
| | | syncTransactioalService.insert(HisOrderItemMapper.class,hisOrderItem); |
| | | }else { |
| | | hisOrderItem.setAmount(amount); |
| | | hisOrderItem.setRemain(remain); |
| | | hisOrderItem.setClinic(clinic); |
| | | hisOrderItem.setTotalTimes(totalTimes); |
| | | hisOrderItem.setQuantity(quantity); |
| | | hisOrderItem.setRefunded(refunded); |
| | | hisOrderItem.setExecutedNumber(executedNumber); |
| | | hisOrderItem.setLeftTimes(leftTimes); |
| | | hisOrderItem.setStatus(status); |
| | | hisOrderItem.setType(type); |
| | | hisOrderItem.setWhetherToHandle(0); |
| | | syncTransactioalService.update(HisOrderItemMapper.class,hisOrderItem); |
| | | } |
| | | }catch (Exception e){ |
| | | logger.info("同步未执行记录页数:{}:{},失败",pageNum,map.get("_id")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 同步所有执行项目 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void hisExecutionRecord() { |
| | | Integer pageSize=1; |
| | | Query query = new Query(); |
| | | Criteria criteria=new Criteria(); |
| | | criteria.and("metadata.tenantId").is("0001"); |
| | | query.addCriteria(criteria); |
| | | long total= mongoTemplate.count(query, Map.class,"his-execution-record"); |
| | | Integer pageCount= Math.toIntExact(total / pageSize + 1); |
| | | logger.info("初始化所有执行记录页数:{},条数:{}",pageCount,total); |
| | | |
| | | //开20个线程池处理其它页 |
| | | int threadSize=20; |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(threadSize); |
| | | try { |
| | | for(int i = 435800;i <= pageCount;i ++) |
| | | { |
| | | Integer pageNum=i; |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | try { |
| | | logger.info("同步执行记录数据第{}页",pageNum); |
| | | handleHisExecutionRecord(pageNum,pageSize); |
| | | }catch (Exception e){ |
| | | logger.info("同步执行记录数据报错第几页:{}",pageNum); |
| | | } |
| | | } |
| | | }); |
| | | if(i%1000==0){ |
| | | try { |
| | | Thread.sleep(5000);//每跑一千条等待5秒,避免线程堵塞 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | threadPool.shutdown(); |
| | | } |
| | | } |
| | | |
| | | |
| | | public void handleHisExecutionRecord(Integer pageNum,Integer pageSize) { |
| | | Query query = new Query(); |
| | | Criteria criteria=new Criteria(); |
| | | criteria.and("metadata.tenantId").is("0001"); |
| | | //db.getCollection("his-execution-record").find({"metadata.tenantId" : "0001"}).sort({'metadata.createTimestamp': 1}).limit(5) |
| | | query.with(Sort.by(Sort.Direction.ASC, "_id")); |
| | | query.with(PageRequest.of(pageNum - 1, pageSize)); |
| | | query.addCriteria(criteria); |
| | | List<BasicDBObject> maps = mongoTemplate.find(query, BasicDBObject.class, "his-execution-record"); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | | sqlSentence.setSqlSentence("select * from his_execution_record WHERE hisId = #{m.hisId} "); |
| | | |
| | | HisExecutionRecord hisExecutionRecord; |
| | | for (BasicDBObject map : maps) { |
| | | try { |
| | | String hisId=map.get("_id")==null?null:String.valueOf(map.get("_id")); |
| | | String number=map.get("number")==null?null:String.valueOf(map.get("number")); |
| | | |
| | | JSONObject item= (JSONObject) JSONArray.fromObject(map.get("items")).get(0); |
| | | String itemId=item.optString("itemId"); |
| | | |
| | | JSONArray payments=item.optJSONObject("service").optJSONArray("payments"); |
| | | Integer amounts=0; |
| | | for (Object payment : payments) { |
| | | JSONObject types= (JSONObject) payment; |
| | | if("xsdk".equals(types.optJSONObject("type").optString("value"))){ |
| | | continue; |
| | | } |
| | | amounts=amounts+Integer.parseInt(JSONObject.fromObject(payment).optString("amount")); |
| | | } |
| | | String amount; |
| | | if(amounts>0){ |
| | | amount=String.valueOf(new BigDecimal(amounts).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP)); |
| | | }else { |
| | | amount="0"; |
| | | } |
| | | String executedDate=DateUtil.formatDate_2(DateUtil.timestampToDate(JSONObject.fromObject(map).optJSONObject("metadata").optJSONObject("createTimestamp").optLong("time"),""));//创建时间 |
| | | String note=map.get("note")==null?null:String.valueOf(map.get("note")); |
| | | String customer=map.get("customer")==null?null:JSONObject.fromObject(map.get("customer")).toString();//门店集合 |
| | | String clinic=map.get("organization")==null?null:JSONObject.fromObject(map.get("organization")).toString();//门店集合 |
| | | String cancelled=JSONObject.fromObject(map.get("metadata")).optString("state"); |
| | | String cancelledDate=map.get("cancelledAt")==null?null:DateUtil.formatDate_2(DateUtil.timestampToDate(JSONObject.fromObject(map.get("cancelledAt")).optLong("time"),"")); |
| | | |
| | | |
| | | JSONObject creators=new JSONObject(); |
| | | creators.put("id",JSONObject.fromObject(map.get("metadata")).optString("createBy")); |
| | | creators.put("name",""); |
| | | String creator=creators.toString(); |
| | | |
| | | String quantity=item.optJSONObject("service").optString("quantity"); |
| | | String medicalDepartment=map.get("medicalDepartment")==null?null:JSONObject.fromObject(map.get("medicalDepartment")).toString(); |
| | | String participants=map.get("operators")==null?null:JSONArray.fromObject(map.get("operators")).toString(); |
| | | String costItems=map.get("costs")==null?null:JSONArray.fromObject(map.get("costs")).toString(); |
| | | String devices=map.get("devices")==null?null:JSONArray.fromObject(map.get("devices")).toString(); |
| | | |
| | | sqlMap.put("hisId",hisId); |
| | | hisExecutionRecord=syncTransactioalService.selectOne(HisExecutionRecordMapper.class,sqlSentence); |
| | | if(hisExecutionRecord==null){ |
| | | hisExecutionRecord=new HisExecutionRecord(hisId,itemId,number,amount,executedDate,note,customer,clinic,cancelled,cancelledDate, |
| | | creator,quantity,medicalDepartment,participants,costItems,devices); |
| | | syncTransactioalService.insert(HisExecutionRecordMapper.class,hisExecutionRecord); |
| | | }else { |
| | | hisExecutionRecord.setNumber(number); |
| | | hisExecutionRecord.setAmount(amount); |
| | | hisExecutionRecord.setExecutedDate(executedDate); |
| | | hisExecutionRecord.setNote(note); |
| | | hisExecutionRecord.setCustomer(customer); |
| | | hisExecutionRecord.setClinic(clinic); |
| | | hisExecutionRecord.setCancelled(cancelled); |
| | | hisExecutionRecord.setCancelledDate(cancelledDate); |
| | | hisExecutionRecord.setCreator(creator); |
| | | hisExecutionRecord.setQuantity(quantity); |
| | | hisExecutionRecord.setMedicalDepartment(medicalDepartment); |
| | | hisExecutionRecord.setParticipants(participants); |
| | | hisExecutionRecord.setCostItems(costItems); |
| | | hisExecutionRecord.setDevices(devices); |
| | | hisExecutionRecord.setWhetherToHandle(0); |
| | | syncTransactioalService.update(HisExecutionRecordMapper.class,hisExecutionRecord); |
| | | } |
| | | }catch (Exception e){ |
| | | logger.info("同步执行记录:{},失败",map.get("_id")); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 同步所有资金变动记录 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void hisAccountJournal() { |
| | | Query query = new Query(); |
| | | Criteria criteria=new Criteria(); |
| | | criteria.and("metadata.tenantId").is("0001"); |
| | | // criteria.and("customerId").is("495103a2a737400fad6fdc37b102333a"); |
| | | query.with(Sort.by(Sort.Direction.ASC, "_id")); |
| | | query.addCriteria(criteria); |
| | | |
| | | int pageNum=1; |
| | | int pageSize=20; |
| | | List<BasicDBObject> maps; |
| | | //开20个线程池处理其它页 |
| | | int threadSize=20; |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(threadSize); |
| | | do { |
| | | logger.info("开始跑第{}页",pageNum); |
| | | query.with(PageRequest.of(pageNum - 1, pageSize)); |
| | | maps = mongoTemplate.find(query, BasicDBObject.class, "core-account-journal"); |
| | | try { |
| | | for (BasicDBObject map : maps) |
| | | { |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | try { |
| | | handleHisAccountJournal(map); |
| | | }catch (Exception e){ |
| | | logger.info("同步资金记录数据报错第几页:{}"); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | |
| | | } |
| | | pageNum++; |
| | | }while (maps.size()==pageSize); |
| | | |
| | | threadPool.shutdown(); |
| | | |
| | | } |
| | | public void handleHisAccountJournal(BasicDBObject map) { |
| | | try { |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | | sqlSentence.setSqlSentence("select * from his_account_journal WHERE hisId = #{m.hisId} "); |
| | | |
| | | HisAccountJournal hisAccountJournal; |
| | | String hisId=map.get("_id")==null?null:String.valueOf(map.get("_id")); |
| | | String customerId=map.get("customerId")==null?null:String.valueOf(map.get("customerId")); |
| | | String createTimestamp=DateUtil.formatDate_2(DateUtil.timestampToDate(JSONObject.fromObject(map).optJSONObject("metadata").optJSONObject("createTimestamp").optLong("time"),""));//创建时间 |
| | | Integer opType=null; |
| | | String type=null; |
| | | BigDecimal opNumber=BigDecimal.ZERO; |
| | | BigDecimal opAfterNumber=BigDecimal.ZERO; |
| | | BigDecimal opBeforeNumber=BigDecimal.ZERO; |
| | | if(map.get("debit")!=null){ |
| | | //增加 |
| | | opType = HisAccountJournal.OP_TYPE_INCREASE; |
| | | type=JSONObject.fromObject(map).optJSONObject("debit").optJSONObject("type").optString("displayText"); |
| | | if("积分".equals(type)){ |
| | | opNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("debit").optString("amount")); |
| | | opAfterNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("balance").optString("amount")); |
| | | }else if("增值金".equals(type) || "储值金".equals(type)){ |
| | | opNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("debit").optString("amount")).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP); |
| | | opAfterNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("balance").optString("amount")).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP); |
| | | }else { |
| | | return; |
| | | } |
| | | opBeforeNumber=opAfterNumber.subtract(opNumber); |
| | | }else if(map.get("credit")!=null){ |
| | | //减少 |
| | | opType = HisAccountJournal.OP_TYPE_REDUCE; |
| | | type=JSONObject.fromObject(map).optJSONObject("credit").optJSONObject("type").optString("displayText"); |
| | | if("积分".equals(type)){ |
| | | opNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("credit").optString("amount")); |
| | | opAfterNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("balance").optString("amount")); |
| | | }else if("增值金".equals(type) || "储值金".equals(type)){ |
| | | opNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("credit").optString("amount")).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP); |
| | | opAfterNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("balance").optString("amount")).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP); |
| | | }else { |
| | | return; |
| | | } |
| | | opBeforeNumber=opAfterNumber.add(opNumber); |
| | | } |
| | | String recordType=JSONObject.fromObject(map).optJSONObject("type").optString("displayText"); |
| | | String operatorId=JSONObject.fromObject(map).optJSONObject("metadata").optString("createBy"); |
| | | String remarks=JSONObject.fromObject(map).optString("note"); |
| | | |
| | | sqlMap.put("hisId",hisId); |
| | | hisAccountJournal=syncTransactioalService.selectOne(HisAccountJournalMapper.class,sqlSentence); |
| | | if(hisAccountJournal==null){ |
| | | hisAccountJournal=new HisAccountJournal(hisId,customerId,createTimestamp,type,recordType,opType,opNumber,opBeforeNumber,opAfterNumber,operatorId,remarks); |
| | | syncTransactioalService.insert(HisAccountJournalMapper.class,hisAccountJournal); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /* *//** |
| | | * 同步所有资金变动记录 |
| | | * @return |
| | | *//* |
| | | @Override |
| | | public void hisAccountJournal() { |
| | | Integer pageSize=1; |
| | | Query query = new Query(); |
| | | Criteria criteria=new Criteria(); |
| | | criteria.and("metadata.tenantId").is("0001"); |
| | | criteria.and("customerId").is("495103a2a737400fad6fdc37b102333a"); |
| | | query.addCriteria(criteria); |
| | | long total= mongoTemplate.count(query, Map.class,"core-account-journal"); |
| | | Integer pageCount= Math.toIntExact(total / pageSize + 1); |
| | | logger.info("初始化所有资金记录页数:{},条数:{}",pageCount,total); |
| | | |
| | | //开20个线程池处理其它页 |
| | | int threadSize=100; |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(threadSize); |
| | | |
| | | int startNum=0; |
| | | int endNum=1000; |
| | | |
| | | while (endNum<pageCount){ |
| | | if(startNum!=0){ |
| | | startNum+=1000; |
| | | endNum+=1000; |
| | | } |
| | | if(startNum==0){ |
| | | startNum=1; |
| | | } |
| | | try { |
| | | for(int i = startNum;i <= endNum;i ++) |
| | | { |
| | | Integer pageNum=i; |
| | | threadPool.execute(new Runnable() { |
| | | public void run() { |
| | | try { |
| | | logger.info("同步资金记录数据第{}页",pageNum); |
| | | handleHisAccountJournal(pageNum,pageSize); |
| | | }catch (Exception e){ |
| | | logger.info("同步资金记录数据报错第几页:{}",pageNum); |
| | | } |
| | | } |
| | | }); |
| | | if(i%1000==0){ |
| | | try { |
| | | Thread.sleep(5000);//每跑一千条等待5秒,避免线程堵塞 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | threadPool.shutdown(); |
| | | } |
| | | } |
| | | |
| | | do { |
| | | |
| | | }while (endNum<pageCount); |
| | | |
| | | }*/ |
| | | |
| | | /* public void handleHisAccountJournal(Integer pageNum,Integer pageSize) { |
| | | Query query = new Query(); |
| | | Criteria criteria=new Criteria(); |
| | | criteria.and("metadata.tenantId").is("0001"); |
| | | criteria.and("customerId").is("495103a2a737400fad6fdc37b102333a"); |
| | | query.with(Sort.by(Sort.Direction.ASC, "_id")); |
| | | query.with(PageRequest.of(pageNum - 1, pageSize)); |
| | | query.addCriteria(criteria); |
| | | List<BasicDBObject> maps = mongoTemplate.find(query, BasicDBObject.class, "core-account-journal"); |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | | sqlSentence.setSqlSentence("select * from his_account_journal WHERE hisId = #{m.hisId} "); |
| | | |
| | | HisAccountJournal hisAccountJournal; |
| | | for (BasicDBObject map : maps) { |
| | | try { |
| | | String hisId=map.get("_id")==null?null:String.valueOf(map.get("_id")); |
| | | String customerId=map.get("customerId")==null?null:String.valueOf(map.get("customerId")); |
| | | String createTimestamp=DateUtil.formatDate_2(DateUtil.timestampToDate(JSONObject.fromObject(map).optJSONObject("metadata").optJSONObject("createTimestamp").optLong("time"),""));//创建时间 |
| | | Integer opType=null; |
| | | String type=null; |
| | | BigDecimal opNumber=BigDecimal.ZERO; |
| | | BigDecimal opAfterNumber=BigDecimal.ZERO; |
| | | BigDecimal opBeforeNumber=BigDecimal.ZERO; |
| | | if(map.get("debit")!=null){ |
| | | //增加 |
| | | opType = HisAccountJournal.OP_TYPE_INCREASE; |
| | | type=JSONObject.fromObject(map).optJSONObject("debit").optJSONObject("type").optString("displayText"); |
| | | if("积分".equals(type)){ |
| | | opNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("debit").optString("amount")); |
| | | opAfterNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("balance").optString("amount")); |
| | | }else if("增值金".equals(type) || "储值金".equals(type)){ |
| | | opNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("debit").optString("amount")).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP); |
| | | opAfterNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("balance").optString("amount")).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP); |
| | | }else { |
| | | continue; |
| | | } |
| | | opBeforeNumber=opAfterNumber.subtract(opNumber); |
| | | }else if(map.get("credit")!=null){ |
| | | //减少 |
| | | opType = HisAccountJournal.OP_TYPE_REDUCE; |
| | | type=JSONObject.fromObject(map).optJSONObject("credit").optJSONObject("type").optString("displayText"); |
| | | if("积分".equals(type)){ |
| | | opNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("credit").optString("amount")); |
| | | opAfterNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("balance").optString("amount")); |
| | | }else if("增值金".equals(type) || "储值金".equals(type)){ |
| | | opNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("credit").optString("amount")).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP); |
| | | opAfterNumber=new BigDecimal(JSONObject.fromObject(map).optJSONObject("balance").optString("amount")).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP); |
| | | }else { |
| | | continue; |
| | | } |
| | | opBeforeNumber=opAfterNumber.add(opNumber); |
| | | } |
| | | String recordType=JSONObject.fromObject(map).optJSONObject("type").optString("displayText"); |
| | | String operatorId=JSONObject.fromObject(map).optJSONObject("metadata").optString("createBy"); |
| | | String remarks=JSONObject.fromObject(map).optString("note"); |
| | | |
| | | sqlMap.put("hisId",hisId); |
| | | hisAccountJournal=syncTransactioalService.selectOne(HisAccountJournalMapper.class,sqlSentence); |
| | | if(hisAccountJournal==null){ |
| | | hisAccountJournal=new HisAccountJournal(hisId,customerId,createTimestamp,type,recordType,opType,opNumber,opBeforeNumber,opAfterNumber,operatorId,remarks); |
| | | syncTransactioalService.insert(HisAccountJournalMapper.class,hisAccountJournal); |
| | | } |
| | | }catch (Exception e){ |
| | | logger.info("同步自资金记录:{},失败",map.get("_id")); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | */ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 转换到访记录 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void phisVisitRecord() { |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | | Integer number=10;//条数 |
| | | sqlMap.put("number",number); |
| | | sqlMap.put("whetherToHandle",BaseEntity.NO); |
| | | List<HisVisitRecord> hisVisitRecords; |
| | | do { |
| | | sqlSentence.setSqlSentence("SELECT * FROM his_v_visit_record WHERE whetherToHandle=#{m.whetherToHandle} ORDER BY arrivalTime LIMIT #{m.number} "); |
| | | hisVisitRecords=syncTransactioalService.selectList(HisVisitRecordMapper.class,sqlSentence); |
| | | for (HisVisitRecord hisVisitRecord : hisVisitRecords) { |
| | | try { |
| | | syncVisitRecordService.handleVisitRecord(hisVisitRecord); |
| | | hisVisitRecord.setWhetherToHandle(BaseEntity.YES); |
| | | |
| | | }catch (Exception e){ |
| | | hisVisitRecord.setWhetherToHandle(2); |
| | | logger.error("转换到访失败",e); |
| | | } |
| | | syncTransactioalService.update(HisVisitRecordMapper.class,hisVisitRecord); |
| | | |
| | | } |
| | | |
| | | }while (hisVisitRecords.size()==number); |
| | | |
| | | } |
| | | /** |
| | | * 转换未执行项目记录 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void phisOrderItem() { |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | | Integer number=10;//条数 |
| | | sqlMap.put("number",number); |
| | | sqlMap.put("whetherToHandle",BaseEntity.NO); |
| | | List<HisOrderItem> hisOrderItems; |
| | | do { |
| | | sqlSentence.setSqlSentence("SELECT * FROM his_order_item WHERE whetherToHandle=#{m.whetherToHandle} ORDER BY createdAt LIMIT #{m.number} "); |
| | | hisOrderItems=syncTransactioalService.selectList(HisOrderItemMapper.class,sqlSentence); |
| | | JSONObject jsonObject; |
| | | JSONObject hisItem; |
| | | JSONObject item; |
| | | JSONObject hisSkuInfo; |
| | | JSONObject skuInfo; |
| | | JSONArray remainArray; |
| | | JSONObject hisClinic; |
| | | JSONObject clinic; |
| | | JSONArray status; |
| | | JSONObject hisCustomer; |
| | | JSONObject customer; |
| | | for (HisOrderItem hisOrderItem : hisOrderItems) { |
| | | jsonObject=new JSONObject(); |
| | | jsonObject.put("id",hisOrderItem.getItemId()); |
| | | jsonObject.put("orderId",hisOrderItem.getOrderId()); |
| | | |
| | | hisItem=JSONObject.fromObject(hisOrderItem.getItem()); |
| | | item=new JSONObject(); |
| | | item.put("id",hisItem.optString("_id")); |
| | | item.put("name",hisItem.optString("name")); |
| | | jsonObject.put("item",item); |
| | | |
| | | hisSkuInfo=JSONObject.fromObject(hisOrderItem.getSkuInfo()); |
| | | skuInfo=new JSONObject(); |
| | | skuInfo.put("id",hisSkuInfo.optString("skuId")); |
| | | skuInfo.put("name",hisSkuInfo.optString("skuName")); |
| | | jsonObject.put("skuInfo",skuInfo); |
| | | |
| | | jsonObject.put("amount",new BigDecimal(hisOrderItem.getAmount()).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP) ); |
| | | |
| | | remainArray=JSONArray.fromObject(hisOrderItem.getRemain()); |
| | | Integer amounts=0; |
| | | for (Object payment : remainArray) { |
| | | amounts=amounts+Integer.parseInt(JSONObject.fromObject(payment).optString("amount")); |
| | | } |
| | | String amount; |
| | | if(amounts>0){ |
| | | amount=String.valueOf(new BigDecimal(amounts).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP)); |
| | | }else { |
| | | amount="0"; |
| | | } |
| | | jsonObject.put("remain",amount); |
| | | |
| | | jsonObject.put("transferId",hisOrderItem.getTransferId()); |
| | | |
| | | hisClinic=JSONObject.fromObject(hisOrderItem.getClinic()); |
| | | clinic=new JSONObject(); |
| | | clinic.put("id",hisClinic.optString("_id")); |
| | | clinic.put("name",hisClinic.optString("name")); |
| | | jsonObject.put("clinic",clinic); |
| | | |
| | | hisCustomer=JSONObject.fromObject(hisOrderItem.getCustomer()); |
| | | customer=new JSONObject(); |
| | | customer.put("id",hisCustomer.optString("_id")); |
| | | customer.put("name",hisCustomer.optString("name")); |
| | | jsonObject.put("customer",customer); |
| | | |
| | | jsonObject.put("totalTimes",hisOrderItem.getTotalTimes()); |
| | | jsonObject.put("leftTimes",hisOrderItem.getLeftTimes()); |
| | | jsonObject.put("executedNumber",hisOrderItem.getExecutedNumber()); |
| | | jsonObject.put("refunded",hisOrderItem.getRefunded()); |
| | | |
| | | status=JSONArray.fromObject(hisOrderItem.getStatus()); |
| | | jsonObject.put("status",status.optJSONObject(0).optString("value")); |
| | | |
| | | jsonObject.put("type",hisOrderItem.getType()); |
| | | |
| | | jsonObject.put("createdAt",DateUtil.parseString_1(hisOrderItem.getCreatedAt()).getTime()); |
| | | |
| | | try { |
| | | syncExecutionRecordNewService.conversionExecutableRecord(jsonObject,hisOrderItem.getId()); |
| | | hisOrderItem.setWhetherToHandle(BaseEntity.YES); |
| | | }catch (Exception e){ |
| | | hisOrderItem.setWhetherToHandle(2); |
| | | logger.error("转换未执行项目失败",e); |
| | | } |
| | | syncTransactioalService.update(HisOrderItemMapper.class,hisOrderItem); |
| | | } |
| | | }while (hisOrderItems.size()==number); |
| | | |
| | | } |
| | | /** |
| | | * 转换执行项目记录 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void phisExecutionRecord() { |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | | Integer number=10;//条数 |
| | | sqlMap.put("number",number); |
| | | sqlMap.put("whetherToHandle",BaseEntity.NO); |
| | | List<HisExecutionRecord> hisExecutionRecordList; |
| | | do { |
| | | sqlSentence.setSqlSentence("SELECT * FROM his_execution_record WHERE whetherToHandle=#{m.whetherToHandle} ORDER BY executedDate LIMIT #{m.number} "); |
| | | hisExecutionRecordList=syncTransactioalService.selectList(HisExecutionRecordMapper.class,sqlSentence); |
| | | JSONObject jsonObject; |
| | | JSONObject hisClinic; |
| | | JSONObject clinic; |
| | | JSONObject hisMedicalDepartment; |
| | | JSONObject medicalDepartment; |
| | | |
| | | JSONArray hisParticipantsArray; |
| | | JSONArray participantsArray; |
| | | JSONObject hisParticipantsJson; |
| | | JSONObject participantsJson; |
| | | JSONObject role; |
| | | |
| | | JSONArray hisCostItemsArray; |
| | | JSONArray costItemsArray; |
| | | JSONObject hisCostItemsJson; |
| | | JSONObject costItemsJson; |
| | | JSONObject warehouse; |
| | | |
| | | for (HisExecutionRecord hisExecutionRecord : hisExecutionRecordList) { |
| | | jsonObject=new JSONObject(); |
| | | jsonObject.put("number",hisExecutionRecord.getNumber()); |
| | | jsonObject.put("id",hisExecutionRecord.getHisId()); |
| | | jsonObject.put("amount",hisExecutionRecord.getAmount()); |
| | | |
| | | jsonObject.put("itemId",hisExecutionRecord.getItemId()); |
| | | jsonObject.put("note",hisExecutionRecord.getNote()); |
| | | |
| | | hisClinic=JSONObject.fromObject(hisExecutionRecord.getClinic()); |
| | | clinic=new JSONObject(); |
| | | if(hisClinic!=null && hisClinic.size()>0){ |
| | | clinic.put("id",hisClinic.optString("_id")); |
| | | clinic.put("name",hisClinic.optString("name")); |
| | | } |
| | | jsonObject.put("clinic",clinic); |
| | | |
| | | jsonObject.put("cancelled",hisExecutionRecord.getCancelled().equals("-1")?true:false); |
| | | jsonObject.put("cancelledDate",hisExecutionRecord.getCancelledDate()==null?null:DateUtil.parseString_1(hisExecutionRecord.getCancelledDate()).getTime()); |
| | | jsonObject.put("executedDate",hisExecutionRecord.getExecutedDate()==null?null:DateUtil.parseString_1(hisExecutionRecord.getExecutedDate()).getTime()); |
| | | |
| | | |
| | | jsonObject.put("creator",JSONObject.fromObject(hisExecutionRecord.getCreator())); |
| | | jsonObject.put("quantity",hisExecutionRecord.getQuantity()); |
| | | |
| | | hisMedicalDepartment=JSONObject.fromObject(hisExecutionRecord.getMedicalDepartment()); |
| | | medicalDepartment=new JSONObject(); |
| | | if(hisMedicalDepartment!=null && hisMedicalDepartment.size()>0){ |
| | | medicalDepartment.put("id",hisMedicalDepartment.optString("_id")); |
| | | medicalDepartment.put("name",hisMedicalDepartment.optString("name")); |
| | | } |
| | | jsonObject.put("medicalDepartment",medicalDepartment); |
| | | |
| | | |
| | | //转换参与人 |
| | | hisParticipantsArray=hisExecutionRecord.getParticipants()==null?null:JSONArray.fromObject(hisExecutionRecord.getParticipants()); |
| | | participantsArray=new JSONArray(); |
| | | |
| | | if(hisParticipantsArray!=null){ |
| | | for (Object o : hisParticipantsArray) { |
| | | hisParticipantsJson= (JSONObject) o; |
| | | participantsJson=new JSONObject(); |
| | | role=new JSONObject(); |
| | | |
| | | participantsJson.put("id",hisParticipantsJson.optString("_id")); |
| | | participantsJson.put("name",hisParticipantsJson.optString("name")); |
| | | participantsJson.put("durationInMin",hisParticipantsJson.optJSONObject("manHour")==null?0: hisParticipantsJson.optJSONObject("manHour").optString("amount")); |
| | | |
| | | role.put("code",hisParticipantsJson.optJSONObject("role").optJSONArray("codes").optJSONObject(0).optString("value")); |
| | | role.put("name",hisParticipantsJson.optJSONObject("role").optJSONArray("codes").optJSONObject(0).optString("displayText")); |
| | | role.put("system",hisParticipantsJson.optJSONObject("role").optJSONArray("codes").optJSONObject(0).optString("vocabName")); |
| | | role.put("family",hisParticipantsJson.optJSONObject("role").optJSONArray("codes").optJSONObject(0).optString("family")); |
| | | role.put("version",hisParticipantsJson.optJSONObject("role").optJSONArray("codes").optJSONObject(0).optString("version")); |
| | | participantsJson.put("role",role); |
| | | |
| | | participantsArray.add(participantsJson); |
| | | } |
| | | |
| | | } |
| | | |
| | | jsonObject.put("participants",participantsArray); |
| | | |
| | | |
| | | //转换耗用品 |
| | | hisCostItemsArray=hisExecutionRecord.getCostItems()==null?null:JSONArray.fromObject(hisExecutionRecord.getCostItems()); |
| | | costItemsArray=new JSONArray(); |
| | | if(hisCostItemsArray!=null){ |
| | | for (Object o : hisCostItemsArray) { |
| | | hisCostItemsJson= (JSONObject) o; |
| | | costItemsJson=new JSONObject(); |
| | | warehouse=new JSONObject(); |
| | | |
| | | costItemsJson.put("id",hisCostItemsJson.optString("skuId")); |
| | | costItemsJson.put("name",hisCostItemsJson.optString("name")); |
| | | costItemsJson.put("spec",hisCostItemsJson.optString("specification")); |
| | | costItemsJson.put("unit",hisCostItemsJson.optString("unit")); |
| | | costItemsJson.put("quantity",hisCostItemsJson.optString("quantity")); |
| | | costItemsJson.put("batchNo",hisCostItemsJson.optString("batchNo")); |
| | | costItemsJson.put("expirationDate",hisCostItemsJson.optJSONObject("epirationDate")==null?null:hisCostItemsJson.optJSONObject("epirationDate").optString("batchNo")); |
| | | |
| | | warehouse.put("id",hisCostItemsJson.optJSONObject("warehouse")==null?null:hisCostItemsJson.optJSONObject("warehouse").optString("_id")); |
| | | warehouse.put("name",hisCostItemsJson.optJSONObject("warehouse")==null?null:hisCostItemsJson.optJSONObject("warehouse").optString("name")); |
| | | costItemsJson.put("warehouse",warehouse); |
| | | |
| | | costItemsArray.add(costItemsJson); |
| | | } |
| | | } |
| | | |
| | | jsonObject.put("costItems",costItemsArray); |
| | | |
| | | jsonObject.put("devices",hisExecutionRecord.getDevices()); |
| | | |
| | | |
| | | try { |
| | | syncExecutionRecordNewService.handleExecutionRecord(jsonObject); |
| | | hisExecutionRecord.setWhetherToHandle(BaseEntity.YES); |
| | | }catch (Exception e){ |
| | | hisExecutionRecord.setWhetherToHandle(2); |
| | | logger.error("转换未执行项目失败",e); |
| | | } |
| | | syncTransactioalService.update(HisExecutionRecordMapper.class,hisExecutionRecord); |
| | | } |
| | | }while (hisExecutionRecordList.size()==number); |
| | | } |
| | | |
| | | /** |
| | | * 转换所有资金变动记录 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void phisAccountJournal() { |
| | | |
| | | //运行之前一定得把customerId为空,type为空的数据处理掉 |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | | Integer number=10;//条数 |
| | | sqlMap.put("number",number); |
| | | sqlMap.put("whetherToHandle",BaseEntity.NO); |
| | | List<HisAccountJournal> hisAccountJournalList; |
| | | do { |
| | | sqlSentence.setSqlSentence("SELECT * FROM his_account_journal WHERE whetherToHandle=#{m.whetherToHandle} ORDER BY createTimestamp LIMIT #{m.number} "); |
| | | hisAccountJournalList=syncTransactioalService.selectList(HisAccountJournalMapper.class,sqlSentence); |
| | | for (HisAccountJournal hisAccountJournal : hisAccountJournalList) { |
| | | try { |
| | | syncNewUserService.addUserMoneyLog(hisAccountJournal); |
| | | hisAccountJournal.setWhetherToHandle(BaseEntity.YES); |
| | | |
| | | }catch (Exception e){ |
| | | hisAccountJournal.setWhetherToHandle(2); |
| | | logger.error("转换资金记录失败",e); |
| | | } |
| | | syncTransactioalService.update(HisAccountJournalMapper.class,hisAccountJournal); |
| | | } |
| | | |
| | | |
| | | }while (hisAccountJournalList.size()==number); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.his.service.GetTokenService; |
| | | import com.hx.phip.his.service.HisTokenService; |
| | | import com.hx.phip.uti.ApiUtil; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | public class HisTokenServiceImpl implements HisTokenService { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(HisTokenServiceImpl.class); |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | @Resource |
| | | private GetTokenService getTokenService; |
| | | @Override |
| | | public Result getToken() { |
| | | try { |
| | | String at = getTokenService.getHisToken(systemParameterMapper, systemConfig.getApiAppId(), systemConfig.getApiCode(), |
| | | systemConfig.getApiSecret(), systemConfig.getApiUrl()); |
| | | return Result.success(at); |
| | | }catch (Exception e){ |
| | | logger.error("获取token失败",e); |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,"获取token失败"); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.common.OrderTotalConstants; |
| | | import com.hx.phiappt.model.BaseEntity; |
| | | import com.hx.phiappt.model.Project; |
| | | import com.hx.phiappt.model.User; |
| | | import com.hx.phiappt.model.consumables.Consumables; |
| | | import com.hx.phiappt.model.order.KoapOrderItem; |
| | | import com.hx.phiappt.model.order.KoapOrderTotal; |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phiappt.dao.mapper.*; |
| | | import com.hx.phiappt.dao.mapper.HeartbeatReceiveMapper; |
| | | import com.hx.phiappt.model.sync.HeartbeatReceive; |
| | | import com.hx.phip.his.service.KBJHeartbeatReceiveService; |
| | | import com.hx.phip.his.service.KoapSyncFeeService; |
| | | import com.hx.phip.his.service.SyncTransactioalService; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hz.util.http.HttpHzUtil; |
| | | import com.hz.util.http.dto.HttpHzResponse; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | public class KBJHeartbeatReceiveServiceImpl implements KBJHeartbeatReceiveService { |
| | | private static Logger logger = LoggerFactory.getLogger(KBJHeartbeatReceiveServiceImpl.class); |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | @Resource |
| | | private KoapSyncFeeService koapSyncFeeService; |
| | | @Resource |
| | | private ProjectMapper projectMapper; |
| | | @Resource |
| | | private UserMapper userMapper; |
| | | @Resource |
| | | private KoapOrderTotalMapper koapOrderTotalMapper; |
| | | @Resource |
| | | private KoapOrderItemMapper koapOrderItemMapper; |
| | | @Resource |
| | | private ConsumablesMapper consumablesMapper; |
| | | |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | |
| | | @Override |
| | | public void patientcreate(JSONObject jsonObject) { |
| | | HeartbeatReceive heartbeatReceive=new HeartbeatReceive("patientcreate",jsonObject.toString(),4); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | } |
| | | |
| | | @Override |
| | | public void patientmodify(JSONObject jsonObject) { |
| | | HeartbeatReceive heartbeatReceive=new HeartbeatReceive("patientmodify",jsonObject.toString(),4); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | } |
| | | |
| | | @Override |
| | | public void patientdefunct(JSONObject jsonObject) { |
| | | HeartbeatReceive heartbeatReceive=new HeartbeatReceive("patientdefunct",jsonObject.toString(),4); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | } |
| | | |
| | | @Override |
| | | public void visitstatusmodify(JSONObject jsonObject) { |
| | | HeartbeatReceive heartbeatReceive=new HeartbeatReceive("visitstatusmodify",jsonObject.toString(),4); |
| | | syncTransactioalService.insert(HeartbeatReceiveMapper.class,heartbeatReceive); |
| | | String patientNo=jsonObject.optJSONObject("msg").optString("patientNo"); |
| | | String visitNo=jsonObject.optJSONObject("msg").optString("visitNo"); |
| | | String newVisitStatusCode=jsonObject.optJSONObject("msg").optString("newVisitStatusCode"); |
| | | logger.info("patientNo:{},visitNo:{},newVisitStatusCode:{}",patientNo,visitNo,newVisitStatusCode); |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | sqlSentence.setM(map); |
| | | |
| | | |
| | | User user=null; |
| | | JSONObject json=null; |
| | | |
| | | JSONArray chargeList=null; |
| | | String flowNo=null; |
| | | |
| | | KoapOrderTotal koapOrderTotal=null; |
| | | KoapOrderItem koapOrderItem=null; |
| | | KoapOrderItem koapOrderItemCopy=null; |
| | | Project p = null; |
| | | Consumables consumables= null; |
| | | |
| | | //先屏蔽,等预约上线 |
| | | if("6".equals(newVisitStatusCode)){ |
| | | logger.info("收到用户:{}看诊信息",patientNo); |
| | | //新就诊状态编码为5看诊状态下才会产生待缴费信息 |
| | | sqlSentence.setSqlSentence("select * from user where koapId = #{m.koapId} and isDel = #{m.isDel}"); |
| | | map.put("isDel", BaseEntity.NO); |
| | | map.put("koapId",patientNo); |
| | | user = userMapper.selectOne(sqlSentence); |
| | | if(user==null)return; |
| | | sqlSentence.setSqlSentence("select * from consumables where name = #{m.name} and isDel = #{m.isDel}"); |
| | | map.put("isDel", BaseEntity.NO); |
| | | map.put("name","PHIMED结账商品"); |
| | | p=projectMapper.selectOne(sqlSentence); |
| | | consumables=consumablesMapper.selectOne(sqlSentence); |
| | | if(consumables==null)return; |
| | | |
| | | json=new JSONObject(); |
| | | json.put("visitNo",visitNo); |
| | | Result result= koapSyncFeeService.chargeUnpaid(json); |
| | | if(!ResponseCode.SUCCESS.equals(result.getCode()))return; |
| | | flowNo=JSONObject.fromObject(result.getData()).optString("flowNo"); |
| | | chargeList=JSONObject.fromObject(result.getData()).optJSONArray("dataList").optJSONObject(0).optJSONArray("chargeList"); |
| | | |
| | | sqlSentence.setSqlSentence("select * from koap_order_total where visitNo = #{m.visitNo} and isDel = #{m.isDel}"); |
| | | map.put("isDel", BaseEntity.NO); |
| | | map.put("visitNo",visitNo); |
| | | koapOrderTotal= koapOrderTotalMapper.selectOne(sqlSentence); |
| | | if(koapOrderTotal==null){ |
| | | koapOrderTotal=new KoapOrderTotal(); |
| | | koapOrderTotal.setUserId(user.getId()); |
| | | koapOrderTotal.setPatientNo(patientNo); |
| | | koapOrderTotal.setVisitNo(visitNo); |
| | | koapOrderTotal.setFlowNo(flowNo); |
| | | koapOrderTotalMapper.insert(koapOrderTotal); |
| | | }else { |
| | | //完诊之后取消完诊再点完诊也会触发 |
| | | koapOrderTotal.setFlowNo(flowNo); |
| | | //更改请求流水号,避免出问题了可以根据这个流水号去康博嘉查询 |
| | | koapOrderTotalMapper.updateAll(koapOrderTotal); |
| | | } |
| | | |
| | | sqlSentence.setSqlSentence("isDel=1 where orderId = #{m.orderId}"); |
| | | map.put("orderId",koapOrderTotal.getId()); |
| | | koapOrderItemMapper.updateWhere(sqlSentence); |
| | | sqlSentence.setSqlSentence("select * from koap_order_item where orderId = #{m.orderId} and chargeNo = #{m.chargeNo}"); |
| | | for (int i = 0; i < chargeList.size(); i++) { |
| | | koapOrderItemCopy= com.alibaba.fastjson.JSONObject.parseObject(chargeList.optJSONObject(i).toString(), KoapOrderItem.class); |
| | | map.put("chargeNo",koapOrderItemCopy.getChargeNo()); |
| | | koapOrderItem=koapOrderItemMapper.selectOne(sqlSentence); |
| | | if(koapOrderItem==null){ |
| | | koapOrderItemCopy.setOrderId(koapOrderTotal.getId()); |
| | | koapOrderItemCopy.setCommonId(consumables.getId()); |
| | | koapOrderItemMapper.insert(koapOrderItemCopy); |
| | | }else { |
| | | koapOrderItem.setItemQty(koapOrderItemCopy.getItemQty()); |
| | | koapOrderItem.setActualAmount(koapOrderItemCopy.getActualAmount()); |
| | | koapOrderItem.setChargeAmount(koapOrderItemCopy.getChargeAmount()); |
| | | koapOrderItem.setIsDel(0); |
| | | koapOrderItemMapper.updateAll(koapOrderItem); |
| | | } |
| | | } |
| | | |
| | | }else if("7".equals(newVisitStatusCode)){ |
| | | sqlSentence.setSqlSentence("select * from koap_order_total where visitNo = #{m.visitNo} and patientNo = #{m.patientNo} and isDel = #{m.isDel}"); |
| | | map.put("isDel", BaseEntity.NO); |
| | | map.put("visitNo",visitNo); |
| | | map.put("patientNo",patientNo); |
| | | koapOrderTotal= koapOrderTotalMapper.selectOne(sqlSentence); |
| | | if(koapOrderTotal!=null){ |
| | | koapOrderTotal.setPayStatus(OrderTotalConstants.PAY_STATUS_SUC); |
| | | koapOrderTotalMapper.updateAll(koapOrderTotal); |
| | | } |
| | | } |
| | | //通知phimed预约订单有变动 |
| | | tellPhimedVisit(visitNo,newVisitStatusCode); |
| | | } |
| | | |
| | | public void tellPhimedVisit(String visitNo,String newVisitStatusCode){ |
| | | logger.info("通知phimed订单:{},状态码:{}了",visitNo,newVisitStatusCode); |
| | | HttpHzResponse httpHzResponse = HttpHzUtil.HttpURLUtilJson(systemConfig.getPhimedUrl()+ "/subscribe/syncAppointmentOpt?visitNo="+visitNo,null,null,null,"GET",null); |
| | | logger.info("通知phimed订单:{},phimed返回:{}",visitNo,JSON.toJSONString(httpHzResponse)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hx.phip.his.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.hx.phip.common.KoapUrl; |
| | | import com.hx.phip.his.config.SystemConfig; |
| | | import com.hx.phiappt.dao.mapper.SystemParameterMapper; |
| | | import com.hx.phip.dao.mapper.syn.SyncKoapAppointmentRecordMapper; |
| | | import com.hx.phip.model.SyncKoapAppointmentRecord; |
| | | import com.hx.phip.his.service.GetTokenService; |
| | | import com.hx.phip.his.service.KoapSyncAppointmentService; |
| | | import com.hx.phip.his.service.SyncTransactioalService; |
| | | import com.hx.phip.uti.HisHttpUtil; |
| | | import com.hx.resultTool.ResponseCode; |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.StringUtils; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | public class KoapSyncAppointmentServiceImpl implements KoapSyncAppointmentService { |
| | | private static Logger logger = LoggerFactory.getLogger(KoapSyncAppointmentServiceImpl.class); |
| | | |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | @Resource |
| | | private SystemConfig systemConfig; |
| | | @Resource |
| | | private SyncTransactioalService syncTransactioalService; |
| | | @Resource |
| | | private GetTokenService getTokenService; |
| | | /** |
| | | * 获取KOAP token |
| | | * @return |
| | | */ |
| | | public String getToken(){ |
| | | String at = getTokenService.getKbjToken(systemParameterMapper, systemConfig.getKoaClientId(), systemConfig.getKoaGrantType(), |
| | | systemConfig.getKoaClientSecret(), systemConfig.getKoapUrl()); |
| | | return at; |
| | | } |
| | | /** |
| | | * 创建预约 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result create(JSONObject jsonObject) { |
| | | SyncKoapAppointmentRecord syncKoapAppointmentRecord=new SyncKoapAppointmentRecord(jsonObject.toString(),null,1,0,0,new Date()); |
| | | String at =getToken(); |
| | | Map<String,String> header=new HashMap<>(); |
| | | header.put("Authorization",at); |
| | | |
| | | jsonObject.put("clinicCode", systemConfig.getKoaClinicCode()); //授权编码 |
| | | if(StringUtils.isEmpty(jsonObject.optString("patientNo",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"患者编号不能为空"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("bookingDate",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"预约日期不能为空(YYYY-MM-DD)"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("specialtyCode",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"预约科室编码不能为空"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("doctorCode",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"预约医生编码不能为空"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("timeRangeCode",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"时段编码不能为空"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("startTime",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"开始时间不能为空"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("endTime",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"截至时间不能为空"); |
| | | logger.info("新建患者预约信息入参数:{}",jsonObject.toString()); |
| | | String datas = HisHttpUtil.HttpURLUtilJson(systemConfig.getKoapUrl()+ KoapUrl.APPOINTMENT_VISIT_CREATE, jsonObject.toString(), null, header, "POST"); |
| | | datas=datas.replaceAll("\\\n",""); |
| | | logger.info("新建患者预约信息返回参数:{}",datas); |
| | | syncKoapAppointmentRecord.setReturnParameters(datas); |
| | | if(datas!=null){ |
| | | JSONObject object=JSONObject.fromObject(datas); |
| | | if("0".equals(object.optString("code"))){ |
| | | syncKoapAppointmentRecord.setSuccessNumber(1); |
| | | syncKoapAppointmentRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | JSONObject returnJosn=new JSONObject(); |
| | | returnJosn.put("flowNo",object.optString("flowNo")); |
| | | returnJosn.put("visitNo",object.optJSONObject("data").optString("visitNo")); |
| | | return Result.success(com.alibaba.fastjson.JSONObject.parseObject(returnJosn.toString())); |
| | | }else { |
| | | syncKoapAppointmentRecord.setFailNumber(1); |
| | | syncKoapAppointmentRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | logger.info("新建患者预约信息,失败返回:{}"+datas); |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,datas); |
| | | } |
| | | }else { |
| | | syncKoapAppointmentRecord.setFailNumber(1); |
| | | syncKoapAppointmentRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | logger.info("新建患者预约信息,失败返回:{}"+datas); |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,datas); |
| | | } |
| | | } |
| | | /** |
| | | * 修改预约 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result modify(JSONObject jsonObject) { |
| | | SyncKoapAppointmentRecord syncKoapAppointmentRecord=new SyncKoapAppointmentRecord(jsonObject.toString(),null,2,0,0,new Date()); |
| | | String at =getToken(); |
| | | Map<String,String> header=new HashMap<>(); |
| | | header.put("Authorization",at); |
| | | |
| | | jsonObject.put("clinicCode", systemConfig.getKoaClinicCode()); //授权编码 |
| | | if(StringUtils.isEmpty(jsonObject.optString("visitNo",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"就诊编码不能为空"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("bookingDate",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"预约日期不能为空(YYYY-MM-DD)"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("timeRangeCode",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"时段编码不能为空"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("startTime",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"开始时间不能为空"); |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("endTime",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"截至时间不能为空"); |
| | | logger.info("修改患者预约信息入参数:{}",jsonObject.toString()); |
| | | String datas = HisHttpUtil.HttpURLUtilJson(systemConfig.getKoapUrl()+ KoapUrl.APPOINTMENT_VISIT_MODIFY, jsonObject.toString(), null, header, "POST"); |
| | | datas=datas.replaceAll("\\\n",""); |
| | | logger.info("修改患者预约信息返回参数:{}",datas); |
| | | syncKoapAppointmentRecord.setReturnParameters(datas); |
| | | if(datas!=null){ |
| | | JSONObject object=JSONObject.fromObject(datas); |
| | | if("0".equals(object.optString("code"))){ |
| | | syncKoapAppointmentRecord.setSuccessNumber(1); |
| | | syncKoapAppointmentRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | return Result.success("修改成功"); |
| | | }else { |
| | | syncKoapAppointmentRecord.setFailNumber(1); |
| | | syncKoapAppointmentRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,datas); |
| | | } |
| | | |
| | | }else { |
| | | syncKoapAppointmentRecord.setFailNumber(1); |
| | | syncKoapAppointmentRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,datas); |
| | | } |
| | | } |
| | | /** |
| | | * 作废预约 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result cancel(JSONObject jsonObject) { |
| | | SyncKoapAppointmentRecord syncKoapAppointmentRecord=new SyncKoapAppointmentRecord(jsonObject.toString(),null,3,0,0,new Date()); |
| | | |
| | | String at =getToken(); |
| | | Map<String,String> header=new HashMap<>(); |
| | | header.put("Authorization",at); |
| | | |
| | | jsonObject.put("clinicCode", systemConfig.getKoaClinicCode()); //授权编码 |
| | | if(StringUtils.isEmpty(jsonObject.optString("visitNo",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"就诊编码不能为空"); |
| | | logger.info("作废患者预约信息入参数:{}",jsonObject.toString()); |
| | | String datas = HisHttpUtil.HttpURLUtilJson(systemConfig.getKoapUrl()+ KoapUrl.APPOINTMENT_VISIT_CANCEL, jsonObject.toString(), null, header, "POST"); |
| | | datas=datas.replaceAll("\\\n",""); |
| | | logger.info("作废患者预约信息返回参数:{}",datas); |
| | | syncKoapAppointmentRecord.setReturnParameters(datas); |
| | | if(datas!=null){ |
| | | JSONObject object=JSONObject.fromObject(datas); |
| | | if("0".equals(object.optString("code"))){ |
| | | syncKoapAppointmentRecord.setSuccessNumber(1); |
| | | syncKoapAppointmentRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | JSONObject returnJosn=new JSONObject(); |
| | | returnJosn.put("flowNo",object.optString("flowNo")); |
| | | returnJosn.put("refundBookingDepositAmount",object.optJSONObject("data").optString("refundBookingDepositAmount")); |
| | | return Result.success(com.alibaba.fastjson.JSONObject.parseObject(returnJosn.toString())); |
| | | }else { |
| | | syncKoapAppointmentRecord.setFailNumber(1); |
| | | syncKoapAppointmentRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,datas); |
| | | } |
| | | |
| | | }else { |
| | | syncKoapAppointmentRecord.setFailNumber(1); |
| | | syncKoapAppointmentRecord.setEndTime(new Date()); |
| | | syncTransactioalService.insert(SyncKoapAppointmentRecordMapper.class,syncKoapAppointmentRecord); |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,datas); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Result list(JSONObject jsonObject) { |
| | | String at =getToken(); |
| | | Map<String,String> header=new HashMap<>(); |
| | | header.put("Authorization",at); |
| | | |
| | | jsonObject.put("clinicCode", systemConfig.getKoaClinicCode()); //授权编码 |
| | | |
| | | if(StringUtils.isEmpty(jsonObject.optString("visitNo",null))) |
| | | return Result.failure(ResponseCode.ERROR_PARAMS_VALIDATOR,"就诊编码不能为空"); |
| | | String datas = HisHttpUtil.HttpURLUtilJson(systemConfig.getKoapUrl()+ KoapUrl.APPOINTMENT_VISIT_LIST, null, jsonObject, header, "GET"); |
| | | if(StringUtils.isEmpty(datas)){ |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,datas); |
| | | } |
| | | datas=datas.replaceAll("\\\n",""); |
| | | if(datas!=null){ |
| | | JSONObject obj = JSONObject.fromObject(datas); |
| | | if("0".equals(obj.optString("code","1"))){ |
| | | JSONArray dataList=obj.optJSONObject("data").optJSONArray("dataList"); |
| | | return Result.success(com.alibaba.fastjson.JSONArray.parse(dataList.toString()) ); |
| | | }else { |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,datas); |
| | | } |
| | | }else { |
| | | return Result.failure(ResponseCode.ERROR_SERVICE_VALIDATOR,datas); |
| | | } |
| | | } |
| | | } |
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/KoapSyncBasicInformationServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/KoapSyncBillReportServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/KoapSyncFeeServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/KoapSyncUserServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/OrderTotalServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/PrescriptionServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/PrescriptionTemplateServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/ShopServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncAppointmentServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncChannelServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncConsultationServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncCouponServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncDeviceServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncEmployeeServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncExecutionRecordNewServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncExecutionRecordServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncGoodsServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncMedicalRecordsServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncMemberCenterServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncNewOrderServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncNewUserServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncOrderServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncProjectServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncSalesFinancialDataServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncShopServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncTagSetsServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncTransactioalServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncUserCardServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncUserLevelRecordServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncUserServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncVisitRecordServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SyncWarehouseServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/SystemParameterServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/impl/UserFromServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/meituan/MeituanCouponsService.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/meituan/MeituanPrepaidOrderService.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/meituan/MeituanTaskService.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/meituan/impl/MeituanCouponsServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/meituan/impl/MeituanPrepaidOrderServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/service/meituan/impl/meituanTaskServiceImpl.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisConsultationTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisDaySyncTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisExecutableRecordSyncTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisExecutedRecordSyncTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisMedicalRecordsTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisOrderSyncTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisPrescriptionTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisTagsSyncTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisUserLevelRecordTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisUserPicturesTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/task/HisWeekSyncTask.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/util/EnableAsyncUtil.java
phi-synchro/phi-synchro-his/src/main/java/com/hx/phip/his/util/SyncMedicalPrescriptionUtil.java
phi-synchro/phi-synchro-his/src/main/resources/RSA-prod.txt
phi-synchro/phi-synchro-his/src/main/resources/RSA-test.txt
phi-synchro/phi-synchro-his/src/main/resources/application-local.properties
phi-synchro/phi-synchro-his/src/main/resources/application-prod.properties
phi-synchro/phi-synchro-his/src/main/resources/bootstrap.properties
phi-synchro/phi-synchro-his/src/main/resources/log4j.properties
phi-synchro/phi-synchro-his/src/main/resources/log4j2-local.xml
phi-synchro/phi-synchro-his/src/main/resources/log4j2-prod.xml
phi-synchro/pom.xml
pom.xml |