DYH2020 преди 1 година
родител
ревизия
c8a2f6f479

+ 0 - 3
.idea/.gitignore

@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml

+ 0 - 18
.idea/compiler.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="CompilerConfiguration">
-    <annotationProcessing>
-      <profile name="Maven default annotation processors profile" enabled="true">
-        <sourceOutputDir name="target/generated-sources/annotations" />
-        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
-        <outputRelativeToContentRoot value="true" />
-        <module name="ywt-biz-common" />
-      </profile>
-    </annotationProcessing>
-  </component>
-  <component name="JavacSettings">
-    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
-      <module name="ywt-biz-common" options="-parameters" />
-    </option>
-  </component>
-</project>

+ 0 - 7
.idea/encodings.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="Encoding">
-    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
-    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
-  </component>
-</project>

+ 0 - 25
.idea/jarRepositories.xml

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="RemoteRepositoriesConfiguration">
-    <remote-repository>
-      <option name="id" value="central" />
-      <option name="name" value="Central Repository" />
-      <option name="url" value="https://repo.maven.apache.org/maven2" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="nexus" />
-      <option name="name" value="Team Nexus Repository" />
-      <option name="url" value="http://nexus.ywtinfo.com/repository/maven-public/" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="central" />
-      <option name="name" value="Maven Central repository" />
-      <option name="url" value="https://repo1.maven.org/maven2" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="jboss.community" />
-      <option name="name" value="JBoss Community repository" />
-      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
-    </remote-repository>
-  </component>
-</project>

+ 0 - 13
.idea/misc.xml

@@ -1,13 +0,0 @@
-<project version="4">
-  <component name="ExternalStorageConfigurationManager" enabled="true" />
-  <component name="MavenProjectsManager">
-    <option name="originalFiles">
-      <list>
-        <option value="$PROJECT_DIR$/pom.xml" />
-      </list>
-    </option>
-  </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
-    <output url="file://$PROJECT_DIR$/out" />
-  </component>
-</project>

+ 0 - 124
.idea/uiDesigner.xml

@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="Palette2">
-    <group name="Swing">
-      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
-      </item>
-      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
-      </item>
-      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
-      </item>
-      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
-        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
-      </item>
-      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
-        <initial-values>
-          <property name="text" value="Button" />
-        </initial-values>
-      </item>
-      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
-        <initial-values>
-          <property name="text" value="RadioButton" />
-        </initial-values>
-      </item>
-      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
-        <initial-values>
-          <property name="text" value="CheckBox" />
-        </initial-values>
-      </item>
-      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
-        <initial-values>
-          <property name="text" value="Label" />
-        </initial-values>
-      </item>
-      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
-          <preferred-size width="150" height="-1" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
-          <preferred-size width="150" height="-1" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
-          <preferred-size width="150" height="-1" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
-      </item>
-      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
-          <preferred-size width="200" height="200" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
-          <preferred-size width="200" height="200" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
-      </item>
-      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
-      </item>
-      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
-      </item>
-      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
-      </item>
-      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
-          <preferred-size width="-1" height="20" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
-      </item>
-      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
-      </item>
-    </group>
-  </component>
-</project>

+ 0 - 6
.idea/vcs.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="VcsDirectoryMappings">
-    <mapping directory="" vcs="Git" />
-  </component>
-</project>

+ 0 - 9
.idea/ywt-biz-common.iml

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
-    <exclude-output />
-    <content url="file://$MODULE_DIR$" />
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>

+ 2 - 1
pom.xml

@@ -7,7 +7,7 @@
 	<parent>
 		<groupId>com.ywt</groupId>
 		<artifactId>ywt-parent</artifactId>
-		<relativePath>../ywt-parent/pom.xml</relativePath>
+		<!--<relativePath>../ywt-parent/pom.xml</relativePath>-->
 		<version>1.0.0-SNAPSHOT</version>
 	</parent>
 
@@ -160,6 +160,7 @@
 		<dependency>
 			<groupId>org.springframework.kafka</groupId>
 			<artifactId>spring-kafka</artifactId>
+			<scope>provided</scope>
 		</dependency>
 
 	</dependencies>

+ 41 - 0
src/main/java/com/ywt/biz/common/enums/PaymentChannelEnum.java

@@ -0,0 +1,41 @@
+package com.ywt.biz.common.enums;
+
+public enum PaymentChannelEnum {
+    WeChat("微信", 1),
+    AliPay("支付宝", 2),
+    Cash("现金", 3),          //现场支付
+    MedicalCard("诊疗卡", 4),
+    POS("平台pos机", 5),
+    FREE("无须支付", 6),
+    MedicalInsurance("医保", 7),
+    ICBC("工行", 8),
+    PharmacyPOS("药店pos机", 9), // v4.6.5 处方外传增加支付渠道
+    PharmacyUnion("门店聚合", 10), // hotfix_v1.1.0 处方外传增加支付渠道
+    UNKNOWN("", 0);
+
+    private final String displayName;
+
+    private final int value;
+
+    PaymentChannelEnum(String displayName, int value) {
+        this.displayName = displayName;
+        this.value = value;
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public static PaymentChannelEnum valueOf(int value) {
+        for (PaymentChannelEnum e : PaymentChannelEnum.values()) {
+            if (e.getValue() == value) {
+                return e;
+            }
+        }
+        return UNKNOWN;
+    }
+}

+ 25 - 0
src/main/java/com/ywt/biz/common/enums/PaymentStatusEnum.java

@@ -0,0 +1,25 @@
+package com.ywt.biz.common.enums;
+
+public enum PaymentStatusEnum {
+    Pending("待支付", 0),
+    Processing("支付处理中", 1),
+    Success("支付成功", 2),
+    Failed("支付失败", 3);
+
+    private final String displayName;
+
+    private final int value;
+
+    PaymentStatusEnum(String displayName, int value) {
+        this.displayName = displayName;
+        this.value = value;
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public int getValue() {
+        return value;
+    }
+}

+ 29 - 0
src/main/java/com/ywt/biz/common/enums/RefundStatusEnum.java

@@ -0,0 +1,29 @@
+package com.ywt.biz.common.enums;
+
+/**
+ * @author Walker
+ * Created on 2022/9/22
+ */
+public enum RefundStatusEnum {
+    PROCESSING("处理中", 0),
+    SUCCESS("退款成功", 1),
+    EXCEPTION("退款异常", 2),
+    CLOSED("退款关闭", 3);
+
+    private final String displayName;
+
+    private final int value;
+
+    RefundStatusEnum(String displayName, int value) {
+        this.displayName = displayName;
+        this.value = value;
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public int getValue() {
+        return value;
+    }
+}

+ 219 - 0
src/main/java/com/ywt/biz/common/util/Checker.java

@@ -0,0 +1,219 @@
+package com.ywt.biz.common.util;
+
+import com.ywt.biz.common.constant.YwtCommonRespCode;
+import com.ywt.biz.common.exception.YwtCommonException;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by huangguoping on 14/12/10.
+ */
+public class Checker {
+    public static boolean isNone(Map map) {
+        if (map == null || map.size() == 0) {
+            return true;
+        }
+        return false;
+    }
+
+    public static void checkNone(Map map, String paramName) {
+        if (map == null || map.size() == 0) {
+            throw new YwtCommonException(YwtCommonRespCode.P_ERR, paramName + " is null or empty");
+        }
+    }
+
+    public static boolean isNone(List lst) {
+        if (lst == null || lst.size() == 0)
+            return true;
+        return false;
+    }
+
+    public static boolean isNone(Set s) {
+        if (s == null || s.size() == 0)
+            return true;
+        return false;
+    }
+
+    public static void checkNone(List lst, String paramName) {
+        if (lst == null || lst.size() == 0) {
+            throw new YwtCommonException(YwtCommonRespCode.P_ERR, paramName + " is null or empty");
+        }
+    }
+
+    public static boolean isNone(String str) {
+        if (str == null || str.equals(""))
+            return true;
+        return false;
+    }
+
+    public static void checkNone(String str, String paramName) {
+        if (str == null || str.equals("")) {
+            throw new YwtCommonException(YwtCommonRespCode.P_ERR, paramName + " is null or empty");
+        }
+    }
+
+    public static boolean isNone(Object object) {
+        if (object == null) return true;
+        return false;
+    }
+
+    public static void checkNone(Object object, String paramName) {
+        if (object == null) {
+            throw new YwtCommonException(YwtCommonRespCode.P_ERR, paramName + " is null or empty");
+        }
+    }
+
+    public static boolean isNone(Object[] objects) {
+        if (objects == null || objects.length == 0) return true;
+        return false;
+    }
+
+    public static void checkNone(Object[] objects, String paramName) {
+        if (objects == null || objects.length == 0) {
+            throw new YwtCommonException(YwtCommonRespCode.P_ERR, paramName + " is null or empty");
+        }
+    }
+
+    public static boolean isNone(byte[] bytes) {
+        if (bytes == null || bytes.length == 0)
+            return true;
+        else
+            return false;
+    }
+
+    public static void checkNone(byte[] bytes, String paramName) {
+        if (bytes == null || bytes.length == 0) {
+            throw new YwtCommonException(YwtCommonRespCode.P_ERR, paramName + " is null or empty");
+        }
+    }
+
+    public static int getIntegerValue(Integer value, int defaultValue) {
+        return value != null ? value.intValue() : defaultValue;
+    }
+
+    public static byte getByteValue(Byte value, byte defaultValue) {
+        return value != null ? value.byteValue() : defaultValue;
+    }
+
+    public static short getShortValue(Short value, short defaultValue) {
+        return value != null ? value.shortValue() : defaultValue;
+    }
+
+    public static double getDoubleValue(Double value, double defaultValue) {
+        return value != null ? value.doubleValue() : defaultValue;
+    }
+
+    public static boolean getBooleanValue(Boolean value, boolean defaultValue) {
+        return value != null ? value.booleanValue() : defaultValue;
+    }
+
+    public static String getStringValue(String value, String defaultValue) {
+        return value != null ? value : defaultValue;
+    }
+
+    public static String getStringValue(String value) {
+        return value != null ? value : "";
+    }
+
+    public static long getLongValue(Long value, long defaultValue) {
+        return value != null ? value.longValue() : defaultValue;
+    }
+
+    public static Date getDateValue(Date date, Date defaultDate) {
+        return date != null ? date : defaultDate;
+    }
+
+    public static int getIntegerValue(Integer value) {
+        return value != null ? value.intValue() : 0;
+    }
+
+    public static byte getByteValue(Byte value) {
+        return value != null ? value.byteValue() : (byte) 0;
+    }
+
+    public static short getShortValue(Short value) {
+        return value != null ? value.shortValue() : (short) 0;
+    }
+
+    public static double getDoubleValue(Double value) {
+        return value != null ? value.doubleValue() : (double) 0;
+    }
+
+    public static boolean getBooleanValue(Boolean value) {
+        return value != null ? value.booleanValue() : false;
+    }
+
+    public static long getLongValue(Long value) {
+        return value != null ? value.longValue() : 0L;
+    }
+
+    public static String NullStringToEmpty(String value) {
+        return value != null ? value : "";
+    }
+
+    public static Date getDateValue(Date date) {
+        return date != null ? date : new Date(System.currentTimeMillis());
+    }
+
+    public static int parseInt(String numStr, int defaultValue) {
+        try {
+            return Integer.parseInt(numStr);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    public static int parseInt(String numStr) {
+        return parseInt(numStr, 0);
+    }
+
+    public static long parseLong(String numStr, long defaultValue) {
+        try {
+            return Long.parseLong(numStr);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    public static long parseLong(String numStr) {
+        return parseLong(numStr, 0L);
+    }
+
+    public static double parseDouble(String numStr, double defaultValue) {
+        try {
+            return Double.parseDouble(numStr);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    public static double parseDouble(String numStr) {
+        return parseDouble(numStr, 0d);
+    }
+
+    public static boolean isNull(Object obj) {
+        return obj == null;
+    }
+
+    /**
+     * bigDecimal 转 int 型,放大100倍
+     *
+     * @param bigDecimal
+     * @return
+     */
+    public static int getBigDecimalTo100TimeIntValue(BigDecimal bigDecimal) {
+        try {
+            BigDecimal dec = new BigDecimal("100");
+            dec = dec.multiply(bigDecimal);
+            return dec.intValue();
+        } catch (Exception e) {
+            return 0;
+        }
+
+    }
+
+}