Subversion Repositories umemoto2

Compare Revisions

Ignore whitespace Rev 1 → Rev 2

/kdc/.mvn/wrapper/maven-wrapper.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/kdc/.mvn/wrapper/maven-wrapper.jar
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: kdc/.mvn/wrapper/maven-wrapper.properties
===================================================================
--- kdc/.mvn/wrapper/maven-wrapper.properties (nonexistent)
+++ kdc/.mvn/wrapper/maven-wrapper.properties (revision 2)
@@ -0,0 +1 @@
+distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
Index: kdc/.settings/.jsdtscope
===================================================================
--- kdc/.settings/.jsdtscope (nonexistent)
+++ kdc/.settings/.jsdtscope (revision 2)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/webapp"/>
+ <classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="target/m2e-wtp/web-resources"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Index: kdc/.settings/org.eclipse.core.resources.prefs
===================================================================
--- kdc/.settings/org.eclipse.core.resources.prefs (nonexistent)
+++ kdc/.settings/org.eclipse.core.resources.prefs (revision 2)
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding/<project>=UTF-8
Index: kdc/.settings/org.eclipse.jdt.apt.core.prefs
===================================================================
--- kdc/.settings/org.eclipse.jdt.apt.core.prefs (nonexistent)
+++ kdc/.settings/org.eclipse.jdt.apt.core.prefs (revision 2)
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.apt.aptEnabled=true
+org.eclipse.jdt.apt.genSrcDir=target\\generated-sources\\annotations
+org.eclipse.jdt.apt.genTestSrcDir=target\\generated-test-sources\\test-annotations
Index: kdc/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- kdc/.settings/org.eclipse.jdt.core.prefs (nonexistent)
+++ kdc/.settings/org.eclipse.jdt.core.prefs (revision 2)
@@ -0,0 +1,12 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.processAnnotations=enabled
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
Index: kdc/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- kdc/.settings/org.eclipse.m2e.core.prefs (nonexistent)
+++ kdc/.settings/org.eclipse.m2e.core.prefs (revision 2)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Index: kdc/.settings/org.eclipse.wst.common.component
===================================================================
--- kdc/.settings/org.eclipse.wst.common.component (nonexistent)
+++ kdc/.settings/org.eclipse.wst.common.component (revision 2)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="kdc">
+ <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
+ <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/.apt_generated"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/annotations"/>
+ <property name="context-root" value="kdc"/>
+ <property name="java-output-path" value="/kdc/target/classes"/>
+ </wb-module>
+</project-modules>
Index: kdc/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
===================================================================
--- kdc/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml (nonexistent)
+++ kdc/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml (revision 2)
@@ -0,0 +1,7 @@
+<root>
+ <facet id="jst.jaxrs">
+ <node name="libprov">
+ <attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
+ </node>
+ </facet>
+</root>
Index: kdc/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- kdc/.settings/org.eclipse.wst.common.project.facet.core.xml (nonexistent)
+++ kdc/.settings/org.eclipse.wst.common.project.facet.core.xml (revision 2)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="wst.jsdt.web"/>
+ <installed facet="java" version="1.8"/>
+ <installed facet="jst.web" version="3.1"/>
+ <installed facet="wst.jsdt.web" version="1.0"/>
+ <installed facet="jst.jaxrs" version="2.0"/>
+</faceted-project>
Index: kdc/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- kdc/.settings/org.eclipse.wst.jsdt.ui.superType.container (nonexistent)
+++ kdc/.settings/org.eclipse.wst.jsdt.ui.superType.container (revision 2)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Index: kdc/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- kdc/.settings/org.eclipse.wst.jsdt.ui.superType.name (nonexistent)
+++ kdc/.settings/org.eclipse.wst.jsdt.ui.superType.name (revision 2)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Index: kdc/.settings/org.eclipse.wst.validation.prefs
===================================================================
--- kdc/.settings/org.eclipse.wst.validation.prefs (nonexistent)
+++ kdc/.settings/org.eclipse.wst.validation.prefs (revision 2)
@@ -0,0 +1,2 @@
+disabled=06target
+eclipse.preferences.version=1
Index: kdc/.settings/org.springframework.ide.eclipse.prefs
===================================================================
--- kdc/.settings/org.springframework.ide.eclipse.prefs (nonexistent)
+++ kdc/.settings/org.springframework.ide.eclipse.prefs (revision 2)
@@ -0,0 +1,2 @@
+boot.validation.initialized=true
+eclipse.preferences.version=1
Index: kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdController.java (revision 2)
@@ -0,0 +1,81 @@
+package com.kdc.api.checkinvitationcd;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.enums.AuthenticationModeEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * 招待コード認証 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class CheckInvitationCdController {
+
+ private static final Logger logger = LoggerFactory.getLogger(CheckInvitationCdController.class);
+
+ @Autowired
+ private CheckInvitationCdService checkInvitationCdService;
+
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/check/invitation", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public CheckInvitationCdResponseEntity checkInvitationCd(@RequestBody CheckInvitationCdRequestEntity bean,
+ HttpServletResponse response) {
+
+ UserInfoEntity userInfo = new UserInfoEntity();
+ userInfo.setUserId(bean.getInvitationCd());
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.CHECK_INVITATION, userInfo, bean.getDeviceInfo()));
+
+ // レスポンス作成
+ CheckInvitationCdResponseEntity resEntity = new CheckInvitationCdResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_CHECK_INVITATION);
+
+ // チェック関連
+ if (!this.checkInvitationCdService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.CHECK_INVITATION, userInfo, bean.getDeviceInfo(),
+ "parameterCheck"));
+ return resEntity;
+ }
+
+ switch (AuthenticationModeEnum.valueOf(bean.getMode())) {
+ case LOGIN:
+ case REGISTER_USER:
+ // 招待管理table更新
+ if (!this.checkInvitationCdService.updateInvitationManagement(bean, resEntity)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.CHECK_INVITATION, userInfo, bean.getDeviceInfo(),
+ "updateInvitationManagement"));
+ return resEntity;
+ }
+ break;
+ case NEW_GROUP:
+ // 新規グループ作成時は招待コード不要
+ break;
+ }
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.CHECK_INVITATION, userInfo, bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdRequestEntity.java (revision 2)
@@ -0,0 +1,55 @@
+package com.kdc.api.checkinvitationcd;
+
+import com.kdc.common.entity.api.base.DeviceInfoEntity;
+
+public class CheckInvitationCdRequestEntity {
+
+ private Integer mode;
+ private String invitationCd;
+ private DeviceInfoEntity deviceInfo;
+
+ /**
+ * @return mode
+ */
+ public Integer getMode() {
+ return mode;
+ }
+
+ /**
+ * @param mode セットする mode
+ */
+ public void setMode(Integer mode) {
+ this.mode = mode;
+ }
+
+ /**
+ * @return invitationCd
+ */
+ public String getInvitationCd() {
+ return invitationCd;
+ }
+
+ /**
+ * @param invitationCd
+ * セットする invitationCd
+ */
+ public void setInvitationCd(String invitationCd) {
+ this.invitationCd = invitationCd;
+ }
+
+ /**
+ * @return deviceInfo
+ */
+ public DeviceInfoEntity getDeviceInfo() {
+ return deviceInfo;
+ }
+
+ /**
+ * @param deviceInfo
+ * セットする deviceInfo
+ */
+ public void setDeviceInfo(DeviceInfoEntity deviceInfo) {
+ this.deviceInfo = deviceInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdResponseEntity.java (revision 2)
@@ -0,0 +1,24 @@
+package com.kdc.api.checkinvitationcd;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class CheckInvitationCdResponseEntity extends ResponseBaseEntity {
+
+ private Integer authFlg;
+
+ /**
+ * @return authFlg
+ */
+ public Integer getAuthFlg() {
+ return authFlg;
+ }
+
+ /**
+ * @param authFlg
+ * セットする authFlg
+ */
+ public void setAuthFlg(Integer authFlg) {
+ this.authFlg = authFlg;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/checkinvitationcd/CheckInvitationCdService.java (revision 2)
@@ -0,0 +1,131 @@
+package com.kdc.api.checkinvitationcd;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.InvitationManagementEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.enums.AuthenticationModeEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.api.CheckInvitationCdMapper;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+
+/**
+ * 招待コード認証 API Service クラス
+ *
+ */
+@Service
+public class CheckInvitationCdService {
+
+ @Autowired
+ private CheckInvitationCdMapper checkInvitationCdMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ @Autowired
+ private UserMasterMapper userMasterMappaer;
+
+ /**
+ * パラメータチェック.
+ *
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(CheckInvitationCdRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ // モード
+ if (reqEntity.getMode() == null) {
+ resEntity.setMessage("mode is Empty");
+ return false;
+ }
+ try {
+ AuthenticationModeEnum.valueOf(reqEntity.getMode());
+ } catch (IllegalArgumentException e) {
+ resEntity.setMessage("mode is Wrong");
+ return false;
+ }
+
+ // 招待コード
+ switch (AuthenticationModeEnum.valueOf(reqEntity.getMode())) {
+ case LOGIN:
+ case REGISTER_USER:
+ if (StringUtils.isEmpty(reqEntity.getInvitationCd())) {
+ resEntity.setMessage("invitationCd is Empty");
+ return false;
+ }
+ if ( CommonConst.INVITATION_CD.equals(reqEntity.getInvitationCd())) {
+ //ユーザー存在チェック
+ List<UserMasterEntity> userList = this.userMasterMappaer.selectAll();
+ if ( userList.size() == 0 ) {
+ //ユーザー不在の場合、スルー
+ return true;
+ }
+ }
+ break;
+ case NEW_GROUP:
+ // 新規グループ作成時は招待コード不要
+ break;
+ }
+
+ // 端末情報
+ if (!this.commonService.checkDeviceInfoValues(reqEntity.getDeviceInfo(), resEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * 招待管理テーブル更新.
+ *
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean updateInvitationManagement(CheckInvitationCdRequestEntity reqEntity,
+ CheckInvitationCdResponseEntity resEntity) {
+
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+
+ //初回ユーザー処理 招待コード=1111111で認証スルー
+ if ( CommonConst.INVITATION_CD.equals(reqEntity.getInvitationCd())) {
+ return true;
+ }
+
+ // 招待管理テーブル情報更新
+ InvitationManagementEntity rec = new InvitationManagementEntity();
+ rec.setInvitationcode(reqEntity.getInvitationCd());
+ rec.setGuesttelephonenumber(reqEntity.getDeviceInfo().getTelephoneNumber());
+ rec.setExpirationdate(nowTimestamp);
+ rec.setUpdateuserid(reqEntity.getDeviceInfo().getTelephoneNumber());
+ rec.setUpdatedate(nowTimestamp);
+
+ try {
+ // 招待コード一致、有効期限以内、使用フラグ=0、使用者ID・電話番号=NULL)
+ int count = this.checkInvitationCdMapper.updateInvitationManagement(rec);
+
+ // 更新件数0の場合、認証失敗。
+ if (count == 0) {
+ // 認証失敗は正常処理
+ resEntity.setMessage("invitationCode is invalid");
+ resEntity.setAuthFlg(CommonConst.FLG_OFF);
+ return true;
+ }
+
+ // 更新件数>0の場合、認証成功。
+ resEntity.setAuthFlg(CommonConst.FLG_ON);
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/checkuser/CheckUserController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/checkuser/CheckUserController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/checkuser/CheckUserController.java (revision 2)
@@ -0,0 +1,69 @@
+package com.kdc.api.checkuser;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+/**
+ * ユーザーチェック API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class CheckUserController {
+ private static final Logger logger = LoggerFactory.getLogger(CheckUserController.class);
+
+ @Autowired
+ private CheckUserService checkUserService;
+
+ //チェックユーザー
+ @RequestMapping(path = CommonConst.API_BASE_URL + "/checkuser", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE )
+ public CheckUserResponseEntity checkUser(@RequestBody CheckUserRequestEntity bean, HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.CHECK_USER, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ //レスポンス作成
+ CheckUserResponseEntity resEntity = new CheckUserResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_CHECK_USER);
+
+ //パラメータチェック
+ if (!this.checkUserService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.CHECK_USER, bean.getUserInfo(), bean.getDeviceInfo(),
+ "parameterCheck"));
+ return resEntity;
+ }
+
+
+ //登録存在チェック(true:存在しない false:存在する)
+ if(this.checkUserService.checkRegistration(bean, resEntity)) {
+ //ユーザー存在する
+ resEntity.setUserExistsFlg(CommonConst.CHECK_USER_EXIST);
+ } else {
+ //ユーザー存在しない
+ resEntity.setUserExistsFlg(CommonConst.CHECK_USER_NOT_EXIST);
+ //初期パスワード取得
+ String password = this.checkUserService.getPassword(bean, resEntity);
+ //パスワード設定
+ resEntity.setPassword(password);
+ }
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.CHECK_USER, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/checkuser/CheckUserRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/checkuser/CheckUserRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/checkuser/CheckUserRequestEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.checkuser;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class CheckUserRequestEntity extends RequestBaseEntity {
+
+}
Index: kdc/src/main/java/com/kdc/api/checkuser/CheckUserResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/checkuser/CheckUserResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/checkuser/CheckUserResponseEntity.java (revision 2)
@@ -0,0 +1,26 @@
+package com.kdc.api.checkuser;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class CheckUserResponseEntity extends ResponseBaseEntity {
+
+ private int userExistsFlg = 0; //ユーザー存在フラグ 0:存在しない 1:存在する
+ private String password = ""; //初期パスワード
+
+ public int getUserExistsFlg() {
+ return userExistsFlg;
+ }
+
+ public void setUserExistsFlg(int userExistsFlg) {
+ this.userExistsFlg = userExistsFlg;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/checkuser/CheckUserService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/checkuser/CheckUserService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/checkuser/CheckUserService.java (revision 2)
@@ -0,0 +1,61 @@
+package com.kdc.api.checkuser;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.kdc.common.entity.db.ConfigMasterEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.mybatis.mapper.common.entity.ConfigMasterMapper;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+
+@Service
+public class CheckUserService {
+
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ @Autowired
+ private ConfigMasterMapper configMasterMapper;
+
+ /**
+ * パラメータチェック
+ *
+ */
+ public Boolean parameterCheck(CheckUserRequestEntity reqEntity, CheckUserResponseEntity resEntity) {
+
+ //端末
+ if ( reqEntity.getDeviceInfo() == null ) {
+ resEntity.setMessage("deviceInfo is Empty ");
+ return false;
+ }
+ //単項目チェック
+ if ( !this.commonService.checkDeviceInfoValues(reqEntity.getDeviceInfo(), resEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public Boolean checkRegistration(CheckUserRequestEntity bean, CheckUserResponseEntity res) {
+ //ユーザー情報取得(1人でもユーザが存在するか)
+ List<UserMasterEntity> userList = this.userMasterMapper.selectAll();
+ if ( userList.size() > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ public String getPassword(CheckUserRequestEntity bean, CheckUserResponseEntity res) {
+ //初期パスワード取得
+ List<ConfigMasterEntity> configList = this.configMasterMapper.selectCodeList(CommonConst.CONFIG_ID_INIT_PASSWORD,"0");
+ String password = (configList != null) ? String.valueOf(configList.get(0).getConfigcode()) : "0";
+ return password;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/deluser/DelUserController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/deluser/DelUserController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/deluser/DelUserController.java (revision 2)
@@ -0,0 +1,68 @@
+package com.kdc.api.deluser;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * ユーザ削除 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class DelUserController {
+
+ private static final Logger logger = LoggerFactory.getLogger(DelUserController.class);
+
+ @Autowired
+ private DelUserService delUserService;
+
+ // ユーザ削除
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/admin/deluser", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public DelUserResponseEntity delUser(@RequestBody DelUserRequestEntity bean, HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.ADMIN_DELUSER, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ DelUserResponseEntity resEntity = new DelUserResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_ADMIN_DELUSER);
+
+ // パラメータチェック
+ if (!this.delUserService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.ADMIN_DELUSER, bean.getUserInfo(), bean.getDeviceInfo(),
+ "parameterCheck"));
+ return resEntity;
+ }
+
+ // 削除(update)
+ if (!this.delUserService.delete(bean, resEntity)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.ADMIN_DELUSER, bean.getUserInfo(), bean.getDeviceInfo(),
+ "delete"));
+ return resEntity;
+ }
+
+ // レスポンス作成
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.ADMIN_DELUSER, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/deluser/DelUserRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/deluser/DelUserRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/deluser/DelUserRequestEntity.java (revision 2)
@@ -0,0 +1,24 @@
+package com.kdc.api.deluser;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class DelUserRequestEntity extends RequestBaseEntity {
+
+ private String targetUserId;
+
+ /**
+ * @return targetUserId
+ */
+ public String getTargetUserId() {
+ return targetUserId;
+ }
+
+ /**
+ * @param targetUserId
+ * セットする targetUserId
+ */
+ public void setTargetUserId(String targetUserId) {
+ this.targetUserId = targetUserId;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/deluser/DelUserResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/deluser/DelUserResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/deluser/DelUserResponseEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.deluser;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class DelUserResponseEntity extends ResponseBaseEntity {
+
+}
Index: kdc/src/main/java/com/kdc/api/deluser/DelUserService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/deluser/DelUserService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/deluser/DelUserService.java (revision 2)
@@ -0,0 +1,78 @@
+package com.kdc.api.deluser;
+
+import java.sql.Timestamp;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+
+/**
+ * ユーザ削除 API Service クラス
+ *
+ */
+@Service
+public class DelUserService {
+
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(DelUserRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ // ユーザ・端末情報
+ if (!this.commonService.checkBaseParameter(reqEntity, resEntity)) {
+ return false;
+ }
+
+ // 対象ユーザID
+ if (StringUtils.isEmpty(reqEntity.getTargetUserId())) {
+ resEntity.setMessage("targetUserId is Empty");
+ return false;
+ }
+
+ // 権限チェック
+ if (!this.commonService.isAdminUser(reqEntity.getUserInfo(), resEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * ユーザ削除.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean delete(DelUserRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+
+ UserMasterEntity rec = new UserMasterEntity();
+ rec.setUserid(reqEntity.getTargetUserId());
+ rec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ rec.setUpdatedate(nowTimestamp);
+ try {
+ this.userMasterMapper.delete(rec);
+ } catch (Exception e) {
+ return false;
+ }
+
+ return true;
+
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getapk/GetApkController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getapk/GetApkController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getapk/GetApkController.java (revision 2)
@@ -0,0 +1,52 @@
+package com.kdc.api.getapk;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.tomcat.util.http.fileupload.IOUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.ResourceLoader;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * APKファイルダウンロード API Controller クラス
+ *
+ */
+@RestController
+public class GetApkController {
+
+ @Autowired
+ private ResourceLoader resourceLoader;
+
+ // APKファイルをサーバからダウンロード
+ @RequestMapping(path = CommonConst.API_BASE_URL + "/dl/apk", method = RequestMethod.GET)
+ public HttpEntity<byte[]> getApk(HttpServletResponse httpServletResponse) throws IOException {
+
+ Resource resource = this.resourceLoader
+ .getResource("file:" + CommonConst.SYSTEM_MODULE_PATH + CommonConst.APK_FILE_NAME);
+ InputStream inputStream = resource.getInputStream();
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+
+ // byteへ変換
+ IOUtils.copy(inputStream, byteArrayOutputStream);
+ byte[] binFile = byteArrayOutputStream.toByteArray();
+
+ // レスポンスデータとして返却
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
+ headers.setContentDispositionFormData("filename", CommonConst.APK_FILE_NAME);
+ headers.setContentLength(binFile.length);
+ return new HttpEntity<byte[]>(binFile, headers);
+ }
+}
Index: kdc/src/main/java/com/kdc/api/getconfig/GetConfigController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getconfig/GetConfigController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getconfig/GetConfigController.java (revision 2)
@@ -0,0 +1,69 @@
+package com.kdc.api.getconfig;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.getconfig.GetConfigRequestEntity;
+import com.kdc.api.getconfig.GetConfigResponseEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * 設定取得 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class GetConfigController {
+
+ private static final Logger logger = LoggerFactory.getLogger(GetConfigController.class);
+
+ @Autowired
+ private GetConfigService getConfigService;
+
+ // 設定取得
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/config", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public GetConfigResponseEntity getConfig(@RequestBody GetConfigRequestEntity bean, HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.GET_CONFIG, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ GetConfigResponseEntity resEntity = new GetConfigResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_GET_CONFIG);
+
+ // パラメータチェック
+ if (!this.getConfigService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.GET_CONFIG, bean.getUserInfo(), bean.getDeviceInfo(),
+ "parameterCheck"));
+ return resEntity;
+ }
+
+ // 設定情報取得
+ if (!this.getConfigService.setConfig(bean, resEntity)) {
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.GET_CONFIG, bean.getUserInfo(), bean.getDeviceInfo(),
+ "setConfig"));
+ return resEntity;
+ }
+
+ // レスポンス作成
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.GET_CONFIG, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/getconfig/GetConfigRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getconfig/GetConfigRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getconfig/GetConfigRequestEntity.java (revision 2)
@@ -0,0 +1,25 @@
+package com.kdc.api.getconfig;
+
+import com.kdc.common.entity.api.UpdateInfoEntity;
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class GetConfigRequestEntity extends RequestBaseEntity {
+
+ private UpdateInfoEntity updateInfo;
+
+ /**
+ * @return updateInfo
+ */
+ public UpdateInfoEntity getUpdateInfo() {
+ return updateInfo;
+ }
+
+ /**
+ * @param updateInfo
+ * セットする updateInfo
+ */
+ public void setUpdateInfo(UpdateInfoEntity updateInfo) {
+ this.updateInfo = updateInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getconfig/GetConfigResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getconfig/GetConfigResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getconfig/GetConfigResponseEntity.java (revision 2)
@@ -0,0 +1,95 @@
+package com.kdc.api.getconfig;
+
+import java.util.List;
+
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.api.PlaceNotificationConfigInfoEntity;
+import com.kdc.common.entity.api.TransmissionConfigInfoEntity;
+import com.kdc.common.entity.api.UserNotificationConfigInfoEntity;
+import com.kdc.common.entity.api.UtilityConfigInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class GetConfigResponseEntity extends ResponseBaseEntity {
+
+ private UserInfoEntity userInfo;
+ private List<UserNotificationConfigInfoEntity> userNotificationConfigInfo;
+ private List<PlaceNotificationConfigInfoEntity> placeNotificationConfigInfo;
+ private List<TransmissionConfigInfoEntity> transmissionConfigInfo;
+ private List<UtilityConfigInfoEntity> utilityConfigInfo;
+
+ /**
+ * @return userInfo
+ */
+ public UserInfoEntity getUserInfo() {
+ return userInfo;
+ }
+
+ /**
+ * @param userInfo
+ * セットする userInfo
+ */
+ public void setUserInfo(UserInfoEntity userInfo) {
+ this.userInfo = userInfo;
+ }
+
+ /**
+ * @return userNotificationConfigInfo
+ */
+ public List<UserNotificationConfigInfoEntity> getUserNotificationConfigInfo() {
+ return userNotificationConfigInfo;
+ }
+
+ /**
+ * @param userNotificationConfigInfo
+ * セットする userNotificationConfigInfo
+ */
+ public void setUserNotificationConfigInfo(List<UserNotificationConfigInfoEntity> userNotificationConfigInfo) {
+ this.userNotificationConfigInfo = userNotificationConfigInfo;
+ }
+
+ /**
+ * @return placeNotificationConfigInfo
+ */
+ public List<PlaceNotificationConfigInfoEntity> getPlaceNotificationConfigInfo() {
+ return placeNotificationConfigInfo;
+ }
+
+ /**
+ * @param placeNotificationConfigInfo
+ * セットする placeNotificationConfigInfo
+ */
+ public void setPlaceNotificationConfigInfo(List<PlaceNotificationConfigInfoEntity> placeNotificationConfigInfo) {
+ this.placeNotificationConfigInfo = placeNotificationConfigInfo;
+ }
+
+ /**
+ * @return transmissionConfigInfo
+ */
+ public List<TransmissionConfigInfoEntity> getTransmissionConfigInfo() {
+ return transmissionConfigInfo;
+ }
+
+ /**
+ * @param transmissionConfigInfo
+ * セットする transmissionConfigInfo
+ */
+ public void setTransmissionConfigInfo(List<TransmissionConfigInfoEntity> transmissionConfigInfo) {
+ this.transmissionConfigInfo = transmissionConfigInfo;
+ }
+
+ /**
+ * @return utilityConfigInfo
+ */
+ public List<UtilityConfigInfoEntity> getUtilityConfigInfo() {
+ return utilityConfigInfo;
+ }
+
+ /**
+ * @param utilityConfigInfo
+ * セットする utilityConfigInfo
+ */
+ public void setUtilityConfigInfo(List<UtilityConfigInfoEntity> utilityConfigInfo) {
+ this.utilityConfigInfo = utilityConfigInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getconfig/GetConfigService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getconfig/GetConfigService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getconfig/GetConfigService.java (revision 2)
@@ -0,0 +1,308 @@
+package com.kdc.api.getconfig;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.PlaceNotificationConfigInfoEntity;
+import com.kdc.common.entity.api.PlaceNotificationInfoEntity;
+import com.kdc.common.entity.api.TransmissionConfigInfoEntity;
+import com.kdc.common.entity.api.UserNotificationConfigInfoEntity;
+import com.kdc.common.entity.api.UtilityConfigInfoEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.ConfigMasterEntity;
+import com.kdc.common.entity.db.PlaceAlertConfigEntity;
+import com.kdc.common.entity.db.SendIntervalConfigEntity;
+import com.kdc.common.entity.db.UserAlertConfigEntity;
+import com.kdc.common.entity.db.UserDeviceEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.api.GetConfigMapper;
+import com.kdc.mybatis.mapper.common.entity.ConfigMasterMapper;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+
+/**
+ * 設定取得 API Service クラス
+ *
+ */
+@Service
+public class GetConfigService {
+
+ @Autowired
+ private GetConfigMapper getConfigMapper;
+
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private ConfigMasterMapper configMasterMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(GetConfigRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ // 必須チェック
+ // ユーザ・端末 基本情報
+ if (!this.commonService.checkBaseParameter(reqEntity, resEntity)) {
+ return false;
+ }
+
+ // (更新情報)
+ if (reqEntity.getUpdateInfo() == null) {
+ resEntity.setMessage("updateInfo is Empty");
+ return false;
+ }
+
+ // ユーザ設定更新フラグ
+ if (reqEntity.getUpdateInfo().getUserUpdateFlg() == null) {
+ resEntity.setMessage("updateInfo.userUpdateFlg is Empty");
+ return false;
+ }
+ // 送信設定更新フラグ
+ if (reqEntity.getUpdateInfo().getTransmissionUpdateFlg() == null) {
+ resEntity.setMessage("updateInfo.transmissionUpdateFlg is Empty");
+ return false;
+ }
+ // 汎用設定更新フラグ
+ if (reqEntity.getUpdateInfo().getUtilityUpdateFlg() == null) {
+ resEntity.setMessage("updateInfo.utilityUpdateFlg is Empty");
+ return false;
+ }
+ // ユーザ通知設定更新フラグ
+ if (reqEntity.getUpdateInfo().getUserNotificationUpdateFlg() == null) {
+ resEntity.setMessage("updateInfo.userNotificationUpdateFlg is Empty");
+ return false;
+ }
+ // 場所通知設定更新フラグ
+ if (reqEntity.getUpdateInfo().getPlaceNotificationUpdateFlg() == null) {
+ resEntity.setMessage("updateInfo.placeNotificationUpdateFlg is Empty");
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * 設定取得.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean setConfig(GetConfigRequestEntity reqEntity, GetConfigResponseEntity resEntity) {
+
+ UserMasterEntity usermaster = this.userMasterMapper.selectByPk(reqEntity.getUserInfo().getUserId(),
+ CommonConst.FLG_OFF);
+
+ // ユーザ設定取得
+ if (KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getUserUpdateFlg())) {
+
+ UserInfoEntity result1 = new UserInfoEntity();
+ result1.setUserId(usermaster.getUserid());
+ result1.setPassword(usermaster.getPassword());
+ result1.setUserName(usermaster.getUsername());
+ result1.setIconId(usermaster.getIconid());
+ result1.setGroupId(usermaster.getGroupid());
+ result1.setAuthLevel(String.valueOf(usermaster.getAuthlevel()));
+ result1.setLineColor(usermaster.getLinecolor());
+ result1.setMarkerColor(String.valueOf(usermaster.getMarkercolor()));
+ resEntity.setUserInfo(result1);
+
+ }
+
+ // ユーザ通知設定取得
+ if (KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getUserNotificationUpdateFlg())) {
+
+ List<UserNotificationConfigInfoEntity> result2 = new ArrayList<>();
+
+ List<UserAlertConfigEntity> conflist = this.getConfigMapper
+ .getUserAlertConfigList(usermaster.getAuthlevel(),usermaster.getGroupid());
+
+ if (conflist != null) {
+ for (UserAlertConfigEntity conf : conflist) {
+
+ UserNotificationConfigInfoEntity userNotificationConfigInfo = new UserNotificationConfigInfoEntity();
+
+ userNotificationConfigInfo.setAuthLevel(String.valueOf(conf.getAuthlevel()));
+ userNotificationConfigInfo
+ .setNotificationAuthLevel(String.valueOf(conf.getNotificationauthlevel()));
+
+ userNotificationConfigInfo.setLocationDisplayFlg(String.valueOf(conf.getLocationdisplayflg()));
+ userNotificationConfigInfo
+ .setMovingDistanceDisplayFlg(String.valueOf(conf.getMovingdistancedisplayflg()));
+ userNotificationConfigInfo
+ .setBatteryLevelDisplayFlg(String.valueOf(conf.getBatteryleveldisplayflg()));
+ userNotificationConfigInfo.setAccessTimeDisplayFlg(String.valueOf(conf.getAccesstimedisplayflg()));
+ userNotificationConfigInfo
+ .setReceptionLevelDisplayFlg(String.valueOf(conf.getReceptionstatusdisplayflg()));
+
+ userNotificationConfigInfo.setBatterylevelAlertFlg(String.valueOf(conf.getBatterylevelalertflg()));
+ userNotificationConfigInfo.setBatteryNotification(String.valueOf(conf.getBatterynotification()));
+ userNotificationConfigInfo.setConnectionPopup(String.valueOf(conf.getConnectionpopup()));
+ userNotificationConfigInfo.setBatteryAlarmTime(String.valueOf(conf.getBatteryalarmtime()));
+ userNotificationConfigInfo.setBatteryVibrationTime(String.valueOf(conf.getBatteryvibrationtime()));
+ userNotificationConfigInfo.setBatteryReference(String.valueOf(conf.getBatteryreference()));
+
+ userNotificationConfigInfo.setConnectionAlertFlg(String.valueOf(conf.getConnectionalertflg()));
+ userNotificationConfigInfo
+ .setConnectionNotification(String.valueOf(conf.getConnectionnotification()));
+ userNotificationConfigInfo.setConnectionPopup(String.valueOf(conf.getConnectionpopup()));
+ userNotificationConfigInfo.setConnectionAlarmTime(String.valueOf(conf.getConnectionalarmtime()));
+ userNotificationConfigInfo
+ .setConnectionVibrationTime(String.valueOf(conf.getConnectionvibrationtime()));
+
+ userNotificationConfigInfo.setSosAlertFlg(String.valueOf(conf.getSosalertflg()));
+ userNotificationConfigInfo.setSosNotification(String.valueOf(conf.getSosnotification()));
+ userNotificationConfigInfo.setSosPopup(String.valueOf(conf.getSospopup()));
+ userNotificationConfigInfo.setSosAlarmTime(String.valueOf(conf.getSosalarmtime()));
+ userNotificationConfigInfo.setSosVibrationTime(String.valueOf(conf.getSosvibrationtime()));
+
+ result2.add(userNotificationConfigInfo);
+ }
+ resEntity.setUserNotificationConfigInfo(result2);
+ }
+ }
+
+ // 場所通知設定取得
+ if (KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getPlaceNotificationUpdateFlg())) {
+
+ List<PlaceNotificationConfigInfoEntity> result3 = new ArrayList<>();
+
+ List<PlaceAlertConfigEntity> list1 = this.getConfigMapper
+ .getPlaceAlertConfigList(usermaster.getAuthlevel(),usermaster.getGroupid());
+
+ List<PlaceNotificationInfoEntity> placelist = new ArrayList<>();
+ PlaceNotificationConfigInfoEntity placeNotificationConfigInfo = new PlaceNotificationConfigInfoEntity();
+
+ if (list1 != null) {
+ for (int j = 0; j < list1.size(); j++) {
+ if (j == 0) {
+
+ placeNotificationConfigInfo.setAuthLevel(String.valueOf(list1.get(j).getAuthlevel()));
+ placeNotificationConfigInfo
+ .setNotificationAuthLevel(String.valueOf(list1.get(j).getNotificationauthlevel()));
+
+ } else {
+
+ if (placeNotificationConfigInfo.getAuthLevel() != null && Integer
+ .parseInt(placeNotificationConfigInfo.getAuthLevel()) != list1.get(j).getAuthlevel()) {
+
+ result3.add(placeNotificationConfigInfo);
+
+ placelist = new ArrayList<>();
+
+ placeNotificationConfigInfo = new PlaceNotificationConfigInfoEntity();
+
+ placeNotificationConfigInfo.setAuthLevel(String.valueOf(list1.get(j).getAuthlevel()));
+ placeNotificationConfigInfo
+ .setNotificationAuthLevel(String.valueOf(list1.get(j).getNotificationauthlevel()));
+
+ }
+
+ }
+ PlaceNotificationInfoEntity place = new PlaceNotificationInfoEntity();
+
+ place.setPlaceId(String.valueOf(list1.get(j).getPlaceid()));
+ place.setPlaceAlertFlg(String.valueOf(list1.get(j).getPlacealertflg()));
+ place.setPlaceNotification(String.valueOf(list1.get(j).getPlacenotification()));
+ place.setPlacePopup(String.valueOf(list1.get(j).getPlacepopup()));
+ place.setPlaceAlarmTime(String.valueOf(list1.get(j).getPlacealarmtime()));
+ place.setPlaceVibrationTime(String.valueOf(list1.get(j).getPlacevibrationtime()));
+
+ placelist.add(place);
+
+ placeNotificationConfigInfo.setPlaceNotificationInfo(placelist);
+ }
+
+ result3.add(placeNotificationConfigInfo);
+ resEntity.setPlaceNotificationConfigInfo(result3);
+ }
+ }
+
+ // 送信間隔取得
+ if (KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getTransmissionUpdateFlg())) {
+
+ List<TransmissionConfigInfoEntity> result4 = new ArrayList<>();
+
+ // 送信間隔は全管理レベル分を取得する
+ List<SendIntervalConfigEntity> list = this.getConfigMapper.getSendIntervalConfigList(reqEntity.getUserInfo().getGroupId());
+
+ if (list != null) {
+ for (SendIntervalConfigEntity entity : list) {
+ TransmissionConfigInfoEntity send = new TransmissionConfigInfoEntity();
+
+ send.setAuthLevel(String.valueOf(entity.getAuthlevel()));
+ send.setDayOfWeek(String.valueOf(entity.getDayofweek()));
+ send.setConfigNo(String.valueOf(entity.getConfigno()));
+ send.setStartTime(KdcCommonUtils.timeToHourMinuteString(entity.getStarttime()));
+ send.setEndTime(KdcCommonUtils.timeToHourMinuteString(entity.getEndtime()));
+ send.setInterval(String.valueOf(entity.getTransmissioninterval()));
+
+ result4.add(send);
+
+ }
+
+ resEntity.setTransmissionConfigInfo(result4);
+ }
+ }
+
+ // 汎用設定取得
+ if (KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getUtilityUpdateFlg())) {
+
+ List<UtilityConfigInfoEntity> result5 = new ArrayList<>();
+
+ List<ConfigMasterEntity> confmasterlist = this.configMasterMapper.selectAll(reqEntity.getUserInfo().getGroupId(), CommonConst.FLG_OFF, true,
+ true);
+
+ if (confmasterlist != null) {
+ for (ConfigMasterEntity confmaster : confmasterlist) {
+
+ UtilityConfigInfoEntity util = new UtilityConfigInfoEntity();
+
+ util.setConfigId(String.valueOf(confmaster.getConfigid()));
+ util.setConfigCode(String.valueOf(confmaster.getConfigcode()));
+ util.setConfigName(confmaster.getConfigname());
+ util.setConfigParam1(confmaster.getConfigparam1());
+ util.setConfigParam2(confmaster.getConfigparam2());
+ util.setConfigParam3(confmaster.getConfigparam3());
+ util.setConfigParam4(confmaster.getConfigparam4());
+ util.setConfigParam5(confmaster.getConfigparam5());
+
+ result5.add(util);
+
+ }
+ resEntity.setUtilityConfigInfo(result5);
+ }
+ }
+
+ // 設定同期日時更新
+ if (KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getUserUpdateFlg())
+ || KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getUserNotificationUpdateFlg())
+ || KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getPlaceNotificationUpdateFlg())
+ || KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getTransmissionUpdateFlg())
+ || KdcCommonUtils.isFlgOn(reqEntity.getUpdateInfo().getUtilityUpdateFlg())) {
+
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+ UserDeviceEntity devrec = new UserDeviceEntity();
+ devrec.setUserid(reqEntity.getUserInfo().getUserId());
+ devrec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ devrec.setUpdatedate(nowTimestamp);
+ devrec.setConfigsyncdate(nowTimestamp);
+ this.getConfigMapper.updateUserDevice(devrec);
+
+ }
+
+ return true;
+ }
+
+}
\ No newline at end of file
Index: kdc/src/main/java/com/kdc/api/getgroups/GetGroupsController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getgroups/GetGroupsController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getgroups/GetGroupsController.java (revision 2)
@@ -0,0 +1,67 @@
+package com.kdc.api.getgroups;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.entity.db.GroupInfoEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * グループ取得 API コントローラクラス
+ * @author umemoto
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class GetGroupsController {
+
+ private static final Logger logger = LoggerFactory.getLogger(GetGroupsController.class);
+
+ @Autowired
+ private GetGroupsService getGroupsService;
+
+ //グループ情報取得
+ @RequestMapping(path = CommonConst.API_BASE_URL + "/group/list" , method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public GetGroupsResponseEntity getGroups(@RequestBody GetGroupsRequestEntity bean, HttpServletResponse response ) {
+ //log
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.GET_GROUPS, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ //レスポンス作成
+ GetGroupsResponseEntity resEntity = new GetGroupsResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_GET_GROUPS);
+
+ //チェック関連
+ if(!this.getGroupsService.parameterCheck(bean, resEntity)) {
+ //HTTPステータスコードをBad Request(400)に設定する
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.GET_GROUPS, bean.getUserInfo(), bean.getDeviceInfo(), "parameterCheck"));
+ return resEntity;
+ }
+
+ // DBから取得
+ List<GroupInfoEntity> groupInfo = this.getGroupsService.getGroups(bean);
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ resEntity.setGroupInfo(groupInfo);
+
+ //log
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.GET_GROUPS, bean.getUserInfo(), bean.getDeviceInfo(),response.getStatus(),resEntity.getResultCd()));
+
+ return resEntity;
+
+ }
+}
Index: kdc/src/main/java/com/kdc/api/getgroups/GetGroupsRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getgroups/GetGroupsRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getgroups/GetGroupsRequestEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.getgroups;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class GetGroupsRequestEntity extends RequestBaseEntity {
+
+}
Index: kdc/src/main/java/com/kdc/api/getgroups/GetGroupsResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getgroups/GetGroupsResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getgroups/GetGroupsResponseEntity.java (revision 2)
@@ -0,0 +1,27 @@
+package com.kdc.api.getgroups;
+
+import java.util.List;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.GroupInfoEntity;
+
+public class GetGroupsResponseEntity extends ResponseBaseEntity{
+
+ private List<GroupInfoEntity> groupInfo;
+
+ /**
+ * @return groupInfo
+ */
+ public List<GroupInfoEntity> getGroupInfo() {
+ return groupInfo;
+ }
+
+ /**
+ * @param groupInfo
+ * セットする groupInfo
+ */
+ public void setGroupInfo(List<GroupInfoEntity> groupInfo) {
+ this.groupInfo = groupInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getgroups/GetGroupsService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getgroups/GetGroupsService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getgroups/GetGroupsService.java (revision 2)
@@ -0,0 +1,51 @@
+package com.kdc.api.getgroups;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.GroupInfoEntity;
+import com.kdc.common.util.CommonService;
+import com.kdc.mybatis.mapper.api.GetGroupsMapper;
+
+/**
+ * グループ API Serviceクラス
+ */
+@Service
+public class GetGroupsService {
+
+ @Autowired
+ private GetGroupsMapper getGroupMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック
+ * @param reqEntity
+ * @param resEntity
+ * @return
+ */
+ public Boolean parameterCheck(GetGroupsRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ if(!this.commonService.checkBaseParameter(reqEntity, resEntity)){
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * グループ情報取得
+ * @param reqEntity
+ * @return
+ */
+ public List<GroupInfoEntity> getGroups(GetGroupsRequestEntity reqEntity) {
+
+ List<GroupInfoEntity> groupList = this.getGroupMapper.getGroupList();
+ return groupList;
+
+ }
+}
Index: kdc/src/main/java/com/kdc/api/geticon/GetIconController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/geticon/GetIconController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/geticon/GetIconController.java (revision 2)
@@ -0,0 +1,73 @@
+package com.kdc.api.geticon;
+
+import java.io.IOException;
+import java.util.Base64;
+import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+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 com.kdc.api.geticon.GetIconRequestEntity;
+import com.kdc.api.geticon.GetIconResponseEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * アイコン画像ダウンロード API Controller クラス
+ *
+ */
+@RestController
+public class GetIconController {
+
+ private static final Logger logger = LoggerFactory.getLogger(GetIconController.class);
+
+ @Autowired
+ private GetIconService getIconService;
+
+ // アイコン画像ファイルをサーバからダウンロード
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/dl/usericon", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public GetIconResponseEntity getUserIcon(@RequestBody GetIconRequestEntity requestEntity,
+ HttpServletResponse response) throws IOException {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.DL_USERICON, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo()));
+
+ GetIconResponseEntity responseEntity = new GetIconResponseEntity();
+ responseEntity.setApiId(CommonConst.API_ID_DL_USERICON);
+
+ // パラメータチェック
+ if (!this.getIconService.parameterCheck(requestEntity, responseEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.DL_USERICON, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "parameterCheck"));
+ return responseEntity;
+ }
+
+ // 対象ユーザマスタからアイコン取得
+ UserMasterEntity entity = this.getIconService.getUser(requestEntity);
+ if (entity.getIconfile() == null) {
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ responseEntity.setMessage("iconfile not found");
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.DL_USERICON, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "iconfile not found"));
+ return responseEntity;
+ }
+ responseEntity.setIconId(entity.getIconid());
+ responseEntity.setIconFile(Base64.getEncoder().encodeToString(entity.getIconfile()));
+
+ // レスポンス情報を登録
+ responseEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.DL_USERICON, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), response.getStatus(), responseEntity.getResultCd()));
+ return responseEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/geticon/GetIconRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/geticon/GetIconRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/geticon/GetIconRequestEntity.java (revision 2)
@@ -0,0 +1,24 @@
+package com.kdc.api.geticon;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class GetIconRequestEntity extends RequestBaseEntity {
+
+ private String targetUserId;
+
+ /**
+ * @return targetUserId
+ */
+ public String getTargetUserId() {
+ return targetUserId;
+ }
+
+ /**
+ * @param targetUserId
+ * セットする targetUserId
+ */
+ public void setTargetUserId(String targetUserId) {
+ this.targetUserId = targetUserId;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/geticon/GetIconResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/geticon/GetIconResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/geticon/GetIconResponseEntity.java (revision 2)
@@ -0,0 +1,40 @@
+package com.kdc.api.geticon;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class GetIconResponseEntity extends ResponseBaseEntity {
+
+ private String iconId;
+ private String iconFile; // BASE64でデータ送付
+
+ /**
+ * @return iconId
+ */
+ public String getIconId() {
+ return iconId;
+ }
+
+ /**
+ * @param iconId
+ * セットする iconId
+ */
+ public void setIconId(String iconId) {
+ this.iconId = iconId;
+ }
+
+ /**
+ * @return iconFile
+ */
+ public String getIconFile() {
+ return iconFile;
+ }
+
+ /**
+ * @param iconFile
+ * セットする iconFile
+ */
+ public void setIconFile(String iconFile) {
+ this.iconFile = iconFile;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/geticon/GetIconService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/geticon/GetIconService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/geticon/GetIconService.java (revision 2)
@@ -0,0 +1,49 @@
+package com.kdc.api.geticon;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+
+/**
+ * アイコン画像ダウンロード API Service クラス
+ *
+ */
+@Service
+public class GetIconService {
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(GetIconRequestEntity requestEntity, GetIconResponseEntity responseEntity) {
+ if (!this.commonService.checkBaseParameter(requestEntity, responseEntity)) {
+ return false;
+ }
+ // 対象ユーザID
+ if (StringUtils.isEmpty(requestEntity.getTargetUserId())) {
+ responseEntity.setMessage("targetUserId is Empty");
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * 対象ユーザマスタの取得
+ * @param requestEntity
+ * @return UserMasterEntity
+ */
+ public UserMasterEntity getUser(GetIconRequestEntity requestEntity) {
+ return this.userMasterMapper.selectByPk(requestEntity.getTargetUserId(), CommonConst.FLG_OFF);
+ }
+}
Index: kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdController.java (revision 2)
@@ -0,0 +1,66 @@
+package com.kdc.api.getinvitationcd;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * 招待コード発行 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class GetInvitationCdController {
+
+ private static final Logger logger = LoggerFactory.getLogger(GetInvitationCdController.class);
+
+ @Autowired
+ private GetInvitationCdService getInvitationCdService;
+
+ // 招待コード発行
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/invitation", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public GetInvitationCdResponseEntity getInvitationCd(@RequestBody GetInvitationCdRequestEntity bean,
+ HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.GET_INVITATION, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ GetInvitationCdResponseEntity resEntity = new GetInvitationCdResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_GET_INVITATION);
+
+ // チェック関連
+ if (!this.getInvitationCdService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.GET_INVITATION, bean.getUserInfo(),
+ bean.getDeviceInfo(), "parameterCheck"));
+ return resEntity;
+ }
+
+ // 招待コード取得
+ GetInvitationCdResponseEntity res = this.getInvitationCdService.getCd(bean);
+
+ resEntity.setInvitationCd(res.getInvitationCd());
+ resEntity.setExpirationDate(res.getExpirationDate());
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.GET_INVITATION, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdRequestEntity.java (revision 2)
@@ -0,0 +1,24 @@
+package com.kdc.api.getinvitationcd;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class GetInvitationCdRequestEntity extends RequestBaseEntity {
+
+ private String authLevel;
+
+ /**
+ * @return authLevel
+ */
+ public String getAuthLevel() {
+ return authLevel;
+ }
+
+ /**
+ * @param authLevel
+ * セットする authLevel
+ */
+ public void setAuthLevel(String authLevel) {
+ this.authLevel = authLevel;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdResponseEntity.java (revision 2)
@@ -0,0 +1,40 @@
+package com.kdc.api.getinvitationcd;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class GetInvitationCdResponseEntity extends ResponseBaseEntity {
+
+ private String invitationCd;
+ private String expirationDate;
+
+ /**
+ * @return invitationCd
+ */
+ public String getInvitationCd() {
+ return invitationCd;
+ }
+
+ /**
+ * @param invitationCd
+ * セットする invitationCd
+ */
+ public void setInvitationCd(String invitationCd) {
+ this.invitationCd = invitationCd;
+ }
+
+ /**
+ * @return expirationDate
+ */
+ public String getExpirationDate() {
+ return expirationDate;
+ }
+
+ /**
+ * @param expirationDate
+ * セットする expirationDate
+ */
+ public void setExpirationDate(String expirationDate) {
+ this.expirationDate = expirationDate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getinvitationcd/GetInvitationCdService.java (revision 2)
@@ -0,0 +1,101 @@
+package com.kdc.api.getinvitationcd;
+
+import java.sql.Timestamp;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.ConfigMasterEntity;
+import com.kdc.common.entity.db.InvitationManagementEntity;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.common.entity.ConfigMasterMapper;
+import com.kdc.mybatis.mapper.common.entity.InvitationManagementMapper;
+
+/**
+ * 招待コード発行 API Service クラス
+ *
+ */
+@Service
+public class GetInvitationCdService {
+
+ @Autowired
+ private InvitationManagementMapper invitationManagementMapper;
+
+ @Autowired
+ private ConfigMasterMapper configMasterMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(GetInvitationCdRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ // ユーザ・端末チェック
+ if (!this.commonService.checkBaseParameter(reqEntity, resEntity)) {
+ return false;
+ }
+ // 管理レベル
+ if (StringUtils.isEmpty(reqEntity.getAuthLevel())) {
+ resEntity.setMessage("authLevel is Empty");
+ return false;
+ }
+ // 管理レベル設定の制限
+ if (Integer.parseInt(reqEntity.getUserInfo().getAuthLevel()) < Integer.parseInt(reqEntity.getAuthLevel())) {
+ resEntity.setMessage("authLevel is Wrong");
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * 招待コード発行.レスポンス情報の作成.
+ * @param reqEntity
+ * @return GetInvitationCdResponseEntity
+ */
+ public GetInvitationCdResponseEntity getCd(GetInvitationCdRequestEntity reqEntity) {
+
+ // 招待コード発行
+ String invitationCd = this.commonService.createInvitationCode();
+
+ // 招待コードと発行ユーザ、有効期限を招待管理テーブルに登録
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+
+ // 有効期限
+ List<ConfigMasterEntity> configList = this.configMasterMapper
+ .selectCodeList(CommonConst.CONFIG_ID_INVITATION_CODE_EXPIRATION_TIME,reqEntity.getUserInfo().getGroupId());
+ int expirationTime = (configList != null) ? Integer.parseInt(configList.get(0).getConfigparam1()) : 0;
+
+ Timestamp expirationTimeStamp = KdcCommonUtils.timestampPlusTime(nowTimestamp, 0, expirationTime, 0);
+
+ InvitationManagementEntity rec = new InvitationManagementEntity();
+
+ rec.setInvitationcode(invitationCd);
+ rec.setOwneruserid(reqEntity.getUserInfo().getUserId());
+ rec.setGroupid(reqEntity.getUserInfo().getGroupId());
+ rec.setAuthlevel(Integer.parseInt(reqEntity.getAuthLevel()));
+ rec.setExpirationdate(expirationTimeStamp);
+ rec.setRegisteruserid(reqEntity.getUserInfo().getUserId());
+ rec.setRegisterdate(nowTimestamp);
+
+ this.invitationManagementMapper.insert(rec);
+
+ // レスポンス作成
+ GetInvitationCdResponseEntity entity = new GetInvitationCdResponseEntity();
+
+ entity.setExpirationDate(KdcCommonUtils.timestampToDateTimeString(expirationTimeStamp));
+ entity.setInvitationCd(invitationCd);
+
+ return entity;
+
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getlocations/GetLocationsController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getlocations/GetLocationsController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getlocations/GetLocationsController.java (revision 2)
@@ -0,0 +1,66 @@
+package com.kdc.api.getlocations;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.getlocations.GetLocationsRequestEntity;
+import com.kdc.api.getlocations.GetLocationsResponseEntity;
+import com.kdc.common.entity.api.UserLocationInfoEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * ユーザ位置情報取得 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class GetLocationsController {
+
+ private static final Logger logger = LoggerFactory.getLogger(GetLocationsController.class);
+
+ @Autowired
+ private GetLocationsService getLocationsService;
+
+ // ユーザ位置情報取得
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/locations", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public GetLocationsResponseEntity getLocations(@RequestBody GetLocationsRequestEntity bean,
+ HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.GET_LOCATIONS, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ GetLocationsResponseEntity resEntity = new GetLocationsResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_GET_LOCATIONS);
+
+ // チェック関連
+ if (!this.getLocationsService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.GET_LOCATIONS, bean.getUserInfo(), bean.getDeviceInfo(),
+ "parameterCheck"));
+ return resEntity;
+ }
+
+ // DBから取得
+ List<UserLocationInfoEntity> locationlist = this.getLocationsService.getLocations(bean);
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ resEntity.setUserLocationInfo(locationlist);
+
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.GET_LOCATIONS, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/getlocations/GetLocationsRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getlocations/GetLocationsRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getlocations/GetLocationsRequestEntity.java (revision 2)
@@ -0,0 +1,24 @@
+package com.kdc.api.getlocations;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class GetLocationsRequestEntity extends RequestBaseEntity {
+
+ private String targetDate;
+
+ /**
+ * @return targetDate
+ */
+ public String getTargetDate() {
+ return targetDate;
+ }
+
+ /**
+ * @param targetDate
+ * セットする targetDate
+ */
+ public void setTargetDate(String targetDate) {
+ this.targetDate = targetDate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getlocations/GetLocationsResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getlocations/GetLocationsResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getlocations/GetLocationsResponseEntity.java (revision 2)
@@ -0,0 +1,27 @@
+package com.kdc.api.getlocations;
+
+import java.util.List;
+
+import com.kdc.common.entity.api.UserLocationInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class GetLocationsResponseEntity extends ResponseBaseEntity {
+
+ private List<UserLocationInfoEntity> userLocationInfo;
+
+ /**
+ * @return userLocationInfo
+ */
+ public List<UserLocationInfoEntity> getUserLocationInfo() {
+ return userLocationInfo;
+ }
+
+ /**
+ * @param userLocationInfo
+ * セットする userLocationInfo
+ */
+ public void setUserLocationInfo(List<UserLocationInfoEntity> userLocationInfo) {
+ this.userLocationInfo = userLocationInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getlocations/GetLocationsService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getlocations/GetLocationsService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getlocations/GetLocationsService.java (revision 2)
@@ -0,0 +1,152 @@
+package com.kdc.api.getlocations;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.mybatis.domain.api.getlocations.UserInfoDomain;
+import com.kdc.common.entity.api.LocationInfoEntity;
+import com.kdc.common.entity.api.LocationRecordInfoEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.api.UserLocationInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.UserLocationRecordEntity;
+import com.kdc.common.entity.db.UserLocationRecordEntityWrapper;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.api.GetLocationsMapper;
+
+/**
+ * ユーザ位置情報取得 API Service クラス
+ *
+ */
+@Service
+public class GetLocationsService {
+
+ @Autowired
+ private GetLocationsMapper getLocationsMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(GetLocationsRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ if (!this.commonService.checkBaseParameter(reqEntity, resEntity)) {
+ return false;
+ }
+ // 対象日付
+ if (StringUtils.isEmpty(reqEntity.getTargetDate())) {
+ resEntity.setMessage("targetDate is Empty");
+ return false;
+ }
+ // 日付不正チェック
+ if (!KdcCommonUtils.checkDateString(reqEntity.getTargetDate())) {
+ resEntity.setMessage("targetDate is Wrong");
+ return false;
+ }
+
+ return true;
+
+ }
+
+ /**
+ * ユーザ位置情報取得.
+ * @param reqEntity
+ * @return List
+ */
+ public List<UserLocationInfoEntity> getLocations(GetLocationsRequestEntity reqEntity) {
+
+ List<UserLocationInfoEntity> result = new ArrayList<>();
+
+ List<UserInfoDomain> userList = this.getLocationsMapper.getLocationList(reqEntity.getUserInfo().getUserId(),reqEntity.getUserInfo().getGroupId());
+
+ if (userList != null) {
+ for (UserInfoDomain userEntity : userList) {
+ UserLocationInfoEntity userLocation = new UserLocationInfoEntity();
+ UserInfoEntity user = new UserInfoEntity();
+ LocationInfoEntity location = new LocationInfoEntity();
+
+ // ユーザ情報userinfo
+ user.setUserId(userEntity.getUserid());
+ user.setUserName(userEntity.getUsername());
+ user.setIconId(userEntity.getIconid());
+ user.setAuthLevel(userEntity.getAuthlevel());
+ user.setPassword(userEntity.getPassword());
+ user.setLineColor(userEntity.getLinecolor());
+ user.setMarkerColor(userEntity.getMarkercolor());
+ user.setGroupId(userEntity.getGroupid());
+
+ userLocation.setUserInfo(user);
+
+ location.setLatitude(userEntity.getLatitude());
+ location.setLongitude(userEntity.getLongitude());
+
+ // 移動距離表示許可
+ if (KdcCommonUtils.isFlgOn(userEntity.getMovingdistancedisplayflg())) {
+ location.setMovingDistance(userEntity.getMovingdistance());
+ }
+
+ // バッテリー残量表示許可
+ if (KdcCommonUtils.isFlgOn(userEntity.getBatteryleveldisplayflg())) {
+ location.setBatteryLevel(userEntity.getBatterylevel());
+ }
+
+ // 電波状況表示許可
+ if (KdcCommonUtils.isFlgOn(userEntity.getReceptionstatusdisplayflg())) {
+ location.setReceptionStatus(userEntity.getReceptionstatus());
+ }
+
+ location.setConnectionStatus(userEntity.getConnectionstatus());
+ location.setLastLocationDate(
+ KdcCommonUtils.timestampToDateTimeString(userEntity.getLastlocationdate()));
+ userLocation.setLocationInfo(location);
+
+ List<LocationRecordInfoEntity> resultLocRecList = new ArrayList<>();
+ UserLocationRecordEntity locRec = new UserLocationRecordEntity();
+ locRec.setUserid(userEntity.getUserid());
+ locRec.setReceivedate(KdcCommonUtils.dateStringToTimestamp((reqEntity.getTargetDate())));
+ List<UserLocationRecordEntityWrapper> recordlist = this.getLocationsMapper.getLocationRecordList(locRec,
+ false);
+
+ if (recordlist != null) {
+ for (UserLocationRecordEntityWrapper recordEntity : recordlist) {
+
+ LocationRecordInfoEntity locationRecord = new LocationRecordInfoEntity();
+ locationRecord
+ .setRecordDate(KdcCommonUtils.timestampToDateTimeString(recordEntity.getReceivedate()));
+ locationRecord.setLatitude(String.valueOf(recordEntity.getLatitude()));
+ locationRecord.setLongitude(String.valueOf(recordEntity.getLongitude()));
+
+ // バッテリー残量表示許可
+ if (KdcCommonUtils.isFlgOn(userEntity.getBatteryleveldisplayflg())) {
+ locationRecord.setBatteryLevel(String.valueOf(recordEntity.getBatterylevel()));
+ }
+
+ // 電波状況表示許可
+ if (KdcCommonUtils.isFlgOn(userEntity.getReceptionstatusdisplayflg())) {
+ locationRecord.setReceptionStatus(String.valueOf(recordEntity.getReceptionstatus()));
+ }
+
+ resultLocRecList.add(locationRecord);
+
+ }
+
+ userLocation.setLocationRecordInfo(resultLocRecList);
+
+ }
+
+ result.add(userLocation);
+ }
+ }
+
+ return result;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getnotifications/GetNotificationsRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getnotifications/GetNotificationsRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getnotifications/GetNotificationsRequestEntity.java (revision 2)
@@ -0,0 +1,24 @@
+package com.kdc.api.getnotifications;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class GetNotificationsRequestEntity extends RequestBaseEntity{
+
+ //通知日
+ private String notificationDate;
+
+ /**
+ * @return notificationDate
+ */
+ public String getNotificationDate() {
+ return notificationDate;
+ }
+
+ /**
+ * @param notificationdate セットする notificationDate
+ */
+ public void setNotificationdate(String notificationDate) {
+ this.notificationDate = notificationDate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getnotifications/GetNotificationsResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getnotifications/GetNotificationsResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getnotifications/GetNotificationsResponseEntity.java (revision 2)
@@ -0,0 +1,27 @@
+package com.kdc.api.getnotifications;
+
+import java.util.List;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.NotificationInfoEntity;
+
+public class GetNotificationsResponseEntity extends ResponseBaseEntity{
+
+ private List<NotificationInfoEntity> notificationInfo;
+
+ /**
+ * @return notificationInfo
+ */
+ public List<NotificationInfoEntity> getNotificationInfo() {
+ return notificationInfo;
+ }
+
+ /**
+ * @param notificationInfo セットする notificationInfo
+ */
+ public void setNotificationInfo(List<NotificationInfoEntity> notificationInfo) {
+ this.notificationInfo = notificationInfo;
+ }
+
+
+}
Index: kdc/src/main/java/com/kdc/api/getnotifications/GetNotificationsService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getnotifications/GetNotificationsService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getnotifications/GetNotificationsService.java (revision 2)
@@ -0,0 +1,50 @@
+package com.kdc.api.getnotifications;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.NotificationInfoEntity;
+import com.kdc.common.util.CommonService;
+import com.kdc.mybatis.mapper.api.GetNotificationsMapper;
+
+@Service
+public class GetNotificationsService {
+
+ @Autowired
+ private GetNotificationsMapper getNotificationMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック
+ * @param reqEntity
+ * @param resEntity
+ * @return
+ */
+ public Boolean parameterCheck(GetNotificationsRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ if(!this.commonService.checkBaseParameter(reqEntity, resEntity)){
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * グループ情報取得
+ * @param reqEntity
+ * @return
+ */
+ public List<NotificationInfoEntity> getNotifications(GetNotificationsRequestEntity reqEntity) {
+
+ //2018/11/22 仕様変更:通知履歴に日付条件の解除
+ reqEntity.setNotificationdate(null);
+ List<NotificationInfoEntity> notificationList = this.getNotificationMapper.getNotificationList(reqEntity.getUserInfo().getUserId(),reqEntity.getUserInfo().getGroupId(),reqEntity.getNotificationDate());
+ return notificationList;
+
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getnotifications/GetnotificationsController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getnotifications/GetnotificationsController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getnotifications/GetnotificationsController.java (revision 2)
@@ -0,0 +1,67 @@
+package com.kdc.api.getnotifications;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.entity.db.NotificationInfoEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * 通知情報取得 API コントローラクラス
+ * @author kerimu
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class GetnotificationsController {
+
+ private static final Logger logger = LoggerFactory.getLogger(GetnotificationsController.class);
+
+ @Autowired
+ private GetNotificationsService getNotificationsService;
+
+ //通知情報取得
+ @RequestMapping(path = CommonConst.API_BASE_URL + "/notification/list" , method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public GetNotificationsResponseEntity getNotifications(@RequestBody GetNotificationsRequestEntity bean,HttpServletResponse response ){
+
+ //log
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.GET_NOTIFICATIONS, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ //レスポンス作成
+ GetNotificationsResponseEntity resEntity = new GetNotificationsResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_GET_NOTIFICATIONS);
+
+ //チェック関連
+ if(!this.getNotificationsService.parameterCheck(bean, resEntity)) {
+ //HTTPステータスコードをBad Request(400)に設定する
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.GET_NOTIFICATIONS, bean.getUserInfo(), bean.getDeviceInfo(), "parameterCheck"));
+ return resEntity;
+ }
+
+ // DBから取得
+ List<NotificationInfoEntity> notificationInfo = this.getNotificationsService.getNotifications(bean);
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ resEntity.setMessage("Get records from DB is success.");
+ resEntity.setNotificationInfo(notificationInfo);
+
+ //log
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.GET_NOTIFICATIONS, bean.getUserInfo(), bean.getDeviceInfo(),response.getStatus(),resEntity.getResultCd()));
+ return resEntity;
+ }
+}
\ No newline at end of file
Index: kdc/src/main/java/com/kdc/api/getplaces/GetPlacesController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getplaces/GetPlacesController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getplaces/GetPlacesController.java (revision 2)
@@ -0,0 +1,65 @@
+package com.kdc.api.getplaces;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.getplaces.GetPlacesRequestEntity;
+import com.kdc.api.getplaces.GetPlacesResponseEntity;
+import com.kdc.common.entity.api.PlaceInfoEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * 場所取得 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class GetPlacesController {
+
+ private static final Logger logger = LoggerFactory.getLogger(GetPlacesController.class);
+
+ @Autowired
+ private GetPlacesService getPlacesService;
+
+ // 場所取得
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/places", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public GetPlacesResponseEntity getPlaces(@RequestBody GetPlacesRequestEntity bean, HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.GET_PLACES, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ GetPlacesResponseEntity resEntity = new GetPlacesResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_GET_PLACES);
+
+ // チェック関連
+ if (!this.getPlacesService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.GET_PLACES, bean.getUserInfo(), bean.getDeviceInfo(),
+ "parameterCheck"));
+ return resEntity;
+ }
+
+ // DBから取得
+ List<PlaceInfoEntity> placelist = this.getPlacesService.getPlace(bean);
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ resEntity.setPlaceInfo(placelist);
+
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.GET_PLACES, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/getplaces/GetPlacesRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getplaces/GetPlacesRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getplaces/GetPlacesRequestEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.getplaces;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class GetPlacesRequestEntity extends RequestBaseEntity {
+
+}
Index: kdc/src/main/java/com/kdc/api/getplaces/GetPlacesResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getplaces/GetPlacesResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getplaces/GetPlacesResponseEntity.java (revision 2)
@@ -0,0 +1,27 @@
+package com.kdc.api.getplaces;
+
+import java.util.List;
+
+import com.kdc.common.entity.api.PlaceInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class GetPlacesResponseEntity extends ResponseBaseEntity {
+
+ private List<PlaceInfoEntity> placeInfo;
+
+ /**
+ * @return placeInfo
+ */
+ public List<PlaceInfoEntity> getPlaceInfo() {
+ return placeInfo;
+ }
+
+ /**
+ * @param placeInfo
+ * セットする placeInfo
+ */
+ public void setPlaceInfo(List<PlaceInfoEntity> placeInfo) {
+ this.placeInfo = placeInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getplaces/GetPlacesService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getplaces/GetPlacesService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getplaces/GetPlacesService.java (revision 2)
@@ -0,0 +1,71 @@
+package com.kdc.api.getplaces;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.PlaceInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.util.CommonService;
+import com.kdc.mybatis.domain.api.getplaces.PlaceInfoDomain;
+import com.kdc.mybatis.mapper.api.GetPlacesMapper;
+
+/**
+ * 場所取得 API Service クラス
+ *
+ */
+@Service
+public class GetPlacesService {
+
+ @Autowired
+ private GetPlacesMapper getPlacesMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(GetPlacesRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ if (!this.commonService.checkBaseParameter(reqEntity, resEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * 場所情報取得.
+ * @param reqEntity
+ * @return List
+ */
+ public List<PlaceInfoEntity> getPlace(GetPlacesRequestEntity reqEntity) {
+
+ List<PlaceInfoEntity> result = new ArrayList<>();
+
+ List<PlaceInfoDomain> placeList = this.getPlacesMapper.getPlaceList(reqEntity.getUserInfo().getUserId());
+
+ if (placeList != null) {
+ for (PlaceInfoDomain placeEntity : placeList) {
+ PlaceInfoEntity place = new PlaceInfoEntity();
+ place.setPlaceId(placeEntity.getPlaceid());
+ place.setPlaceName(placeEntity.getPlacename());
+ place.setPlaceTypeCd(String.valueOf(placeEntity.getPlacetypeflg()));
+ place.setLatitude(placeEntity.getLatitude().toString());
+ place.setLongitude(placeEntity.getLongitude().toString());
+ place.setRadius(String.valueOf(placeEntity.getRadius()));
+ place.setIconId(placeEntity.getIconid());
+ place.setDispFlg(placeEntity.getPlacedispflg());
+
+ result.add(place);
+ }
+ }
+
+ return result;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getrecords/GetRecordsController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getrecords/GetRecordsController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getrecords/GetRecordsController.java (revision 2)
@@ -0,0 +1,67 @@
+package com.kdc.api.getrecords;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.getrecords.GetRecordsRequestEntity;
+import com.kdc.api.getrecords.GetRecordsResponseEntity;
+import com.kdc.common.entity.api.LocationRecordInfoEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * ユーザ履歴情報取得 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class GetRecordsController {
+
+ private static final Logger logger = LoggerFactory.getLogger(GetRecordsController.class);
+
+ @Autowired
+ private GetRecordsService getRecordsService;
+
+ // ユーザ履歴情報取得
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/records", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public GetRecordsResponseEntity getRecords(@RequestBody GetRecordsRequestEntity bean,
+ HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.GET_RECORDS, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ GetRecordsResponseEntity resEntity = new GetRecordsResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_GET_RECORDS);
+
+ // チェック関連
+ if (!this.getRecordsService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.GET_RECORDS, bean.getUserInfo(), bean.getDeviceInfo(),
+ "parameterCheck"));
+ return resEntity;
+ }
+
+ // DBから取得
+ List<LocationRecordInfoEntity> recordlist = this.getRecordsService.getRecord(bean);
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ resEntity.setUserRecordInfo(recordlist);
+
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.GET_RECORDS, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getrecords/GetRecordsRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getrecords/GetRecordsRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getrecords/GetRecordsRequestEntity.java (revision 2)
@@ -0,0 +1,40 @@
+package com.kdc.api.getrecords;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class GetRecordsRequestEntity extends RequestBaseEntity {
+
+ private String targetUserId;
+ private String targetDate;
+
+ /**
+ * @return targetUserId
+ */
+ public String getTargetUserId() {
+ return targetUserId;
+ }
+
+ /**
+ * @param targetUserId
+ * セットする targetUserId
+ */
+ public void setTargetUserId(String targetUserId) {
+ this.targetUserId = targetUserId;
+ }
+
+ /**
+ * @return targetDate
+ */
+ public String getTargetDate() {
+ return targetDate;
+ }
+
+ /**
+ * @param targetDate
+ * セットする targetDate
+ */
+ public void setTargetDate(String targetDate) {
+ this.targetDate = targetDate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getrecords/GetRecordsResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getrecords/GetRecordsResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getrecords/GetRecordsResponseEntity.java (revision 2)
@@ -0,0 +1,27 @@
+package com.kdc.api.getrecords;
+
+import java.util.List;
+
+import com.kdc.common.entity.api.LocationRecordInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class GetRecordsResponseEntity extends ResponseBaseEntity {
+
+ private List<LocationRecordInfoEntity> userRecordInfo;
+
+ /**
+ * @return userRecordInfo
+ */
+ public List<LocationRecordInfoEntity> getUserRecordInfo() {
+ return userRecordInfo;
+ }
+
+ /**
+ * @param userRecordInfo
+ * セットする userRecordInfo
+ */
+ public void setUserRecordInfo(List<LocationRecordInfoEntity> userRecordInfo) {
+ this.userRecordInfo = userRecordInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/getrecords/GetRecordsService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/getrecords/GetRecordsService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/getrecords/GetRecordsService.java (revision 2)
@@ -0,0 +1,91 @@
+package com.kdc.api.getrecords;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.LocationRecordInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.UserLocationRecordEntityWrapper;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.api.GetRecordsMapper;
+
+/**
+ * ユーザ履歴情報取得 API Service クラス
+ *
+ */
+@Service
+public class GetRecordsService {
+
+ @Autowired
+ private GetRecordsMapper getRecordsMapper;
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(GetRecordsRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ // ユーザ・端末情報
+ if (!this.commonService.checkBaseParameter(reqEntity, resEntity)) {
+ return false;
+ }
+
+ // 対象ユーザID
+ if (StringUtils.isEmpty(reqEntity.getTargetUserId())) {
+ resEntity.setMessage("targetUserId is Empty");
+ return false;
+ }
+ // 対象日付
+ if (StringUtils.isEmpty(reqEntity.getTargetDate())) {
+ resEntity.setMessage("targetDate is Empty");
+ return false;
+ }
+ // 日付不正チェック
+ if (!KdcCommonUtils.checkDateString(reqEntity.getTargetDate())) {
+ resEntity.setMessage("targetDate is Wrong");
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * ユーザ履歴情報取得.
+ * @param reqEntity
+ * @return List
+ */
+ public List<LocationRecordInfoEntity> getRecord(GetRecordsRequestEntity reqEntity) {
+
+ List<LocationRecordInfoEntity> result = new ArrayList<>();
+
+ UserLocationRecordEntityWrapper rec = new UserLocationRecordEntityWrapper();
+ rec.setUserid(reqEntity.getTargetUserId());
+ rec.setReceivedate(KdcCommonUtils.dateStringToTimestamp(reqEntity.getTargetDate()));
+ List<UserLocationRecordEntityWrapper> recordlist = this.getRecordsMapper.getRecordList(rec,
+ reqEntity.getUserInfo().getUserId());
+
+ if (recordlist != null) {
+ for (UserLocationRecordEntityWrapper recordEntity : recordlist) {
+ LocationRecordInfoEntity record = new LocationRecordInfoEntity();
+
+ record.setRecordDate(KdcCommonUtils.timestampToDateTimeString(recordEntity.getReceivedate()));
+ record.setBatteryLevel(String.valueOf(recordEntity.getBatterylevel()));
+ record.setReceptionStatus(String.valueOf(recordEntity.getReceptionstatus()));
+ record.setLatitude(recordEntity.getLatitude().toString());
+ record.setLongitude(recordEntity.getLongitude().toString());
+
+ result.add(record);
+ }
+ }
+
+ return result;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/login/LoginController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/login/LoginController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/login/LoginController.java (revision 2)
@@ -0,0 +1,74 @@
+package com.kdc.api.login;
+
+import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * ログイン API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class LoginController {
+
+ private static final Logger logger = LoggerFactory.getLogger(LoginController.class);
+
+ @Autowired
+ private LoginService loginService;
+
+ // ログイン
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/login", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public LoginResponseEntity login(@RequestBody LoginRequestEntity bean, HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.LOGIN, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ LoginResponseEntity resEntity = new LoginResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_LOGIN);
+
+ // パラメータチェック
+ if (!this.loginService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.LOGIN, bean.getUserInfo(), bean.getDeviceInfo(),
+ "parameterCheck"));
+ return resEntity;
+ }
+
+ // 登録状態チェック
+ if (!this.loginService.checkRegistration(bean, resEntity)) {
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.LOGIN, bean.getUserInfo(), bean.getDeviceInfo(),
+ "checkRegistration"));
+ return resEntity;
+ }
+
+ // 端末登録
+ if (!loginService.registerDevice(bean, resEntity)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.LOGIN, bean.getUserInfo(), bean.getDeviceInfo(),
+ "registerDevice"));
+ return resEntity;
+ }
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.LOGIN, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/login/LoginRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/login/LoginRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/login/LoginRequestEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.login;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class LoginRequestEntity extends RequestBaseEntity {
+
+}
Index: kdc/src/main/java/com/kdc/api/login/LoginResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/login/LoginResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/login/LoginResponseEntity.java (revision 2)
@@ -0,0 +1,25 @@
+package com.kdc.api.login;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+
+public class LoginResponseEntity extends ResponseBaseEntity {
+
+ private UserInfoEntity userInfo;
+
+ /**
+ * @return userInfo
+ */
+ public UserInfoEntity getUserInfo() {
+ return userInfo;
+ }
+
+ /**
+ * @param userInfo
+ * セットする userInfo
+ */
+ public void setUserInfo(UserInfoEntity userInfo) {
+ this.userInfo = userInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/login/LoginService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/login/LoginService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/login/LoginService.java (revision 2)
@@ -0,0 +1,173 @@
+package com.kdc.api.login;
+
+import java.sql.Timestamp;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.kdc.common.entity.db.UserDeviceEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.common.entity.UserDeviceMapper;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+
+/**
+ * ログイン API Service クラス
+ *
+ */
+@Service
+public class LoginService {
+
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private UserDeviceMapper userDeviceMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(LoginRequestEntity reqEntity, LoginResponseEntity resEntity) {
+
+ // ユーザー情報
+ if (reqEntity.getUserInfo() == null) {
+ resEntity.setMessage("userInfo is Empty");
+ return false;
+ }
+ // ID・パスワードのみ必須チェック
+ if (StringUtils.isEmpty(reqEntity.getUserInfo().getUserId())) {
+ resEntity.setMessage("userInfo.userId is Empty");
+ return false;
+ }
+ if (StringUtils.isEmpty(reqEntity.getUserInfo().getPassword())) {
+ resEntity.setMessage("userInfo.password is Empty");
+ return false;
+ }
+ // 端末
+ if (reqEntity.getDeviceInfo() == null) {
+ resEntity.setMessage("deviceInfo is Empty");
+ return false;
+ }
+ // 単項目チェック
+ if (!this.commonService.checkDeviceInfoValues(reqEntity.getDeviceInfo(), resEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * 登録状態チェック
+ * @param userInfo
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean checkRegistration(LoginRequestEntity req, LoginResponseEntity resEntity) {
+
+ // ユーザIDでユーザ情報取得
+ UserMasterEntity user = this.userMasterMapper.selectUser(req.getUserInfo().getUserId(),req.getUserInfo().getPassword(),
+ CommonConst.FLG_OFF);
+
+ // ユーザID登録状態
+ if (user == null) {
+ resEntity.setMessage("user not exists");
+ return false;
+ }
+ //強制ログインフラグ取得
+ int iForceFlg = req.getForceLogin();
+
+ // 電話番号で端末情報取得
+ UserDeviceEntity device = this.userDeviceMapper.selectDeviceExist(req.getDeviceInfo().getTelephoneNumber(),req.getDeviceInfo().getUserId(),
+ CommonConst.FLG_OFF);
+ if (device != null) {
+ // 異なるユーザーIDの場合、エラー
+ if (!KdcCommonUtils.nullSafeEquals(req.getDeviceInfo().getUserId(), device.getUserid())) {
+ //強制ログインの場合はスルー
+ if ( iForceFlg != 1) {
+ resEntity.setMessage("user already logged");
+ return false;
+ }
+ }
+ }
+
+ // ユーザIDでユーザ情報取得(デバイスID NULL以外かつ自身のデバイスID以外)
+ device = this.userDeviceMapper.selectUserExist(req.getDeviceInfo().getUserId(),req.getDeviceInfo().getDeviceId(),
+ CommonConst.FLG_OFF);
+ if (device != null) {
+ // 同じユーザIDで異なるデバイスIDの場合、エラー
+ if (!KdcCommonUtils.nullSafeEquals(req.getDeviceInfo().getDeviceId(), device.getDeviceid())) {
+ //強制ログインの場合はスルー
+ if ( iForceFlg != 1) {
+ resEntity.setMessage("user already logged");
+ return false;
+ }
+ }
+ }
+
+ req.getUserInfo().setUserName(user.getUsername());
+ req.getUserInfo().setIconId(user.getIconid());
+ req.getUserInfo().setGroupId(user.getGroupid());
+ req.getUserInfo().setAuthLevel(String.valueOf(user.getAuthlevel()));
+ req.getUserInfo().setLineColor(user.getLinecolor());
+ req.getUserInfo().setMarkerColor(String.valueOf(user.getMarkercolor()));
+ resEntity.setUserInfo(req.getUserInfo());
+
+ return true;
+ }
+
+ /**
+ * ユーザ端末登録
+ * @param req
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean registerDevice(LoginRequestEntity req, LoginResponseEntity resEntity) {
+
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+ UserDeviceEntity rec = new UserDeviceEntity();
+ rec.setUserid(req.getUserInfo().getUserId());
+ rec.setTelephonenumber(req.getDeviceInfo().getTelephoneNumber());
+ rec.setDeviceid(req.getDeviceInfo().getDeviceId());
+ rec.setRegisteruserid(req.getUserInfo().getUserId());
+ rec.setRegisterdate(nowTimestamp);
+ rec.setUpdateuserid(req.getUserInfo().getUserId());
+ rec.setUpdatedate(nowTimestamp);
+
+ try {
+ // 電話番号で端末情報取得
+ UserDeviceEntity device = this.userDeviceMapper.selectDevice(req.getDeviceInfo().getTelephoneNumber(),
+ CommonConst.FLG_OFF);
+ if (device != null) {
+ if (KdcCommonUtils.nullSafeEquals(req.getDeviceInfo().getUserId(), device.getUserid())) {
+ // 前回ログインと同じ端末の場合、端末情報は更新不要
+ return true;
+ } else {
+// resEntity.setMessage("user already logged");
+// return false;
+ // 別のユーザが同じ電話番号でログイン状態の場合、奪い取る
+ this.userDeviceMapper.deleteDevice(rec);
+ return true;
+ }
+ }
+ if (this.userDeviceMapper.selectByPk(req.getUserInfo().getUserId(), CommonConst.FLG_OFF) != null) {
+ this.userDeviceMapper.update(rec);
+ } else {
+ this.userDeviceMapper.insert(rec);
+ }
+
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/logout/LogoutController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/logout/LogoutController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/logout/LogoutController.java (revision 2)
@@ -0,0 +1,78 @@
+package com.kdc.api.logout;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.logout.LogoutRequestEntity;
+import com.kdc.api.logout.LogoutResponseEntity;
+import com.kdc.api.logout.LogoutService;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * ログアウト API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class LogoutController {
+ private static final Logger logger = LoggerFactory.getLogger(LogoutController.class);
+
+ @Autowired
+ private LogoutService logoutService;
+
+ // ログアウト
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/logout", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public LogoutResponseEntity logout(@RequestBody LogoutRequestEntity bean, HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.LOGOUT, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ LogoutResponseEntity resEntity = new LogoutResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_LOGIN);
+
+ // パラメータチェック
+ if (!this.logoutService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.LOGIN, bean.getUserInfo(), bean.getDeviceInfo(),
+ "parameterCheck"));
+ return resEntity;
+ }
+
+ // 登録状態チェック
+ if (!this.logoutService.checkRegistration(bean.getUserInfo(), resEntity)) {
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.LOGIN, bean.getUserInfo(), bean.getDeviceInfo(),
+ "checkRegistration"));
+ return resEntity;
+ }
+
+ // 端末登録
+ if (!logoutService.registerDevice(bean, resEntity)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.LOGIN, bean.getUserInfo(), bean.getDeviceInfo(),
+ "registerDevice"));
+ return resEntity;
+ }
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.LOGOUT, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/logout/LogoutRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/logout/LogoutRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/logout/LogoutRequestEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.logout;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class LogoutRequestEntity extends RequestBaseEntity {
+
+}
Index: kdc/src/main/java/com/kdc/api/logout/LogoutResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/logout/LogoutResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/logout/LogoutResponseEntity.java (revision 2)
@@ -0,0 +1,25 @@
+package com.kdc.api.logout;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+
+public class LogoutResponseEntity extends ResponseBaseEntity {
+ private UserInfoEntity userInfo;
+
+ /**
+ * @return userInfo
+ */
+ public UserInfoEntity getUserInfo() {
+ return userInfo;
+ }
+
+ /**
+ * @param userInfo
+ * セットする userInfo
+ */
+ public void setUserInfo(UserInfoEntity userInfo) {
+ this.userInfo = userInfo;
+ }
+
+
+}
Index: kdc/src/main/java/com/kdc/api/logout/LogoutService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/logout/LogoutService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/logout/LogoutService.java (revision 2)
@@ -0,0 +1,134 @@
+package com.kdc.api.logout;
+
+import java.sql.Timestamp;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.api.logout.LogoutRequestEntity;
+import com.kdc.api.logout.LogoutResponseEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.db.UserDeviceEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.common.entity.UserDeviceMapper;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+
+/**
+ * ログイン API Service クラス
+ *
+ */
+@Service
+public class LogoutService {
+
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private UserDeviceMapper userDeviceMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(LogoutRequestEntity reqEntity, LogoutResponseEntity resEntity) {
+
+ // ユーザー情報
+ if (reqEntity.getUserInfo() == null) {
+ resEntity.setMessage("userInfo is Empty");
+ return false;
+ }
+ // ID・パスワードのみ必須チェック
+ if (StringUtils.isEmpty(reqEntity.getUserInfo().getUserId())) {
+ resEntity.setMessage("userInfo.userId is Empty");
+ return false;
+ }
+ if (StringUtils.isEmpty(reqEntity.getUserInfo().getPassword())) {
+ resEntity.setMessage("userInfo.password is Empty");
+ return false;
+ }
+ // 端末
+ if (reqEntity.getDeviceInfo() == null) {
+ resEntity.setMessage("deviceInfo is Empty");
+ return false;
+ }
+ // 単項目チェック
+ if (!this.commonService.checkDeviceInfoValues(reqEntity.getDeviceInfo(), resEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * 登録状態チェック
+ * @param userInfo
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean checkRegistration(UserInfoEntity userInfo, LogoutResponseEntity resEntity) {
+
+ // ユーザIDでユーザ情報取得
+ UserMasterEntity user = this.userMasterMapper.selectUser(userInfo.getUserId(), userInfo.getPassword(),
+ CommonConst.FLG_OFF);
+
+ // ユーザID登録状態
+ if (user == null) {
+ resEntity.setMessage("user not exists");
+ return false;
+ }
+
+ userInfo.setUserName(user.getUsername());
+ userInfo.setIconId(user.getIconid());
+ userInfo.setGroupId(user.getGroupid());
+ userInfo.setAuthLevel(String.valueOf(user.getAuthlevel()));
+ userInfo.setLineColor(user.getLinecolor());
+ userInfo.setMarkerColor(String.valueOf(user.getMarkercolor()));
+ resEntity.setUserInfo(userInfo);
+
+ return true;
+ }
+
+ /**
+ * ユーザ端末登録
+ * @param req
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean registerDevice(LogoutRequestEntity req, LogoutResponseEntity resEntity) {
+
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+ UserDeviceEntity rec = new UserDeviceEntity();
+ rec.setUserid(req.getUserInfo().getUserId());
+ rec.setTelephonenumber(req.getDeviceInfo().getTelephoneNumber());
+ rec.setDeviceid(req.getDeviceInfo().getDeviceId());
+ rec.setRegisteruserid(req.getUserInfo().getUserId());
+ rec.setRegisterdate(nowTimestamp);
+ rec.setUpdateuserid(req.getUserInfo().getUserId());
+ rec.setUpdatedate(nowTimestamp);
+
+ try {
+ // ユーザIDで端末情報取得
+ UserDeviceEntity device = this.userDeviceMapper.selectByPk(req.getDeviceInfo().getUserId(),
+ CommonConst.FLG_OFF);
+ if (device != null) {
+ if (KdcCommonUtils.nullSafeEquals(req.getDeviceInfo().getUserId(), device.getUserid())) {
+ // 端末情報初期化
+ this.userDeviceMapper.deleteDevice(rec);
+ }
+ }
+
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupController.java (revision 2)
@@ -0,0 +1,69 @@
+package com.kdc.api.registergroup;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * グループ登録API Controllerクラス
+ * @author umemoto
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class RegisterGroupController {
+
+ private static final Logger logger = LoggerFactory.getLogger(RegisterGroupController.class);
+
+ @Autowired
+ private RegisterGroupService registerGroupService;
+
+ //グループ登録
+ @RequestMapping(path = CommonConst.API_BASE_URL + "/register/group",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public RegisterGroupResponseEntity registerGroup(@RequestBody RegisterGroupRequestEntity bean,HttpServletResponse response) {
+
+ //log
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.REGISTER_GROUP, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ //レスポンス作成
+ RegisterGroupResponseEntity resEntity = new RegisterGroupResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_REGISTER_GROUP);
+
+ //パラメータチェック
+ if(!this.registerGroupService.parameterCheck(bean, resEntity)){
+ // HTTPステータスコードをBad Request(400)に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_GROUP, bean.getUserInfo(), bean.getDeviceInfo(), "parameterCheck:" + resEntity.getMessage()));
+ return resEntity;
+ }
+
+ //グループ情報登録
+ if(!this.registerGroupService.registerGroup(bean,resEntity)) {
+ // HTTPステータスコードをInternal Server Error(500)に設定
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_GROUP, bean.getUserInfo(), bean.getDeviceInfo(), "register:" + resEntity.getMessage()));
+ return resEntity;
+ }
+
+ //レスポンス作成
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.REGISTER_GROUP, bean.getUserInfo(), bean.getDeviceInfo(), response.getStatus(), resEntity.getResultCd()));
+
+ return resEntity;
+
+ }
+}
Index: kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupRequestEntity.java (revision 2)
@@ -0,0 +1,48 @@
+package com.kdc.api.registergroup;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+import com.kdc.common.entity.db.GroupInfoEntity;
+
+/**
+ * グループ情報エンティティ
+ * @author umemoto
+ *
+ */
+public class RegisterGroupRequestEntity extends RequestBaseEntity {
+
+ private Integer mode;
+ private GroupInfoEntity groupInfo;
+
+ /**
+ * @return mode
+ */
+ public Integer getMode() {
+ return mode;
+ }
+
+ /**
+ * @param mode
+ * セットする mode
+ */
+ public void setMode(Integer mode) {
+ this.mode = mode;
+ }
+
+ /**
+ * @return groupMaster
+ */
+ public GroupInfoEntity getGroupInfo() {
+ return groupInfo;
+ }
+
+ /**
+ * @param groupMaster
+ * セットする groupMaster
+ */
+ public void setGroupInfo(GroupInfoEntity groupInfo) {
+ this.groupInfo = groupInfo;
+ }
+
+
+
+}
Index: kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupResponseEntity.java (revision 2)
@@ -0,0 +1,17 @@
+package com.kdc.api.registergroup;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class RegisterGroupResponseEntity extends ResponseBaseEntity {
+
+ private String groupId;
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registergroup/RegisterGroupService.java (revision 2)
@@ -0,0 +1,196 @@
+package com.kdc.api.registergroup;
+
+import java.sql.Timestamp;
+
+import org.apache.commons.lang3.StringUtils;
+import org.hsqldb.lib.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.GroupInfoEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.enums.RegisterGroupModeEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.api.SettingUserMapper;
+import com.kdc.mybatis.mapper.common.entity.GroupMasterMapper;
+
+/**
+ * グループ登録API Serviceクラス
+ * @author umemoto
+ *
+ */
+@Service
+public class RegisterGroupService {
+
+ @Autowired
+ private GroupMasterMapper groupMasterMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ @Autowired
+ private SettingUserMapper settingUserMapper;
+
+ /**
+ * パラメータチェック
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(RegisterGroupRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ //端末情報
+ if(!this.commonService.checkBaseParameter(reqEntity, resEntity)){
+ return false;
+ }
+
+ //モード
+ if(reqEntity.getMode() == null ) {
+ resEntity.setMessage("mode is Empty");
+ return false;
+ }
+
+ //グループ情報
+
+ //モード
+ try {
+ RegisterGroupModeEnum.valueOf(reqEntity.getMode());
+ if ( reqEntity.getMode() == 1) {
+ //新規モード
+ //グループ名
+ if ( StringUtil.isEmpty(reqEntity.getGroupInfo().getGroupname())){
+ resEntity.setMessage("groupMaster.groupName is Empty");
+ return false;
+ }
+ } else if ( reqEntity.getMode() == 2) {
+ //更新
+ //グループID
+ if ( StringUtil.isEmpty(reqEntity.getGroupInfo().getGroupid())){
+ resEntity.setMessage("groupMaster.groupId is Empty");
+ return false;
+ }
+ //グループ名
+ if ( StringUtil.isEmpty(reqEntity.getGroupInfo().getGroupname())){
+ resEntity.setMessage("groupMaster.groupName is Empty");
+ return false;
+ }
+ } else if ( reqEntity.getMode() == 3 ) {
+ //削除
+ //グループID
+ if ( StringUtil.isEmpty(reqEntity.getGroupInfo().getGroupid())){
+ resEntity.setMessage("groupMaster.groupId is Empty");
+ return false;
+ }
+ }
+
+ } catch (IllegalArgumentException e) {
+ resEntity.setMessage("mode is Wrong");
+ return false;
+ }
+
+ //グループ名MAX LENGTH
+ if ( StringUtils.length(reqEntity.getGroupInfo().getGroupname()) > CommonConst.GROUP_NAME_MAX_LENGTH) {
+ resEntity.setMessage("groupMaster.groupName is too Long");
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * グループ情報登録
+ * @param reqEntity
+ * @return
+ */
+ public Boolean registerGroup(RegisterGroupRequestEntity reqEntity, RegisterGroupResponseEntity resEntity) {
+ GroupInfoEntity rec = new GroupInfoEntity();
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+
+ switch(RegisterGroupModeEnum.valueOf(reqEntity.getMode())) {
+ case INSERT:
+ case UPDATE:
+ // group_master共通
+ rec.setGroupname(reqEntity.getGroupInfo().getGroupname());
+ rec.setConfigparam1(reqEntity.getGroupInfo().getConfigparam1());
+ rec.setConfigparam2(reqEntity.getGroupInfo().getConfigparam2());
+ rec.setConfigparam3(reqEntity.getGroupInfo().getConfigparam3());
+ rec.setConfigparam4(reqEntity.getGroupInfo().getConfigparam4());
+ rec.setConfigparam5(reqEntity.getGroupInfo().getConfigparam5());
+ break;
+ case DELETE:
+ break;
+ }
+
+ try {
+ switch(RegisterGroupModeEnum.valueOf(reqEntity.getMode())){
+ case INSERT: //新規
+ //グループ情報登録
+ //group_id_seq
+ String groupidseq = this.commonService.createGroupId();
+
+ //group_master
+ rec.setGroupid(groupidseq);
+ rec.setRegisteruserid(reqEntity.getUserInfo().getUserId());
+ rec.setRegisterdate(nowTimestamp);
+ //初期値0で設定
+ rec.setConfigparam1("0");
+ rec.setConfigparam2("0");
+ rec.setConfigparam3("0");
+ rec.setConfigparam4("0");
+ rec.setConfigparam5("0");
+ resEntity.setMessage("groupMasterMapper.insert");
+ this.groupMasterMapper.insert(rec);
+ resEntity.setMessage("groupMasterMapper.insertSendIntervalConfig");
+ this.groupMasterMapper.insertSendIntervalConfig(rec);
+ resEntity.setMessage("groupMasterMapper.insertUserAlertConfig");
+ this.groupMasterMapper.insertUserAlertConfig(rec);
+ resEntity.setMessage("groupMasterMapper.insertConfigMasterg");
+ this.groupMasterMapper.insertConfigMasterg(rec);
+
+ // ユーザーマスタのグループID更新
+ UserMasterEntity regRec = new UserMasterEntity();
+ regRec.setUserid(reqEntity.getUserInfo().getUserId());
+ regRec.setGroupid(groupidseq);
+ regRec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ regRec.setUpdatedate(KdcCommonUtils.getNowTimestamp());
+ this.settingUserMapper.updateUserMaster(regRec, regRec);
+
+ //結果APIにグループIDを返却
+ resEntity.setGroupId(groupidseq);
+
+ break;
+ case UPDATE: //更新
+ rec.setGroupid(reqEntity.getGroupInfo().getGroupid());
+ rec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ rec.setUpdatedate(nowTimestamp);
+ this.groupMasterMapper.update(rec);
+
+ // ユーザーマスタのグループID更新
+ regRec = new UserMasterEntity();
+ regRec.setUserid(reqEntity.getUserInfo().getUserId());
+ regRec.setGroupid(reqEntity.getGroupInfo().getGroupid());
+ regRec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ regRec.setUpdatedate(KdcCommonUtils.getNowTimestamp());
+ this.settingUserMapper.updateUserMaster(regRec, regRec);
+
+ //結果APIにグループIDを返却
+ resEntity.setGroupId(reqEntity.getGroupInfo().getGroupid());
+
+ break;
+ case DELETE: //削除
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+
+ }catch ( Exception e ) {
+ resEntity.setMessage(e.getMessage() + " groupid:" + resEntity.getGroupId());
+ return false;
+ }
+ }
+}
Index: kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationController.java (revision 2)
@@ -0,0 +1,68 @@
+package com.kdc.api.registernotification;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+
+/**
+ * 通知情報登録API Controllerクラス
+ * @author ケリム
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class RegisterNotificationController {
+
+ private static final Logger logger = LoggerFactory.getLogger(RegisterNotificationController.class);
+
+ @Autowired
+ private RegisterNotificationService registerNotificationService;
+
+ //通知情報登録
+ @RequestMapping(path = CommonConst.API_BASE_URL + "/register/notification",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+public RegisterNotificationResponseEntity registerNotification(@RequestBody RegisterNotificationRequestEntity bean,HttpServletResponse response) {
+
+ //log
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.REGISTER_NOTIFICATION, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ //レスポンス作成
+ RegisterNotificationResponseEntity resEntity = new RegisterNotificationResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_REGISTER_NOTIFICATION);
+
+ //パラメータチェック
+ if(!this.registerNotificationService.parameterCheck(bean, resEntity)){
+ // HTTPステータスコードをBad Request(400)に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_NOTIFICATION, bean.getUserInfo(), bean.getDeviceInfo(), "parameterCheck:" + resEntity.getMessage()));
+ return resEntity;
+ }
+
+ //通知情報登録
+ if(!this.registerNotificationService.registerNotification(bean,resEntity)) {
+ // HTTPステータスコードをInternal Server Error(500)に設定
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_NOTIFICATION, bean.getUserInfo(), bean.getDeviceInfo(), "register:" + resEntity.getMessage()));
+ return resEntity;
+ }
+
+ //レスポンス作成
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.REGISTER_NOTIFICATION, bean.getUserInfo(), bean.getDeviceInfo(), response.getStatus(), resEntity.getResultCd()));
+
+ return resEntity;
+}
+}
Index: kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationRequestEntity.java (revision 2)
@@ -0,0 +1,42 @@
+package com.kdc.api.registernotification;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+import com.kdc.common.entity.db.NotificationInfoEntity;
+
+/**
+ * グループ情報エンティティ
+ * @author ケリム
+ *
+ */
+public class RegisterNotificationRequestEntity extends RequestBaseEntity{
+
+ private Integer mode;
+ private NotificationInfoEntity notificationInfo;
+
+ /**
+ * @return mode
+ */
+ public Integer getMode() {
+ return mode;
+ }
+ /**
+ * @param mode セットする mode
+ */
+ public void setMode(Integer mode) {
+ this.mode = mode;
+ }
+
+ /**
+ * @return notificationInfo
+ */
+ public NotificationInfoEntity getNotificationInfo() {
+ return notificationInfo;
+ }
+ /**
+ * @param notificationInfo セットする notificationInfo
+ */
+ public void setNotificationInfo(NotificationInfoEntity notificationInfo) {
+ this.notificationInfo = notificationInfo;
+
+ }
+}
Index: kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationResponseEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.registernotification;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class RegisterNotificationResponseEntity extends ResponseBaseEntity{
+
+}
Index: kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registernotification/RegisterNotificationService.java (revision 2)
@@ -0,0 +1,217 @@
+package com.kdc.api.registernotification;
+
+import java.sql.Timestamp;
+
+import org.apache.commons.lang3.StringUtils;
+import org.hsqldb.lib.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.NotificationInfoEntity;
+import com.kdc.common.enums.RegisterNotificationModeEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.common.entity.NotificationInfoMapper;
+
+/**
+ * 登録通知API Serviceクラス
+ * @author ケリム
+ *
+ */
+@Service
+public class RegisterNotificationService {
+
+ @Autowired
+ private NotificationInfoMapper notificationInfoMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+
+ /**
+ * パラメータチェック
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(RegisterNotificationRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ //端末情報
+ if(!this.commonService.checkBaseParameter(reqEntity, resEntity)){
+ return false;
+ }
+
+ //モード
+
+ if(reqEntity.getMode() == null ) {
+ resEntity.setMessage("mode is Empty");
+ return false;
+ }
+ //通知情報情報
+
+ //モード
+ try {
+ RegisterNotificationModeEnum.valueOf(reqEntity.getMode());
+ if ( reqEntity.getMode() == 1) {
+ //新規モード
+ //ユーザーID
+ if ( StringUtil.isEmpty(reqEntity.getNotificationInfo().getUserId())){
+ resEntity.setMessage("notificationInfo.userid is Empty");
+ return false;
+ }
+ //グループID
+ if ( StringUtil.isEmpty(reqEntity.getNotificationInfo().getGroupId())){
+ resEntity.setMessage("notificationInfo.groupid is Empty");
+ return false;
+ }
+ //通知日
+ if ( StringUtil.isEmpty(reqEntity.getNotificationInfo().getNotificationDate())){
+ resEntity.setMessage("notificationInfo.NotificationDate is Empty");
+ return false;
+ }
+ //通知時間
+ if ( StringUtil.isEmpty(reqEntity.getNotificationInfo().getNotificationTime())){
+ resEntity.setMessage("notificationInfo.NotificationTime is Empty");
+ return false;
+ }
+ } /**else if ( reqEntity.getMode() == 2) {
+ //更新
+ //ユーザーID
+ if ( StringUtil.isEmpty(reqEntity.getNotificationInfo().getUserid())){
+ resEntity.setMessage("notificationInfo.userid is Empty");
+ return false;
+ }
+ //グループ名
+ if ( StringUtil.isEmpty(reqEntity.getNotificationInfo().getGroupname())){
+ resEntity.setMessage("notificationInfo.groupName is Empty");
+ return false;
+ }
+ } **/else if ( reqEntity.getMode() == 3 ) {
+ //削除
+ //ユーザーID
+ if ( StringUtil.isEmpty(reqEntity.getNotificationInfo().getUserId())){
+ resEntity.setMessage("notificationInfo.userid is Empty");
+ return false;
+ }
+ //通知日
+ if ( StringUtil.isEmpty(reqEntity.getNotificationInfo().getNotificationDate())){
+ resEntity.setMessage("notificationInfo.NotificationDate is Empty");
+ return false;
+ }
+ }
+
+ } catch (IllegalArgumentException e) {
+ resEntity.setMessage("mode is Wrong");
+ return false;
+ }
+
+ //グループID MAX LENGTH
+ if ( StringUtils.length(reqEntity.getNotificationInfo().getGroupId()) > CommonConst.GROUP_ID_MAX_LENGTH) {
+ resEntity.setMessage("getNotificationInfo.groupid is too Long");
+ return false;
+ }
+
+ //ユーザーID MAX LENGTH
+ if ( StringUtils.length(reqEntity.getNotificationInfo().getUserId()) > CommonConst.USER_ID_MAX_LENGTH) {
+ resEntity.setMessage("getNotificationInfo.userid is too Long");
+ return false;
+ }
+
+ //通知日MAX LENGTH
+ if ( StringUtils.length(reqEntity.getNotificationInfo().getNotificationDate()) > CommonConst.NOTIFICATION_DATE_MAX_LENGTH) {
+ resEntity.setMessage("getNotificationInfo.NotificationDate is too Long");
+ return false;
+ }
+
+ //通知日MAX LENGTH
+ if ( StringUtils.length(reqEntity.getNotificationInfo().getNotificationTime()) > CommonConst.NOTIFICATION_TIME_MAX_LENGTH) {
+ resEntity.setMessage("getNotificationInfo.NotificationTime is too Long");
+ return false;
+ }
+ return true;
+}
+ /**
+ * 通知情報登録
+ * @param reqEntity
+ * @return
+ */
+ public Boolean registerNotification(RegisterNotificationRequestEntity reqEntity, RegisterNotificationResponseEntity resEntity) {
+ NotificationInfoEntity rec = new NotificationInfoEntity();
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+
+ switch(RegisterNotificationModeEnum.valueOf(reqEntity.getMode())) {
+ case INSERT:
+ /******************************************************
+ case UPDATE:
+ //
+ rec.setGroupid(reqEntity.getNotificationInfo().getGroupid());
+ rec.setUserid(reqEntity.getNotificationInfo().getUserid());
+ rec.setGroupname(reqEntity.getNotificationInfo().getGroupname());
+ rec.setConfigparam1(reqEntity.getNotificationInfo().getConfigparam1());
+ rec.setConfigparam2(reqEntity.getNotificationInfo().getConfigparam2());
+ rec.setConfigparam3(reqEntity.getNotificationInfo().getConfigparam3());
+ rec.setConfigparam4(reqEntity.getNotificationInfo().getConfigparam4());
+ rec.setConfigparam5(reqEntity.getNotificationInfo().getConfigparam5());
+ break;
+ **************************************************/
+ case DELETE:
+ break;
+ }
+
+ try {
+ switch(RegisterNotificationModeEnum.valueOf(reqEntity.getMode())){
+ case INSERT: //新規
+ //通知情報登録
+ rec.setGroupId(reqEntity.getNotificationInfo().getGroupId());
+ rec.setUserId(reqEntity.getNotificationInfo().getUserId());
+ rec.setNotificationDate(reqEntity.getNotificationInfo().getNotificationDate());
+ rec.setNotificationTime(reqEntity.getNotificationInfo().getNotificationTime());
+ rec.setRegisteruserid(reqEntity.getUserInfo().getUserId());
+ rec.setRegisterdate(nowTimestamp);
+ //初期値0で設定
+ rec.setAuthLevel(reqEntity.getNotificationInfo().getAuthLevel());
+ rec.setNotificationLevel(reqEntity.getNotificationInfo().getNotificationLevel());
+ rec.setNotificationFlg(reqEntity.getNotificationInfo().getNotificationFlg());
+ rec.setMessage(reqEntity.getNotificationInfo().getMessage());
+ resEntity.setMessage("notificationInfoMapper.insert");
+ this.notificationInfoMapper.insert(rec);
+ /***********************************
+ resEntity.setMessage("notificationInfoMapper.insertSendIntervalConfig");
+ this.notificationInfoMapper.insertSendIntervalConfig(rec);
+ resEntity.setMessage("notificationInfoMapper.insertUserAlertConfig");
+ this.notificationInfoMapper.insertUserAlertConfig(rec);
+ resEntity.setMessage("notificationInfoMapper.insertConfigMasterg");
+ this.notificationInfoMapper.insertConfigMasterg(rec);
+ ***************************************/
+ break;
+ /***************************************************
+ case UPDATE: //更新
+ rec.setGroupid(reqEntity.getNotificationInfo().getGroupid());
+ rec.setUserid(reqEntity.getNotificationInfo().getUserid());
+ rec.setGroupname(reqEntity.getNotificationInfo().getGroupname());
+
+ rec.setUpdatedate(nowTimestamp);
+ this.notificationInfoMapper.update(rec);
+ break;
+ ***********************************************************/
+ case DELETE: //削除
+ rec.setUserId(reqEntity.getNotificationInfo().getUserId());
+ rec.setNotificationDate(reqEntity.getNotificationInfo().getNotificationDate());
+ rec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ rec.setUpdatedate(nowTimestamp);
+ this.notificationInfoMapper.delete(rec);
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+
+ }catch ( Exception e ) {
+ resEntity.setMessage(e.getMessage() + " ApiId:" + resEntity.getApiId());
+ return false;
+ }
+ }
+}
\ No newline at end of file
Index: kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceController.java (revision 2)
@@ -0,0 +1,68 @@
+package com.kdc.api.registerplace;
+
+import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * 場所登録 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class RegisterPlaceController {
+
+ private static final Logger logger = LoggerFactory.getLogger(RegisterPlaceController.class);
+
+ @Autowired
+ private RegisterPlaceService registerPlaceService;
+
+ // 場所登録
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/register/place", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public RegisterPlaceResponseEntity registerPlace(@RequestBody RegisterPlaceRequestEntity bean,
+ HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.REGISTER_PLACE, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ RegisterPlaceResponseEntity resEntity = new RegisterPlaceResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_REGISTER_PLACE);
+
+ // パラメータチェック
+ if (!this.registerPlaceService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_PLACE, bean.getUserInfo(),
+ bean.getDeviceInfo(), "parameterCheck"));
+ return resEntity;
+ }
+
+ // 場所情報登録
+ if (!this.registerPlaceService.register(bean)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_PLACE, bean.getUserInfo(),
+ bean.getDeviceInfo(), "register"));
+ return resEntity;
+ }
+
+ // レスポンス作成
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.REGISTER_PLACE, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceRequestEntity.java (revision 2)
@@ -0,0 +1,41 @@
+package com.kdc.api.registerplace;
+
+import com.kdc.common.entity.api.PlaceInfoEntity;
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class RegisterPlaceRequestEntity extends RequestBaseEntity {
+
+ private Integer mode;
+ private PlaceInfoEntity placeInfo;
+
+ /**
+ * @return mode
+ */
+ public Integer getMode() {
+ return mode;
+ }
+
+ /**
+ * @param mode
+ * セットする mode
+ */
+ public void setMode(Integer mode) {
+ this.mode = mode;
+ }
+
+ /**
+ * @return placeInfo
+ */
+ public PlaceInfoEntity getPlaceInfo() {
+ return placeInfo;
+ }
+
+ /**
+ * @param placeInfo
+ * セットする placeInfo
+ */
+ public void setPlaceInfo(PlaceInfoEntity placeInfo) {
+ this.placeInfo = placeInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceResponseEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.registerplace;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class RegisterPlaceResponseEntity extends ResponseBaseEntity {
+
+}
Index: kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registerplace/RegisterPlaceService.java (revision 2)
@@ -0,0 +1,212 @@
+package com.kdc.api.registerplace;
+
+import java.sql.Timestamp;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.db.PlaceMasterEntityWrapper;
+import com.kdc.common.enums.AuthLevelEnum;
+import com.kdc.common.enums.RegisterPlaceModeEnum;
+import com.kdc.common.entity.db.PlaceAlertConfigEntity;
+import com.kdc.common.entity.db.PlaceDisplayConfigEntity;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.mybatis.mapper.common.entity.PlaceAlertConfigMapper;
+import com.kdc.mybatis.mapper.common.entity.PlaceDisplayConfigMapper;
+import com.kdc.mybatis.mapper.common.entity.PlaceMasterMapper;
+
+/**
+ * 場所登録 API Service クラス
+ *
+ */
+@Service
+public class RegisterPlaceService {
+
+ @Autowired
+ private PlaceMasterMapper placeMasterMapper;
+
+ @Autowired
+ private PlaceDisplayConfigMapper placeDisplayConfigMapper;
+
+ @Autowired
+ private PlaceAlertConfigMapper placeAlertConfigMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(RegisterPlaceRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ // 端末情報
+ if (!this.commonService.checkBaseParameter(reqEntity, resEntity)) {
+ return false;
+ }
+
+ // モード
+ if (reqEntity.getMode() == null) {
+ resEntity.setMessage("mode is Empty");
+ return false;
+ }
+
+ // (場所情報)
+ // 場所コード
+ if (StringUtils.isEmpty(reqEntity.getPlaceInfo().getPlaceId())) {
+ resEntity.setMessage("placeInfo is Empty");
+ return false;
+ }
+ // 場所名
+ if (StringUtils.isEmpty(reqEntity.getPlaceInfo().getPlaceName())) {
+ resEntity.setMessage("placeInfo.placeName is Empty");
+ return false;
+ }
+ // 場所区分
+ if (StringUtils.isEmpty(reqEntity.getPlaceInfo().getPlaceTypeCd())) {
+ resEntity.setMessage("placeInfo.placeTypeCd is Empty");
+ return false;
+ }
+ // 緯度
+ if (StringUtils.isEmpty(reqEntity.getPlaceInfo().getLatitude())) {
+ resEntity.setMessage("placeInfo.latitude is Empty");
+ return false;
+ }
+ // 経度
+ if (StringUtils.isEmpty(reqEntity.getPlaceInfo().getLongitude())) {
+ resEntity.setMessage("placeInfo.longitude is Empty");
+ return false;
+ }
+ // 半径
+ if (StringUtils.isEmpty(reqEntity.getPlaceInfo().getRadius())) {
+ resEntity.setMessage("placeInfo.radius is Empty");
+ return false;
+ }
+ // アイコン画像ID
+ if (StringUtils.isEmpty(reqEntity.getPlaceInfo().getIconId())) {
+ resEntity.setMessage("placeInfo.iconId is Empty");
+ return false;
+ }
+
+ // モード
+ try {
+ RegisterPlaceModeEnum.valueOf(reqEntity.getMode());
+ } catch (IllegalArgumentException e) {
+ resEntity.setMessage("mode is Wrong");
+ return false;
+ }
+
+ // 場所名
+ if (StringUtils.length(reqEntity.getPlaceInfo().getPlaceName()) > CommonConst.PLACE_NAME_MAX_LENGTH) {
+ resEntity.setMessage("placeInfo.placeName is too Long");
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * 場所情報登録.
+ * @param reqEntity
+ * @return Boolean
+ */
+ public Boolean register(RegisterPlaceRequestEntity reqEntity) {
+
+ PlaceMasterEntityWrapper rec = new PlaceMasterEntityWrapper();
+ PlaceDisplayConfigEntity dispRec = new PlaceDisplayConfigEntity();
+ PlaceAlertConfigEntity alertRec = new PlaceAlertConfigEntity();
+
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+
+ switch (RegisterPlaceModeEnum.valueOf(reqEntity.getMode())) {
+ case INSERT:
+ case UPDATE:
+ // place_master共通
+ rec.setPlacename(reqEntity.getPlaceInfo().getPlaceName());
+ rec.setPlacetypeflg(Integer.parseInt(reqEntity.getPlaceInfo().getPlaceTypeCd()));
+ rec.setLatitude(reqEntity.getPlaceInfo().getLatitude());
+ rec.setLongitude(reqEntity.getPlaceInfo().getLongitude());
+ rec.setRadius(Integer.parseInt(reqEntity.getPlaceInfo().getRadius()));
+ rec.setIconid(reqEntity.getPlaceInfo().getIconId());
+ rec.setGroupid(reqEntity.getUserInfo().getGroupId());
+ break;
+ case DELETE:
+ break;
+ }
+
+ try {
+ switch (RegisterPlaceModeEnum.valueOf(reqEntity.getMode())) {
+ case INSERT: // 新規
+
+ // 場所情報登録
+ // place_id_seq
+ String placeridseq = this.commonService.createPlaceId();
+
+ // place_master
+ rec.setPlaceid(placeridseq);
+ rec.setRegisteruserid(reqEntity.getUserInfo().getUserId());
+ rec.setRegisterdate(nowTimestamp);
+ this.placeMasterMapper.insert(rec);
+
+ // place_display_config
+ dispRec.setPlaceid(placeridseq);
+ dispRec.setPlacedispflg(CommonConst.FLG_ON);
+ dispRec.setRegisteruserid(reqEntity.getUserInfo().getUserId());
+ dispRec.setRegisterdate(nowTimestamp);
+ for (AuthLevelEnum item : AuthLevelEnum.values()) {
+ dispRec.setAuthlevel(item.getCode());
+ this.placeDisplayConfigMapper.insert(dispRec);
+ }
+
+ break;
+
+ case UPDATE: // 更新
+
+ // place_master
+ rec.setPlaceid(reqEntity.getPlaceInfo().getPlaceId());
+ rec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ rec.setUpdatedate(nowTimestamp);
+
+ this.placeMasterMapper.update(rec);
+ break;
+
+ case DELETE: // 削除
+
+ // place_master(論理削除)
+ rec.setPlaceid(reqEntity.getPlaceInfo().getPlaceId());
+ rec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ rec.setUpdatedate(nowTimestamp);
+ this.placeMasterMapper.delete(rec);
+
+ // place_display_config
+ dispRec.setPlaceid(reqEntity.getPlaceInfo().getPlaceId());
+ dispRec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ dispRec.setUpdatedate(nowTimestamp);
+ this.placeDisplayConfigMapper.delete(dispRec);
+
+ // place_alert_config
+ alertRec.setPlaceid(reqEntity.getPlaceInfo().getPlaceId());
+ alertRec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ alertRec.setUpdatedate(nowTimestamp);
+ this.placeAlertConfigMapper.delete(alertRec);
+
+ break;
+
+ default:
+
+ return false;
+
+ }
+
+ return true;
+
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/registeruser/RegisterUserController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registeruser/RegisterUserController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registeruser/RegisterUserController.java (revision 2)
@@ -0,0 +1,100 @@
+package com.kdc.api.registeruser;
+
+import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.registeruser.RegisterUserRequestEntity;
+import com.kdc.api.registeruser.RegisterUserResponseEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.enums.AuthenticationModeEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * ユーザ登録 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class RegisterUserController {
+
+ private static final Logger logger = LoggerFactory.getLogger(RegisterUserController.class);
+
+ @Autowired
+ private RegisterUserService registerUserService;
+
+ // ユーザ登録
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/register/user", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public RegisterUserResponseEntity registerUser(@RequestBody RegisterUserRequestEntity bean,
+ HttpServletResponse response) {
+
+ UserInfoEntity userInfo = new UserInfoEntity();
+ userInfo.setUserId(bean.getUserId());
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.REGISTER_USER, userInfo, bean.getDeviceInfo()));
+
+ // レスポンス作成
+ RegisterUserResponseEntity resEntity = new RegisterUserResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_REGISTER_USER);
+
+ // パラメータチェック
+ if (!this.registerUserService.checkParameter(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_USER, userInfo, bean.getDeviceInfo(),
+ "checkParameter"));
+ return resEntity;
+ }
+
+ // ユーザ重複チェック
+ if (!this.registerUserService.checkUserDuplicated(bean, resEntity)) {
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_USER, userInfo, bean.getDeviceInfo(),
+ "checkUserDuplicated"));
+ return resEntity;
+ }
+
+ switch (AuthenticationModeEnum.valueOf(bean.getMode())) {
+ case LOGIN:
+ case REGISTER_USER:
+ // 招待コード適用
+ if (!this.registerUserService.useInvitationCode(bean, resEntity)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_USER, userInfo, bean.getDeviceInfo(),
+ "useInvitationCode"));
+ return resEntity;
+ }
+ break;
+ case NEW_GROUP:
+ // 新規グループ作成時はチェック不要
+ break;
+ }
+
+ // ユーザ登録
+ if (!registerUserService.registerUser(bean, resEntity)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.REGISTER_USER, userInfo, bean.getDeviceInfo(),
+ "registerUser"));
+ return resEntity;
+ }
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.REGISTER_USER, userInfo, bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/registeruser/RegisterUserRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registeruser/RegisterUserRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registeruser/RegisterUserRequestEntity.java (revision 2)
@@ -0,0 +1,103 @@
+package com.kdc.api.registeruser;
+
+import com.kdc.common.entity.api.base.DeviceInfoEntity;
+
+public class RegisterUserRequestEntity {
+
+ private Integer mode;
+ private String userId;
+ private String password;
+ private String userName;
+ private String invitationCd;
+ private DeviceInfoEntity deviceInfo;
+
+ /**
+ * @return mode
+ */
+ public Integer getMode() {
+ return mode;
+ }
+
+ /**
+ * @param mode セットする mode
+ */
+ public void setMode(Integer mode) {
+ this.mode = mode;
+ }
+
+ /**
+ * @return userId
+ */
+ public String getUserId() {
+ return userId;
+ }
+
+ /**
+ * @param userId
+ * セットする userId
+ */
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+
+ /**
+ * @return password
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * @param password
+ * セットする password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * @return userName
+ */
+ public String getUserName() {
+ return userName;
+ }
+
+ /**
+ * @param userName
+ * セットする userName
+ */
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ /**
+ * @return invitationCd
+ */
+ public String getInvitationCd() {
+ return invitationCd;
+ }
+
+ /**
+ * @param invitationCd
+ * セットする invitationCd
+ */
+ public void setInvitationCd(String invitationCd) {
+ this.invitationCd = invitationCd;
+ }
+
+ /**
+ * @return deviceInfo
+ */
+ public DeviceInfoEntity getDeviceInfo() {
+ return deviceInfo;
+ }
+
+ /**
+ * @param deviceInfo
+ * セットする deviceInfo
+ */
+ public void setDeviceInfo(DeviceInfoEntity deviceInfo) {
+ this.deviceInfo = deviceInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/registeruser/RegisterUserResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registeruser/RegisterUserResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registeruser/RegisterUserResponseEntity.java (revision 2)
@@ -0,0 +1,41 @@
+package com.kdc.api.registeruser;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+
+public class RegisterUserResponseEntity extends ResponseBaseEntity {
+
+ private Integer userIdDuplicatedFlg;
+ private UserInfoEntity userInfo;
+
+ /**
+ * @return userIdDuplicatedFlg
+ */
+ public Integer getUserIdDuplicatedFlg() {
+ return userIdDuplicatedFlg;
+ }
+
+ /**
+ * @param userIdDuplicatedFlg
+ * セットする userIdDuplicatedFlg
+ */
+ public void setUserIdDuplicatedFlg(Integer userIdDuplicatedFlg) {
+ this.userIdDuplicatedFlg = userIdDuplicatedFlg;
+ }
+
+ /**
+ * @return userInfo
+ */
+ public UserInfoEntity getUserInfo() {
+ return userInfo;
+ }
+
+ /**
+ * @param userInfo
+ * セットする userInfo
+ */
+ public void setUserInfo(UserInfoEntity userInfo) {
+ this.userInfo = userInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/registeruser/RegisterUserService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/registeruser/RegisterUserService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/registeruser/RegisterUserService.java (revision 2)
@@ -0,0 +1,272 @@
+package com.kdc.api.registeruser;
+
+import java.sql.Timestamp;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.db.GroupInfoEntity;
+import com.kdc.common.entity.db.InvitationManagementEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.enums.AuthLevelEnum;
+import com.kdc.common.enums.AuthenticationModeEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.common.util.UserColorSet;
+import com.kdc.mybatis.mapper.api.RegisterUserMapper;
+import com.kdc.mybatis.mapper.common.entity.GroupMasterMapper;
+import com.kdc.mybatis.mapper.common.entity.InvitationManagementMapper;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+
+/**
+ * ユーザ登録 API Service クラス
+ *
+ */
+@Service
+public class RegisterUserService {
+
+ @Autowired
+ private CommonService commonService;
+
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private InvitationManagementMapper invitationManagementMapper;
+
+ @Autowired
+ private RegisterUserMapper registerUserMapper;
+
+ @Autowired
+ private GroupMasterMapper groupMasterMapper;
+
+ /**
+ * パラメータチェック.
+ *
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean checkParameter(RegisterUserRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ // モード
+ if (reqEntity.getMode() == null) {
+ resEntity.setMessage("mode is Empty");
+ return false;
+ }
+ try {
+ AuthenticationModeEnum.valueOf(reqEntity.getMode());
+ } catch (IllegalArgumentException e) {
+ resEntity.setMessage("mode is Wrong");
+ return false;
+ }
+
+ // ユーザID
+ if (StringUtils.isEmpty(reqEntity.getUserId())) {
+ resEntity.setMessage("userId is Empty");
+ return false;
+ }
+ if (StringUtils.length(reqEntity.getUserName()) > CommonConst.USER_NAME_MAX_LENGTH) {
+ resEntity.setMessage("userName is too Long");
+ return false;
+ }
+
+ // パスワード
+ if (StringUtils.isEmpty(reqEntity.getPassword())) {
+ resEntity.setMessage("password is Empty");
+ return false;
+ }
+ if (StringUtils.length(reqEntity.getPassword()) > CommonConst.PASSWORD_MAX_LENGTH) {
+ resEntity.setMessage("password is too Long");
+ return false;
+ }
+
+ // ユーザ名
+ if (StringUtils.isEmpty(reqEntity.getUserName())) {
+ resEntity.setMessage("userName is Empty");
+ return false;
+ }
+ if (StringUtils.length(reqEntity.getUserName()) > CommonConst.USER_NAME_MAX_LENGTH) {
+ resEntity.setMessage("userName is too Long");
+ return false;
+ }
+
+ // 招待コード
+ switch (AuthenticationModeEnum.valueOf(reqEntity.getMode())) {
+ case LOGIN:
+ case REGISTER_USER:
+ if (StringUtils.isEmpty(reqEntity.getInvitationCd())) {
+ resEntity.setMessage("invitationCd is Empty");
+ return false;
+ }
+ break;
+ case NEW_GROUP:
+ // 新規グループ作成時は招待コード不要
+ break;
+ }
+
+ // 端末情報
+ if (!this.commonService.checkDeviceInfoValues(reqEntity.getDeviceInfo(), resEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * ユーザ重複チェック.
+ *
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean checkUserDuplicated(RegisterUserRequestEntity reqEntity, RegisterUserResponseEntity resEntity) {
+
+ // ユーザIDは削除済みユーザとも重複不可
+ UserMasterEntity entity = this.userMasterMapper.selectByPk(reqEntity.getUserId(), null);
+ // ユーザID重複
+ if (entity != null) {
+ resEntity.setMessage("UserId Duplicated");
+ resEntity.setUserIdDuplicatedFlg(CommonConst.FLG_ON);
+ return false;
+ }
+ // ユーザ名は有効ユーザと重複不可
+ Integer hitCnt = this.registerUserMapper.selectUserInfo(reqEntity.getUserName());
+ // ユーザ名重複
+ if (hitCnt > 0) {
+ resEntity.setMessage("UserName Duplicated");
+ resEntity.setUserIdDuplicatedFlg(CommonConst.FLG_ON);
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * 招待コード適用.
+ *
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean useInvitationCode(RegisterUserRequestEntity reqEntity, RegisterUserResponseEntity resEntity) {
+
+ // 招待コード適用
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+ InvitationManagementEntity rec = new InvitationManagementEntity();
+ rec.setInvitationcode(reqEntity.getInvitationCd());
+ rec.setGuestuserid(reqEntity.getUserId());
+ rec.setGuesttelephonenumber(reqEntity.getDeviceInfo().getTelephoneNumber());
+ rec.setExpirationdate(nowTimestamp);
+ rec.setUpdateuserid(reqEntity.getUserId());
+ rec.setUpdatedate(nowTimestamp);
+
+ try {
+ int count = this.registerUserMapper.updateInvitationCodeUsed(rec);
+
+ // 更新件数0は招待コード適用失敗
+ if (count == 0) {
+ resEntity.setMessage("invitationCode is invalid");
+ return false;
+ }
+
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ /**
+ * ユーザ登録.
+ *
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean registerUser(RegisterUserRequestEntity reqEntity, RegisterUserResponseEntity resEntity) {
+
+ String groupId;
+ String groupName;
+ Integer authLevel;
+
+ switch (AuthenticationModeEnum.valueOf(reqEntity.getMode())) {
+ case LOGIN:
+ case REGISTER_USER:
+ default:
+ // 招待コードに紐づいたグループIDと管理レベルを取得
+ InvitationManagementEntity entity = this.invitationManagementMapper.selectByPk(reqEntity.getInvitationCd(),
+ CommonConst.FLG_OFF);
+ groupId = entity.getGroupid();
+ authLevel = entity.getAuthlevel();
+ break;
+ case NEW_GROUP:
+ // 新規グループ作成時は管理者で登録
+ groupId = this.registerUserMapper.getNewGroupId();
+ groupName = groupId + "グループ";
+ authLevel = AuthLevelEnum.ADMIN.getCode();
+
+ //グループマスタ登録
+ GroupInfoEntity groupMasterRec = new GroupInfoEntity();
+ groupMasterRec.setGroupid(groupId);
+ groupMasterRec.setGroupname(groupName);
+ groupMasterRec.setConfigparam1(String.valueOf(CommonConst.FLG_OFF));
+ groupMasterRec.setConfigparam2(String.valueOf(CommonConst.FLG_OFF));
+ groupMasterRec.setConfigparam3(String.valueOf(CommonConst.FLG_OFF));
+ groupMasterRec.setConfigparam4(String.valueOf(CommonConst.FLG_OFF));
+ groupMasterRec.setConfigparam5(String.valueOf(CommonConst.FLG_OFF));
+ groupMasterRec.setRegisteruserid(reqEntity.getUserId());
+ groupMasterRec.setRegisterdate(KdcCommonUtils.getNowTimestamp());
+
+ try {
+ this.groupMasterMapper.insert(groupMasterRec);
+ } catch( Exception e) {
+ return false;
+ }
+ break;
+ }
+
+ // ユーザシーケンス番号取得
+ int userSeq = this.commonService.getUserIdSeq();
+
+ // 表示色を取得
+ UserColorSet userColorSet = KdcCommonUtils.getNewUserColorSet(userSeq);
+
+ // ユーザ情報登録
+ UserMasterEntity userMasterRec = new UserMasterEntity();
+ userMasterRec.setUserid(reqEntity.getUserId());
+ userMasterRec.setPassword(reqEntity.getPassword());
+ userMasterRec.setUsername(reqEntity.getUserName());
+ userMasterRec.setGroupid(groupId);
+ userMasterRec.setAuthlevel(authLevel);
+ userMasterRec.setLinecolor(userColorSet.getLineColor());
+ userMasterRec.setMarkercolor(userColorSet.getMarkerColorId());
+ userMasterRec.setDisporder(userSeq);
+ userMasterRec.setRegisteruserid(reqEntity.getUserId());
+ userMasterRec.setRegisterdate(KdcCommonUtils.getNowTimestamp());
+
+ try {
+ this.userMasterMapper.insert(userMasterRec);
+
+ // レスポンス作成
+ resEntity.setUserIdDuplicatedFlg(CommonConst.FLG_OFF);
+
+ UserInfoEntity userInfo = new UserInfoEntity();
+ userInfo.setUserId(reqEntity.getUserId());
+ userInfo.setPassword(reqEntity.getPassword());
+ userInfo.setUserName(reqEntity.getUserName());
+ userInfo.setGroupId(groupId);
+ userInfo.setAuthLevel(String.valueOf(authLevel));
+ userInfo.setLineColor(userColorSet.getLineColor());
+ userInfo.setMarkerColor(String.valueOf(userColorSet.getMarkerColorId()));
+ resEntity.setUserInfo(userInfo);
+
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/sendlocation/SendLocationController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/sendlocation/SendLocationController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/sendlocation/SendLocationController.java (revision 2)
@@ -0,0 +1,122 @@
+package com.kdc.api.sendlocation;
+
+import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.sendlocation.SendLocationRequestEntity;
+import com.kdc.api.sendlocation.SendLocationResponseEntity;
+import com.kdc.common.entity.api.UpdateInfoEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * 位置情報送信 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class SendLocationController {
+
+ private static final Logger logger = LoggerFactory.getLogger(SendLocationController.class);
+
+ @Autowired
+ private SendLocationService sendLocationService;
+
+ // 端末の位置情報送信
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/send/location", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public SendLocationResponseEntity sendLocation(@RequestBody SendLocationRequestEntity bean,
+ HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.SEND_LOCATION, bean.getUserInfo(), bean.getDeviceInfo()));
+
+ // レスポンス作成
+ SendLocationResponseEntity resEntity = new SendLocationResponseEntity();
+ resEntity.setApiId(CommonConst.API_ID_SEND_LOCATION);
+
+ // パラメータチェック
+ if (!this.sendLocationService.parameterCheck(bean, resEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.SEND_LOCATION, bean.getUserInfo(), bean.getDeviceInfo(),
+ "parameterCheck"));
+ this.getRequestParameterLog(bean);
+ return resEntity;
+ }
+
+ // 位置情報登録
+ // ユーザ移動履歴登録
+ if (!this.sendLocationService.registerUserLocationRecord(bean)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.SEND_LOCATION, bean.getUserInfo(), bean.getDeviceInfo(),
+ "registerUserLocationRecord"));
+ this.getRequestParameterLog(bean);
+ return resEntity;
+ }
+ // ユーザ位置登録
+ if (!this.sendLocationService.registerUserLocation(bean)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.SEND_LOCATION, bean.getUserInfo(), bean.getDeviceInfo(),
+ "registerUserLocation"));
+ this.getRequestParameterLog(bean);
+ return resEntity;
+ }
+
+ // ユーザ端末更新
+ if (!this.sendLocationService.registerUserDevice(bean)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.SEND_LOCATION, bean.getUserInfo(), bean.getDeviceInfo(),
+ "registerUserDevice"));
+ return resEntity;
+ }
+
+ // 更新情報の取得
+ UpdateInfoEntity updateInfo = this.sendLocationService.getUpdateInfo(bean);
+
+ resEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ resEntity.setUpdateInfo(updateInfo);
+
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.SEND_LOCATION, bean.getUserInfo(), bean.getDeviceInfo(),
+ response.getStatus(), resEntity.getResultCd()));
+ return resEntity;
+ }
+
+ private void getRequestParameterLog(SendLocationRequestEntity bean) {
+ logger.info("UserId:" + bean.getUserInfo().getUserId());
+ logger.info("UserName:" + bean.getUserInfo().getUserName());
+ logger.info("AuthLevel:" + bean.getUserInfo().getAuthLevel());
+ logger.info("TelephoneNumber:" + bean.getDeviceInfo().getTelephoneNumber());
+ logger.info("DeviceId:" + bean.getDeviceInfo().getDeviceId());
+ logger.info("TokenId:" + bean.getDeviceInfo().getTokenId());
+ if (bean.getLocationRecordInfo() == null) {
+ logger.info("LocationRecordInfo = null");
+ } else {
+ logger.info("LocationRecordInfo size=" + bean.getLocationRecordInfo().size());
+ for (int i = 0; i < bean.getLocationRecordInfo().size(); i++) {
+ logger.info("RecordDate:" + bean.getLocationRecordInfo().get(i).getRecordDate());
+ logger.info("Latitude:" + bean.getLocationRecordInfo().get(i).getLatitude());
+ logger.info("Longitude:" + bean.getLocationRecordInfo().get(i).getLongitude());
+ logger.info("BatteryLevel:" + bean.getLocationRecordInfo().get(i).getBatteryLevel());
+ logger.info("ReceptionStatus:" + bean.getLocationRecordInfo().get(i).getReceptionStatus());
+ logger.info("--------------------");
+ }
+ }
+ return;
+ }
+
+}
\ No newline at end of file
Index: kdc/src/main/java/com/kdc/api/sendlocation/SendLocationRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/sendlocation/SendLocationRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/sendlocation/SendLocationRequestEntity.java (revision 2)
@@ -0,0 +1,27 @@
+package com.kdc.api.sendlocation;
+
+import java.util.List;
+
+import com.kdc.common.entity.api.LocationRecordInfoEntity;
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class SendLocationRequestEntity extends RequestBaseEntity {
+
+ private List<LocationRecordInfoEntity> locationRecordInfo;
+
+ /**
+ * @return locationRecordInfo
+ */
+ public List<LocationRecordInfoEntity> getLocationRecordInfo() {
+ return locationRecordInfo;
+ }
+
+ /**
+ * @param locationRecordInfo
+ * セットする locationRecordInfo
+ */
+ public void setLocationRecordInfo(List<LocationRecordInfoEntity> locationRecordInfo) {
+ this.locationRecordInfo = locationRecordInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/sendlocation/SendLocationResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/sendlocation/SendLocationResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/sendlocation/SendLocationResponseEntity.java (revision 2)
@@ -0,0 +1,25 @@
+package com.kdc.api.sendlocation;
+
+import com.kdc.common.entity.api.UpdateInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class SendLocationResponseEntity extends ResponseBaseEntity {
+
+ private UpdateInfoEntity updateInfo;
+
+ /**
+ * @return updateInfo
+ */
+ public UpdateInfoEntity getUpdateInfo() {
+ return updateInfo;
+ }
+
+ /**
+ * @param updateInfo
+ * セットする updateInfo
+ */
+ public void setUpdateInfo(UpdateInfoEntity updateInfo) {
+ this.updateInfo = updateInfo;
+ }
+
+}
\ No newline at end of file
Index: kdc/src/main/java/com/kdc/api/sendlocation/SendLocationService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/sendlocation/SendLocationService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/sendlocation/SendLocationService.java (revision 2)
@@ -0,0 +1,521 @@
+package com.kdc.api.sendlocation;
+
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.LocationRecordInfoEntity;
+import com.kdc.common.entity.api.PushNotificationEntity;
+import com.kdc.common.entity.api.UpdateInfoEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.db.UserLocationEntityWrapper;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.enums.ConnectionStatusEnum;
+import com.kdc.common.enums.PlaceTypeEnum;
+import com.kdc.common.enums.PushNotificationEnum;
+import com.kdc.common.entity.db.UserAlertRecordEntity;
+import com.kdc.common.entity.db.UserDeviceEntity;
+import com.kdc.common.entity.db.PlaceMasterEntityWrapper;
+import com.kdc.common.entity.db.ConfigMasterEntity;
+import com.kdc.common.entity.db.PlaceAlertRecordEntity;
+import com.kdc.common.entity.db.UserLocationRecordEntityWrapper;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.common.util.PushNotificationCounter;
+import com.kdc.common.util.PushNotificationService;
+import com.kdc.mybatis.mapper.api.SendLocationMapper;
+import com.kdc.mybatis.mapper.common.entity.ConfigMasterMapper;
+import com.kdc.mybatis.mapper.common.entity.PlaceAlertRecordMapper;
+import com.kdc.mybatis.mapper.common.entity.PlaceMasterMapper;
+import com.kdc.mybatis.mapper.common.entity.UserAlertRecordMapper;
+import com.kdc.mybatis.mapper.common.entity.UserLocationMapper;
+import com.kdc.mybatis.mapper.common.entity.UserLocationRecordMapper;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+import com.kdc.mybatis.mapper.common.util.PushNotificationMapper;
+
+/**
+ * 位置情報送信 API Service クラス
+ *
+ */
+@Service
+public class SendLocationService {
+
+ private static final Logger logger = LoggerFactory.getLogger(SendLocationService.class);
+
+ @Autowired
+ private CommonService commonService;
+
+ @Autowired
+ private PushNotificationService pushNotificationService;
+
+ @Autowired
+ private ConfigMasterMapper configMasterMapper;
+
+ @Autowired
+ private PushNotificationMapper pushNotificationMapper;
+
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private UserLocationMapper userLocationMapper;
+
+ @Autowired
+ private UserLocationRecordMapper userLocationRecordMapper;
+
+ @Autowired
+ private UserAlertRecordMapper userAlertRecordMapper;
+
+ @Autowired
+ private PlaceMasterMapper placeMasterMapper;
+
+ @Autowired
+ private PlaceAlertRecordMapper placeAlertRecordMapper;
+
+ @Autowired
+ private SendLocationMapper sendLocationMapper;
+
+ /**
+ * パラメータチェック.
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(SendLocationRequestEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ // ユーザー・端末情報
+ if (!this.commonService.checkBaseParameter(reqEntity, resEntity)) {
+ return false;
+ }
+
+ // 位置履歴情報
+ if (reqEntity.getLocationRecordInfo() == null) {
+ resEntity.setMessage("locationRecordInfo is Empty");
+ return false;
+ } else {
+ for (LocationRecordInfoEntity entity : reqEntity.getLocationRecordInfo()) {
+
+ // 記録日時
+ if (StringUtils.isEmpty(entity.getRecordDate())) {
+ resEntity.setMessage("locationRecordInfo.recordDate is Empty");
+ return false;
+ }
+ // 緯度
+ if (StringUtils.isEmpty(entity.getLatitude())) {
+ resEntity.setMessage("locationRecordInfo.latitude is Empty");
+ return false;
+ }
+ // 経度
+ if (StringUtils.isEmpty(entity.getLongitude())) {
+ resEntity.setMessage("locationRecordInfo.longitude is Empty");
+ return false;
+ }
+ // バッテリー残量
+ if (StringUtils.isEmpty(entity.getBatteryLevel())) {
+ resEntity.setMessage("locationRecordInfo.battertLevel is Empty");
+ return false;
+ }
+ // 電波状況
+ if (StringUtils.isEmpty(entity.getReceptionStatus())) {
+ resEntity.setMessage("locationRecordInfo.receptionStatus is Empty");
+ return false;
+ }
+ // 日付不正チェック
+ if (!KdcCommonUtils.checkDateTimeString(entity.getRecordDate())) {
+ resEntity.setMessage("locationRecordInfo.recordDate is Wrong");
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * ユーザ移動履歴登録.
+ * @param reqEntity
+ * @return Boolean
+ */
+ public Boolean registerUserLocationRecord(SendLocationRequestEntity reqEntity) {
+
+ // user_location_record
+ UserLocationRecordEntityWrapper rec = new UserLocationRecordEntityWrapper();
+ rec.setUserid(reqEntity.getUserInfo().getUserId());
+ rec.setRegisteruserid(reqEntity.getUserInfo().getUserId());
+ rec.setRegisterdate(KdcCommonUtils.getNowTimestamp());
+
+ try {
+ for (LocationRecordInfoEntity entity : reqEntity.getLocationRecordInfo()) {
+
+ rec.setReceivedate(KdcCommonUtils.dateTimeStringToTimestamp(entity.getRecordDate()));
+ rec.setLatitude(entity.getLatitude());
+ rec.setLongitude(entity.getLongitude());
+ rec.setBatterylevel(Integer.parseInt(entity.getBatteryLevel()));
+ rec.setReceptionstatus(Integer.parseInt(entity.getReceptionStatus()));
+
+ this.userLocationRecordMapper.insert(rec);
+ }
+
+ return true;
+ } catch (Exception e) {
+ logger.info(e.toString());
+ return false;
+ }
+ }
+
+ /**
+ * ユーザ位置登録
+ * @param reqEntity
+ * @return Boolean
+ */
+ public Boolean registerUserLocation(SendLocationRequestEntity reqEntity) {
+
+ // 最新の位置情報を格納
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+ UserLocationEntityWrapper locRec = new UserLocationEntityWrapper();
+ locRec.setUserid(reqEntity.getUserInfo().getUserId());
+ locRec.setLatitude(reqEntity.getLocationRecordInfo().get(0).getLatitude());
+ locRec.setLongitude(reqEntity.getLocationRecordInfo().get(0).getLongitude());
+ locRec.setBatterylevel(Integer.parseInt(reqEntity.getLocationRecordInfo().get(0).getBatteryLevel()));
+ locRec.setReceptionstatus(Integer.parseInt(reqEntity.getLocationRecordInfo().get(0).getReceptionStatus()));
+ locRec.setConnectionstatus(ConnectionStatusEnum.CONNECT.getCode());
+ locRec.setLastlocationdate(nowTimestamp);
+ locRec.setRegisteruserid(reqEntity.getUserInfo().getUserId());
+ locRec.setRegisterdate(nowTimestamp);
+ locRec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ locRec.setUpdatedate(nowTimestamp);
+
+ try {
+ // 前回の位置情報
+ UserLocationEntityWrapper lastLocation = this.userLocationMapper
+ .selectByPk(reqEntity.getUserInfo().getUserId(), CommonConst.FLG_OFF);
+
+ if (lastLocation == null) {
+
+ // レコードなし=>登録
+ // user_location
+ this.userLocationMapper.insert(locRec);
+
+ } else {
+ // 移動距離計算
+ String distance = KdcCommonUtils.computeDistance(lastLocation.getLatitude(),
+ lastLocation.getLongitude(),
+ new BigDecimal(reqEntity.getLocationRecordInfo().get(0).getLatitude()),
+ new BigDecimal(reqEntity.getLocationRecordInfo().get(0).getLongitude()));
+
+ // ユーザ位置を更新
+ // user_location
+ locRec.setMovingdistance(Integer.parseInt(distance)); // 移動距離
+ this.userLocationMapper.update(locRec);
+ }
+
+ UserInfoEntity userInfo = reqEntity.getUserInfo();
+ UserMasterEntity user = this.userMasterMapper.selectByPk(userInfo.getUserId(), CommonConst.FLG_OFF);
+ if (user == null) {
+ return false;
+ }
+ userInfo.setGroupId(user.getGroupid());
+ userInfo.setAuthLevel(String.valueOf(user.getAuthlevel()));
+ userInfo.setUserName(user.getUsername());
+
+ // 設定マスタからPush通知再送信待機時間を取得
+ List<ConfigMasterEntity> configList = this.configMasterMapper
+ .selectCodeList(CommonConst.CONFIG_ID_PUSH_NOTIFICATION_INTERVAL_TIME,user.getGroupid());
+ int intervalMinutes = (configList != null) ? Integer.parseInt(configList.get(0).getConfigparam1()) : 0;
+ boolean batteryNotificationOneTime = (configList != null)
+ ? KdcCommonUtils.isFlgOn(configList.get(0).getConfigparam2()) : false;
+ boolean placeNotificationOneTime = (configList != null)
+ ? KdcCommonUtils.isFlgOn(configList.get(0).getConfigparam4()) : false;
+
+ this.pushNotificationService.setApiKey();
+
+ // バッテリー残量Push通知
+ this.sendBatteryAlert(userInfo, reqEntity.getLocationRecordInfo().get(0), nowTimestamp, intervalMinutes,
+ batteryNotificationOneTime);
+
+ // 場所Push通知
+ this.sendPlaceAlert(userInfo, reqEntity.getLocationRecordInfo().get(0), nowTimestamp, intervalMinutes,
+ lastLocation, placeNotificationOneTime);
+
+ return true;
+ } catch (Exception e) {
+ logger.info(e.toString());
+ return false;
+ }
+ }
+
+ /**
+ * バッテリー残量通知.
+ * @param userInfo
+ * @param locationInfo
+ * @param locationTimestamp
+ * @param intervalMinutes
+ * @param batteryNotificationOneTime
+ */
+ private void sendBatteryAlert(UserInfoEntity userInfo, LocationRecordInfoEntity locationInfo,
+ Timestamp locationTimestamp, int intervalMinutes, boolean batteryNotificationOneTime) {
+ PushNotificationCounter counter = new PushNotificationCounter();
+ boolean sendNotify = false;
+
+ UserAlertRecordEntity userAlertRecord = this.userAlertRecordMapper.selectByPk(userInfo.getUserId(),
+ CommonConst.FLG_OFF);
+ if (userAlertRecord == null || userAlertRecord.getLastbatteryalertdate() == null) {
+ // 通知記録が無い=初回の通知は必ず送信
+ sendNotify = true;
+ } else if (batteryNotificationOneTime
+ && StringUtils.equals(KdcCommonUtils.timestampToDateString(locationTimestamp),
+ KdcCommonUtils.timestampToDateString(userAlertRecord.getLastbatteryalertdate()))) {
+ // 1日1回しか通知しない設定
+ sendNotify = false;
+ } else if (locationTimestamp.after(
+ KdcCommonUtils.timestampPlusTime(userAlertRecord.getLastbatteryalertdate(), 0, intervalMinutes, 0))) {
+ // 前回の通知時間から、再通知待機時間(分)が経過していれば通知する
+ sendNotify = true;
+ }
+
+ if (sendNotify) {
+ List<PushNotificationEntity> notifyList = this.pushNotificationMapper.selectBatteryAlertTokenIdList(
+ userInfo.getUserId(), Integer.parseInt(locationInfo.getBatteryLevel()));
+ if (this.pushNotificationService.sendAlert(ApiIdEnum.valueOf(CommonConst.API_ID_SEND_LOCATION),
+ PushNotificationEnum.BATTERY, userInfo, notifyList, counter, logger)) {
+ // 通知時間をDBに記録
+ this.pushNotificationService.upsertUserAlertRecord(PushNotificationEnum.BATTERY, userInfo.getUserId());
+ }
+ }
+ logger.info("バッテリー残量Push通知 OK:" + counter.getSendCompleteCnt() + " NG:" + counter.getSendErrorCnt()
+ + " TokenID未設定:" + counter.getSendExceptCnt());
+ for (String token : counter.getErrorTokenList()) {
+ logger.info("Send Error:" + token);
+ }
+ }
+
+ /**
+ * 場所通知.
+ * @param userInfo
+ * @param locationInfo
+ * @param locationTimestamp
+ * @param intervalMinutes
+ * @param lastLocation
+ * @param placeNotificationOneTime
+ */
+ private void sendPlaceAlert(UserInfoEntity userInfo, LocationRecordInfoEntity locationInfo,
+ Timestamp locationTimestamp, int intervalMinutes, UserLocationEntityWrapper lastLocation,
+ boolean placeNotificationOneTime) {
+ PushNotificationCounter inCounter = new PushNotificationCounter();
+ PushNotificationCounter outCounter = new PushNotificationCounter();
+ boolean sendNotify = false;
+
+ List<PlaceMasterEntityWrapper> placeList = this.placeMasterMapper.selectAll(CommonConst.FLG_OFF,userInfo.getGroupId(), true);
+ for (PlaceMasterEntityWrapper place : placeList) {
+ PlaceAlertRecordEntity placeAlertRecord = this.placeAlertRecordMapper.selectByPk(userInfo.getUserId(),
+ place.getPlaceid(), CommonConst.FLG_OFF);
+ // 今回と前回の位置情報を重なり判定
+ boolean nowLocationInPlace = KdcCommonUtils.userPlaceEngaged(new BigDecimal(locationInfo.getLatitude()),
+ new BigDecimal(locationInfo.getLongitude()), place);
+ boolean lastLocationInPlace = (lastLocation != null)
+ ? KdcCommonUtils.userPlaceEngaged(lastLocation.getLatitude(), lastLocation.getLongitude(), place)
+ : false;
+ PushNotificationEnum pushItem = null;
+ if (nowLocationInPlace) {
+ // 場所の内側にいる場合
+ if (placeAlertRecord == null || placeAlertRecord.getLastplaceinalertdate() == null) {
+ // 通知記録が無い=初回の通知は必ず送信
+ sendNotify = true;
+ } else if (placeNotificationOneTime
+ && StringUtils.equals(KdcCommonUtils.timestampToDateString(locationTimestamp),
+ KdcCommonUtils.timestampToDateString(placeAlertRecord.getLastplaceinalertdate()))) {
+ // 1日1回しか通知しない設定
+ sendNotify = false;
+ } else if (locationTimestamp.after(KdcCommonUtils
+ .timestampPlusTime(placeAlertRecord.getLastplaceinalertdate(), 0, intervalMinutes, 0))) {
+ // 前回の通知時間から、再通知待機時間(分)が経過していれば通知する
+ sendNotify = true;
+ }
+
+ if (sendNotify) {
+ switch (PlaceTypeEnum.valueOf(place.getPlacetypeflg())) {
+ case NORMAL:
+ pushItem = PushNotificationEnum.PLACE_NORMAL_IN;
+ break;
+ case DANGER:
+ pushItem = PushNotificationEnum.PLACE_DANGER_IN;
+ break;
+ }
+ }
+ } else if (!nowLocationInPlace && lastLocationInPlace) {
+ // 場所の内側から外側に移動した場合
+ if (placeAlertRecord == null || placeAlertRecord.getLastplaceoutalertdate() == null) {
+ // 通知記録が無い=初回の通知は必ず送信
+ sendNotify = true;
+ } else if (placeNotificationOneTime
+ && StringUtils.equals(KdcCommonUtils.timestampToDateString(locationTimestamp),
+ KdcCommonUtils.timestampToDateString(placeAlertRecord.getLastplaceoutalertdate()))) {
+ // 1日1回しか通知しない設定
+ sendNotify = false;
+ } else if (locationTimestamp.after(KdcCommonUtils
+ .timestampPlusTime(placeAlertRecord.getLastplaceoutalertdate(), 0, intervalMinutes, 0))) {
+ // 前回の通知時間から、再通知待機時間(分)が経過していれば通知する
+ sendNotify = true;
+ }
+
+ if (sendNotify) {
+ switch (PlaceTypeEnum.valueOf(place.getPlacetypeflg())) {
+ case NORMAL:
+ pushItem = PushNotificationEnum.PLACE_NORMAL_OUT;
+ break;
+ case DANGER:
+ pushItem = PushNotificationEnum.PLACE_DANGER_OUT;
+ break;
+ }
+ }
+ }
+ if (pushItem != null) {
+ if (this.sendPlaceAlertMain(pushItem, userInfo, place, inCounter, outCounter)) {
+ // 通知時間をDBに記録
+ this.pushNotificationService.upsertPlaceAlertRecord(pushItem, userInfo.getUserId(),
+ place.getPlaceid());
+ }
+ }
+ }
+ logger.info("場所進入Push通知 OK:" + inCounter.getSendCompleteCnt() + " NG:" + inCounter.getSendErrorCnt()
+ + " TokenID未設定:" + inCounter.getSendExceptCnt());
+ for (String token : inCounter.getErrorTokenList()) {
+ logger.info("Send Error:" + token);
+ }
+ logger.info("場所退出Push通知 OK:" + outCounter.getSendCompleteCnt() + " NG:" + outCounter.getSendErrorCnt()
+ + " TokenID未設定:" + outCounter.getSendExceptCnt());
+ for (String token : outCounter.getErrorTokenList()) {
+ logger.info("Send Error:" + token);
+ }
+ }
+
+ /**
+ * 場所通知メイン.
+ * @param pushItem
+ * @param userInfo
+ * @param place
+ * @param inCounter
+ * @param outCounter
+ * @return Boolean
+ */
+ private Boolean sendPlaceAlertMain(PushNotificationEnum pushItem, UserInfoEntity userInfo,
+ PlaceMasterEntityWrapper place, PushNotificationCounter inCounter, PushNotificationCounter outCounter) {
+ List<PushNotificationEntity> notifyList = this.pushNotificationMapper
+ .selectPlaceAlertTokenIdList(userInfo.getUserId(), place.getPlaceid());
+ Boolean inFlg;
+ switch (pushItem) {
+ case PLACE_NORMAL_IN:
+ case PLACE_DANGER_IN:
+ inFlg = true;
+ break;
+ case PLACE_NORMAL_OUT:
+ case PLACE_DANGER_OUT:
+ inFlg = false;
+ break;
+ default:
+ return false;
+ }
+ if (!this.pushNotificationService.sendAlert(ApiIdEnum.valueOf(CommonConst.API_ID_SEND_LOCATION), pushItem,
+ userInfo, place, notifyList, inFlg ? inCounter : outCounter, logger)) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * ユーザ端末更新
+ * @param reqEntity
+ * @return Boolean
+ */
+ public Boolean registerUserDevice(SendLocationRequestEntity reqEntity) {
+
+ UserDeviceEntity devRec = new UserDeviceEntity();
+
+ devRec.setUserid(reqEntity.getUserInfo().getUserId());
+ devRec.setUpdateuserid(reqEntity.getUserInfo().getUserId());
+ devRec.setUpdatedate(KdcCommonUtils.getNowTimestamp());
+ devRec.setTokenid(reqEntity.getDeviceInfo().getTokenId());
+
+ try {
+ this.sendLocationMapper.updateUserDevice(devRec);
+
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ /**
+ * 更新情報の取得. レスポンス情報の作成.
+ * @param reqEntity
+ * @return UpdateInfoEntity
+ */
+ public UpdateInfoEntity getUpdateInfo(SendLocationRequestEntity reqEntity) {
+
+ UpdateInfoEntity entity = new UpdateInfoEntity();
+
+ // 設定同期日
+ // user_device設定同期日時
+ Timestamp configSyncDate = this.sendLocationMapper.selectConfigSyncDate(reqEntity.getUserInfo().getUserId());
+
+ // 各設定更新日
+ // user_master更新日
+ Timestamp updateDateUserMaster = this.sendLocationMapper
+ .selectUpdateDateUserMaster(reqEntity.getUserInfo().getUserId());
+ // user_notification更新日max
+ Timestamp maxUpdUserNotification = this.sendLocationMapper
+ .selectMaxUpdUserAlertConfig(reqEntity.getUserInfo().getUserId());
+ // send_interval更新日max
+ Timestamp maxUpdSendIntervalConfig = this.sendLocationMapper
+ .selectMaxUpdSendIntervalConfig(reqEntity.getUserInfo().getUserId());
+ // user_place_notification更新日max
+ Timestamp maxUpdPlaceNotification = sendLocationMapper
+ .selectMaxUpdPlaceAlertConfig(reqEntity.getUserInfo().getUserId());
+ // config_master更新日max
+ Timestamp maxUpdConfigMaster = this.sendLocationMapper.selectMaxUpdConfigMaster(reqEntity.getUserInfo().getGroupId());
+
+ if (configSyncDate != null) {
+ if (updateDateUserMaster != null && updateDateUserMaster.compareTo(configSyncDate) >= 0) {
+ entity.setUserUpdateFlg(CommonConst.FLG_ON);
+ } else {
+ entity.setUserUpdateFlg(CommonConst.FLG_OFF);
+ }
+ if (maxUpdSendIntervalConfig != null && maxUpdSendIntervalConfig.compareTo(configSyncDate) >= 0) {
+ entity.setTransmissionUpdateFlg(CommonConst.FLG_ON);
+ } else {
+ entity.setTransmissionUpdateFlg(CommonConst.FLG_OFF);
+ }
+ if (maxUpdConfigMaster != null && maxUpdConfigMaster.compareTo(configSyncDate) >= 0) {
+ entity.setUtilityUpdateFlg(CommonConst.FLG_ON);
+ } else {
+ entity.setUtilityUpdateFlg(CommonConst.FLG_OFF);
+ }
+ if (maxUpdUserNotification != null && maxUpdUserNotification.compareTo(configSyncDate) >= 0) {
+ entity.setUserNotificationUpdateFlg(CommonConst.FLG_ON);
+ } else {
+ entity.setUserNotificationUpdateFlg(CommonConst.FLG_OFF);
+ }
+ if (maxUpdPlaceNotification != null && maxUpdPlaceNotification.compareTo(configSyncDate) >= 0) {
+ entity.setPlaceNotificationUpdateFlg(CommonConst.FLG_ON);
+ } else {
+ entity.setPlaceNotificationUpdateFlg(CommonConst.FLG_OFF);
+ }
+ } else {
+ entity.setUserUpdateFlg(CommonConst.FLG_ON);
+ entity.setTransmissionUpdateFlg(CommonConst.FLG_ON);
+ entity.setUtilityUpdateFlg(CommonConst.FLG_ON);
+ entity.setUserNotificationUpdateFlg(CommonConst.FLG_ON);
+ entity.setPlaceNotificationUpdateFlg(CommonConst.FLG_ON);
+ }
+
+ return entity;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertController.java (revision 2)
@@ -0,0 +1,73 @@
+package com.kdc.api.sendsosalert;
+
+import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.sendsosalert.SendSosAlertRequestEntity;
+import com.kdc.api.sendsosalert.SendSosAlertResponseEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+import groovy.util.logging.Slf4j;
+
+/**
+ * SOS送信 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+@Slf4j
+public class SendSosAlertController {
+
+ private static final Logger logger = LoggerFactory.getLogger(SendSosAlertController.class);
+
+ @Autowired
+ private SendSosAlertService sendSosAlertService;
+
+ // SOS送信
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/send/sosalert", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public SendSosAlertResponseEntity sendSosAlert(@RequestBody SendSosAlertRequestEntity requestEntity,
+ HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.SEND_SOS_ALERT, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo()));
+
+ // レスポンス作成
+ SendSosAlertResponseEntity responseEntity = new SendSosAlertResponseEntity();
+ responseEntity.setApiId(CommonConst.API_ID_SEND_SOS_ALERT);
+
+ // パラメータチェック
+ if (!this.sendSosAlertService.parameterCheck(requestEntity, responseEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.SEND_SOS_ALERT, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "parameterCheck"));
+ return responseEntity;
+ }
+
+ // Push通知
+ if (!this.sendSosAlertService.sendSosAlert(requestEntity.getUserInfo(), responseEntity)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.SEND_SOS_ALERT, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "sendSosAlert"));
+ return responseEntity;
+ }
+
+ // レスポンス情報作成
+ responseEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.SEND_SOS_ALERT, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), response.getStatus(), responseEntity.getResultCd()));
+ return responseEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertRequestEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.sendsosalert;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+
+public class SendSosAlertRequestEntity extends RequestBaseEntity {
+
+}
Index: kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertResponseEntity.java (revision 2)
@@ -0,0 +1,7 @@
+package com.kdc.api.sendsosalert;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class SendSosAlertResponseEntity extends ResponseBaseEntity {
+
+}
Index: kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/sendsosalert/SendSosAlertService.java (revision 2)
@@ -0,0 +1,99 @@
+package com.kdc.api.sendsosalert;
+
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.PushNotificationEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.enums.PushNotificationEnum;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+import com.kdc.mybatis.mapper.common.util.PushNotificationMapper;
+import groovy.util.logging.Slf4j;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.PushNotificationService;
+import com.kdc.common.util.PushNotificationCounter;
+
+/**
+ * SOS送信 API Service クラス
+ *
+ */
+@Service
+@Slf4j
+public class SendSosAlertService {
+
+ private static final Logger logger = LoggerFactory.getLogger(SendSosAlertService.class);
+
+ @Autowired
+ private PushNotificationService pushNotificationService;
+
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private PushNotificationMapper pushNotificationMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ /**
+ * パラメータチェック.
+ * @param requestEntity
+ * @param responseEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(SendSosAlertRequestEntity requestEntity, SendSosAlertResponseEntity responseEntity) {
+ // 必須チェック
+ if (!this.commonService.checkBaseParameter(requestEntity, responseEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * SOS通知.
+ * @param userInfo
+ * @param responseEntity
+ * @return Boolean
+ */
+ public Boolean sendSosAlert(UserInfoEntity userInfo, SendSosAlertResponseEntity responseEntity) {
+ PushNotificationCounter counter = new PushNotificationCounter();
+
+ try {
+ UserMasterEntity master = this.userMasterMapper.selectByPk(userInfo.getUserId(), CommonConst.FLG_OFF);
+ if (master == null) {
+ return false;
+ }
+ userInfo.setGroupId(master.getGroupid());
+ userInfo.setAuthLevel(String.valueOf(master.getAuthlevel()));
+ userInfo.setUserName(master.getUsername());
+
+ // 再通知待機時間(分)に関わらず通知する
+ List<PushNotificationEntity> notifyList = this.pushNotificationMapper
+ .selectSosAlertTokenIdList(userInfo.getUserId());
+ this.pushNotificationService.setApiKey();
+ if (this.pushNotificationService.sendAlert(ApiIdEnum.valueOf(CommonConst.API_ID_SEND_SOS_ALERT),
+ PushNotificationEnum.SOS, userInfo, notifyList, counter, logger)) {
+ // 通知時間をDBに記録
+ this.pushNotificationService.upsertUserAlertRecord(PushNotificationEnum.SOS, userInfo.getUserId());
+ }
+ logger.info("SOSPush通知 OK:" + counter.getSendCompleteCnt() + " NG:" + counter.getSendErrorCnt()
+ + " TokenID未設定:" + counter.getSendExceptCnt());
+ for (String token : counter.getErrorTokenList()) {
+ logger.info("Send Error:" + token);
+ }
+ responseEntity.setMessage("SOSPush通知 OK:" + counter.getSendCompleteCnt() + " NG:"
+ + counter.getSendErrorCnt() + " TokenID未設定:" + counter.getSendExceptCnt());
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/settingotheruser/SettingOtherUserController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/settingotheruser/SettingOtherUserController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/settingotheruser/SettingOtherUserController.java (revision 2)
@@ -0,0 +1,82 @@
+package com.kdc.api.settingotheruser;
+
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.settinguser.SettingUserRequestEntity;
+import com.kdc.api.settinguser.SettingUserResponseEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * 他ユーザ情報変更 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class SettingOtherUserController {
+
+ private static final Logger logger = LoggerFactory.getLogger(SettingOtherUserController.class);
+
+ @Autowired
+ private SettingOtherUserService settingOtherUserService;
+
+ // 他ユーザ情報変更
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/admin/setting/user", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public SettingUserResponseEntity sendOtherUser(@RequestBody SettingUserRequestEntity requestEntity,
+ HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.ADMIN_SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo()));
+
+ SettingUserResponseEntity responseEntity = new SettingUserResponseEntity();
+ responseEntity.setApiId(CommonConst.API_ID_ADMIN_SETTING_USER);
+
+ // パラメータチェック
+ if (!this.settingOtherUserService.parameterCheck(requestEntity, responseEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.ADMIN_SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "parameterCheck"));
+ return responseEntity;
+ }
+
+ // 変更後ユーザ情報が設定されている場合、ユーザ情報の更新を行う
+ if (StringUtils.isNotEmpty(requestEntity.getUpdatedUserInfo().getUserId())) {
+ // ユーザ情報の重複チェック
+ if (!this.settingOtherUserService.checkUserInfo(requestEntity)) {
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ responseEntity.setMessage("userName Duplicate");
+ responseEntity.setUserNameDuplicatedFlg(CommonConst.FLG_ON);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.ADMIN_SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "checkUserInfo"));
+ return responseEntity;
+ }
+ if (!this.settingOtherUserService.registUserInfo(requestEntity, responseEntity)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.ADMIN_SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "registUserInfo"));
+ return responseEntity;
+ }
+ }
+ // レスポンス情報作成
+ responseEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.ADMIN_SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), response.getStatus(), responseEntity.getResultCd()));
+ return responseEntity;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/settingotheruser/SettingOtherUserService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/settingotheruser/SettingOtherUserService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/settingotheruser/SettingOtherUserService.java (revision 2)
@@ -0,0 +1,178 @@
+package com.kdc.api.settingotheruser;
+
+import java.util.Base64;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.mybatis.mapper.api.SettingUserMapper;
+import com.kdc.mybatis.mapper.common.util.PushNotificationMapper;
+import com.kdc.api.settinguser.SettingUserRequestEntity;
+import com.kdc.api.settinguser.SettingUserResponseEntity;
+import com.kdc.common.entity.api.PushNotificationEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.enums.PushNotificationEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.common.util.PushNotificationCounter;
+import com.kdc.common.util.PushNotificationService;
+
+/**
+ * 他ユーザ情報変更 API Service クラス
+ *
+ */
+@Service
+public class SettingOtherUserService {
+
+ private static final Logger logger = LoggerFactory.getLogger(SettingOtherUserService.class);
+
+ @Autowired
+ private SettingUserMapper settingUserMapper;
+
+ @Autowired
+ private PushNotificationMapper pushNotificationMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ @Autowired
+ private PushNotificationService pushNotificationService;
+
+ /**
+ * パラメータチェック.
+ * @param requestEntity
+ * @param responseEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(SettingUserRequestEntity requestEntity, ResponseBaseEntity responseEntity) {
+
+ if (!this.commonService.checkBaseParameter(requestEntity, responseEntity)) {
+ return false;
+ }
+
+ // 変更後ユーザ情報
+ if (requestEntity.getUpdatedUserInfo() == null) {
+ responseEntity.setMessage("updatedUserInfo is Empty");
+ return false;
+ }
+ // 変更後ユーザ情報.ユーザID
+ if (StringUtils.isEmpty(requestEntity.getUpdatedUserInfo().getUserId())) {
+ responseEntity.setMessage("updatedUserInfo.userId is Empty");
+ return false;
+ }
+
+ // 変更後ユーザ情報.パスワード
+ if (StringUtils.length(requestEntity.getUpdatedUserInfo().getPassword()) > CommonConst.PASSWORD_MAX_LENGTH) {
+ responseEntity.setMessage("updatedUserInfo.password is too Long");
+ return false;
+ }
+ // 変更後ユーザ情報.ユーザ名
+ if (StringUtils.length(requestEntity.getUpdatedUserInfo().getUserName()) > CommonConst.USER_NAME_MAX_LENGTH) {
+ responseEntity.setMessage("updatedUserInfo.userName is too Long");
+ return false;
+ }
+
+ // 管理者権限チェック
+ if (!this.commonService.isAdminUser(requestEntity.getUserInfo(), responseEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * ユーザ情報重複チェック
+ * @param requestEntity
+ * @return boolean
+ */
+ public boolean checkUserInfo(SettingUserRequestEntity requestEntity) {
+ UserMasterEntity userMasterEntity = new UserMasterEntity();
+ userMasterEntity.setUserid(requestEntity.getUpdatedUserInfo().getUserId());
+ userMasterEntity.setUsername(requestEntity.getUpdatedUserInfo().getUserName());
+ Integer hitCnt;
+ hitCnt = this.settingUserMapper.selectUserInfo(userMasterEntity);
+
+ if (hitCnt > 0) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * ユーザー情報登録.
+ * @param requestEntity
+ * @param responseEntity
+ * @return Boolean
+ */
+ public Boolean registUserInfo(SettingUserRequestEntity requestEntity, SettingUserResponseEntity responseEntity) {
+
+ try {
+ boolean iconUpdate = false;
+ if (StringUtils.isNotEmpty(requestEntity.getIconFile())) {
+ iconUpdate = true;
+ }
+
+ // 条件
+ UserMasterEntity condRec = new UserMasterEntity();
+ // 変更後ユーザを対象とする
+ condRec.setUserid(requestEntity.getUpdatedUserInfo().getUserId());
+
+ // 登録値
+ UserMasterEntity regRec = new UserMasterEntity();
+ regRec.setPassword(requestEntity.getUpdatedUserInfo().getPassword());
+ regRec.setUsername(requestEntity.getUpdatedUserInfo().getUserName());
+ if (iconUpdate) {
+ regRec.setIconid(requestEntity.getUpdatedUserInfo().getIconId());
+ // アイコン用にリサイズして保存
+ regRec.setIconfile(KdcCommonUtils.scaleImage(Base64.getDecoder().decode(requestEntity.getIconFile()),
+ CommonConst.ICON_WIDTH, CommonConst.ICON_HEIGHT, "png"));
+ }
+ regRec.setGroupid(requestEntity.getUpdatedUserInfo().getGroupId());
+ regRec.setAuthlevel(KdcCommonUtils.nullSafeParseInt(requestEntity.getUpdatedUserInfo().getAuthLevel()));
+ regRec.setLinecolor(requestEntity.getUpdatedUserInfo().getLineColor());
+ regRec.setMarkercolor(KdcCommonUtils.nullSafeParseInt(requestEntity.getUpdatedUserInfo().getMarkerColor()));
+ regRec.setUpdateuserid(requestEntity.getUserInfo().getUserId());
+ regRec.setUpdatedate(KdcCommonUtils.getNowTimestamp());
+
+ this.settingUserMapper.updateUserMaster(regRec, condRec);
+
+ if (iconUpdate) {
+ PushNotificationCounter counter = new PushNotificationCounter();
+ // アイコン登録通知(Push通知)送信
+ this.sendPushNotification(requestEntity.getUpdatedUserInfo(), counter);
+ responseEntity.setMessage("ユーザアイコン変更Push通知 OK:" + counter.getSendCompleteCnt() + " NG:"
+ + counter.getSendErrorCnt() + " TokenID未設定:" + counter.getSendExceptCnt());
+ }
+
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ /**
+ * アイコン登録Push通知.
+ * @param userInfo
+ * @param counter
+ */
+ private void sendPushNotification(UserInfoEntity userInfo, PushNotificationCounter counter) {
+ // アイコン変更したユーザの表示を行うユーザに通知する
+ List<PushNotificationEntity> notifyList = this.pushNotificationMapper
+ .selectSendIconTokenIdList(userInfo.getUserId(), true);
+ this.pushNotificationService.setApiKey();
+ this.pushNotificationService.sendAlert(ApiIdEnum.valueOf(CommonConst.API_ID_ADMIN_SETTING_USER),
+ PushNotificationEnum.USERICON, userInfo, notifyList, counter, logger);
+ logger.info("ユーザアイコン変更Push通知 OK:" + counter.getSendCompleteCnt() + " NG:" + counter.getSendErrorCnt()
+ + " TokenID未設定:" + counter.getSendExceptCnt());
+ for (String token : counter.getErrorTokenList()) {
+ logger.info("Send Error:" + token);
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/settinguser/SettingUserController.java
===================================================================
--- kdc/src/main/java/com/kdc/api/settinguser/SettingUserController.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/settinguser/SettingUserController.java (revision 2)
@@ -0,0 +1,82 @@
+package com.kdc.api.settinguser;
+
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+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 com.kdc.api.settinguser.SettingUserRequestEntity;
+import com.kdc.api.settinguser.SettingUserResponseEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * ユーザ情報変更 API Controller クラス
+ *
+ */
+@RestController
+@Transactional(rollbackFor = Exception.class)
+public class SettingUserController {
+
+ private static final Logger logger = LoggerFactory.getLogger(SettingUserController.class);
+
+ @Autowired
+ private SettingUserService settingUserService;
+
+ // ユーザ情報変更
+ @RequestMapping(path = CommonConst.API_BASE_URL
+ + "/setting/user", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
+ public SettingUserResponseEntity sendProfile(@RequestBody SettingUserRequestEntity requestEntity,
+ HttpServletResponse response) {
+
+ logger.info(KdcCommonUtils.getApiStartLog(ApiIdEnum.SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo()));
+
+ SettingUserResponseEntity responseEntity = new SettingUserResponseEntity();
+ responseEntity.setApiId(CommonConst.API_ID_SETTING_USER);
+
+ // パラメータチェック
+ if (!this.settingUserService.parameterCheck(requestEntity, responseEntity)) {
+ // HTTPステータスコードを"Bad Request(400)"に設定する。
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "parameterCheck"));
+ return responseEntity;
+ }
+
+ // 変更後ユーザ情報が設定されている場合、ユーザ情報の更新を行う
+ if (StringUtils.isNotEmpty(requestEntity.getUpdatedUserInfo().getUserId())) {
+ // ユーザ情報の重複チェック
+ if (!this.settingUserService.checkUserInfo(requestEntity)) {
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ responseEntity.setMessage("userName Duplicate");
+ responseEntity.setUserNameDuplicatedFlg(CommonConst.FLG_ON);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "checkUserInfo"));
+ return responseEntity;
+ }
+ // ユーザ情報更新
+ if (!this.settingUserService.registUserInfo(requestEntity, responseEntity)) {
+ // HTTPステータスコードを"Internal Server Error(500)"に設定する。
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ responseEntity.setResultCd(CommonConst.RESULT_CD_FAILED);
+ logger.info(KdcCommonUtils.getApiErrorLog(ApiIdEnum.SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), "registUserInfo"));
+ return responseEntity;
+ }
+ }
+ // レスポンス情報作成
+ responseEntity.setResultCd(CommonConst.RESULT_CD_SUCCESS);
+ logger.info(KdcCommonUtils.getApiEndLog(ApiIdEnum.SETTING_USER, requestEntity.getUserInfo(),
+ requestEntity.getDeviceInfo(), response.getStatus(), responseEntity.getResultCd()));
+ return responseEntity;
+ }
+}
Index: kdc/src/main/java/com/kdc/api/settinguser/SettingUserRequestEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/settinguser/SettingUserRequestEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/settinguser/SettingUserRequestEntity.java (revision 2)
@@ -0,0 +1,41 @@
+package com.kdc.api.settinguser;
+
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+
+public class SettingUserRequestEntity extends RequestBaseEntity {
+
+ private UserInfoEntity updatedUserInfo;
+ private String iconFile; // BASE64エンコード
+
+ /**
+ * @return updatedUserInfo
+ */
+ public UserInfoEntity getUpdatedUserInfo() {
+ return updatedUserInfo;
+ }
+
+ /**
+ * @param updatedUserInfo
+ * セットする updatedUserInfo
+ */
+ public void setUpdatedUserInfo(UserInfoEntity updatedUserInfo) {
+ this.updatedUserInfo = updatedUserInfo;
+ }
+
+ /**
+ * @return iconFile
+ */
+ public String getIconFile() {
+ return iconFile;
+ }
+
+ /**
+ * @param iconFile
+ * セットする iconFile
+ */
+ public void setIconFile(String iconFile) {
+ this.iconFile = iconFile;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/settinguser/SettingUserResponseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/api/settinguser/SettingUserResponseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/settinguser/SettingUserResponseEntity.java (revision 2)
@@ -0,0 +1,40 @@
+package com.kdc.api.settinguser;
+
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+
+public class SettingUserResponseEntity extends ResponseBaseEntity {
+
+ private Integer userNameDuplicatedFlg;
+ private Integer userColorDuplicatedFlg;
+
+ /**
+ * @return userNameDuplicatedFlg
+ */
+ public Integer getUserNameDuplicatedFlg() {
+ return userNameDuplicatedFlg;
+ }
+
+ /**
+ * @param userNameDuplicatedFlg
+ * セットする userNameDuplicatedFlg
+ */
+ public void setUserNameDuplicatedFlg(Integer userNameDuplicatedFlg) {
+ this.userNameDuplicatedFlg = userNameDuplicatedFlg;
+ }
+
+ /**
+ * @return userColorDuplicatedFlg
+ */
+ public Integer getUserColorDuplicatedFlg() {
+ return userColorDuplicatedFlg;
+ }
+
+ /**
+ * @param userColorDuplicatedFlg
+ * セットする userColorDuplicatedFlg
+ */
+ public void setUserColorDuplicatedFlg(Integer userColorDuplicatedFlg) {
+ this.userColorDuplicatedFlg = userColorDuplicatedFlg;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/api/settinguser/SettingUserService.java
===================================================================
--- kdc/src/main/java/com/kdc/api/settinguser/SettingUserService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/api/settinguser/SettingUserService.java (revision 2)
@@ -0,0 +1,176 @@
+package com.kdc.api.settinguser;
+
+import java.util.Base64;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.mybatis.mapper.api.SettingUserMapper;
+import com.kdc.mybatis.mapper.common.util.PushNotificationMapper;
+import com.kdc.common.entity.api.PushNotificationEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.enums.PushNotificationEnum;
+import com.kdc.common.util.CommonConst;
+import com.kdc.common.util.CommonService;
+import com.kdc.common.util.KdcCommonUtils;
+import com.kdc.common.util.PushNotificationCounter;
+import com.kdc.common.util.PushNotificationService;
+
+/**
+ * ユーザ情報変更 API Service クラス
+ *
+ */
+@Service
+public class SettingUserService {
+
+ private static final Logger logger = LoggerFactory.getLogger(SettingUserService.class);
+
+ @Autowired
+ private SettingUserMapper settingUserMapper;
+
+ @Autowired
+ private PushNotificationMapper pushNotificationMapper;
+
+ @Autowired
+ private CommonService commonService;
+
+ @Autowired
+ private PushNotificationService pushNotificationService;
+
+ /**
+ * パラメータチェック.
+ * @param requestEntity
+ * @param responseEntity
+ * @return Boolean
+ */
+ public Boolean parameterCheck(SettingUserRequestEntity requestEntity, SettingUserResponseEntity responseEntity) {
+
+ // 必須チェック
+ if (!this.commonService.checkBaseParameter(requestEntity, responseEntity)) {
+ return false;
+ }
+
+ // 変更後ユーザ情報
+ if (requestEntity.getUpdatedUserInfo() == null) {
+ responseEntity.setMessage("updatedUserInfo is Empty");
+ return false;
+ }
+ // 変更後ユーザ情報.ユーザID
+ if (StringUtils.isEmpty(requestEntity.getUpdatedUserInfo().getUserId())) {
+ responseEntity.setMessage("updatedUserInfo.userId is Empty");
+ return false;
+ }
+
+ // 変更後ユーザ情報.パスワード
+ if (StringUtils.length(requestEntity.getUpdatedUserInfo().getPassword()) > CommonConst.PASSWORD_MAX_LENGTH) {
+ responseEntity.setMessage("updatedUserInfo.password is too Long");
+ return false;
+ }
+ // 変更後ユーザ情報.ユーザ名
+ if (StringUtils.length(requestEntity.getUpdatedUserInfo().getUserName()) > CommonConst.USER_NAME_MAX_LENGTH) {
+ responseEntity.setMessage("updatedUserInfo.userName is too Long");
+ return false;
+ }
+
+ // ユーザ情報.ユーザIDと変更後ユーザ情報.ユーザIDが一致するか
+ if (!requestEntity.getUserInfo().getUserId().equals(requestEntity.getUpdatedUserInfo().getUserId())) {
+ responseEntity.setMessage("user-updatedUser Unmatch");
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * ユーザ情報重複チェック
+ * @param requestEntity
+ * @return boolean
+ */
+ public boolean checkUserInfo(SettingUserRequestEntity requestEntity) {
+ UserMasterEntity rec = new UserMasterEntity();
+ rec.setUserid(requestEntity.getUpdatedUserInfo().getUserId());
+ rec.setUsername(requestEntity.getUpdatedUserInfo().getUserName());
+ Integer userCnt = this.settingUserMapper.selectUserInfo(rec);
+
+ if (userCnt > 0) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * ユーザー情報登録.
+ * @param requestEntity
+ * @param responseEntity
+ * @return Boolean
+ */
+ public Boolean registUserInfo(SettingUserRequestEntity requestEntity, SettingUserResponseEntity responseEntity) {
+
+ try {
+ boolean iconUpdate = false;
+ if (StringUtils.isNotEmpty(requestEntity.getIconFile())) {
+ iconUpdate = true;
+ }
+
+ // 条件
+ UserMasterEntity condRec = new UserMasterEntity();
+ // 変更後ユーザを対象とする
+ condRec.setUserid(requestEntity.getUpdatedUserInfo().getUserId());
+
+ // 登録値
+ UserMasterEntity regRec = new UserMasterEntity();
+ regRec.setPassword(requestEntity.getUpdatedUserInfo().getPassword());
+ regRec.setUsername(requestEntity.getUpdatedUserInfo().getUserName());
+ if (iconUpdate) {
+ regRec.setIconid(requestEntity.getUpdatedUserInfo().getIconId());
+ // アイコン用にリサイズして保存
+ regRec.setIconfile(KdcCommonUtils.scaleImage(Base64.getDecoder().decode(requestEntity.getIconFile()),
+ CommonConst.ICON_WIDTH, CommonConst.ICON_HEIGHT, "png"));
+ }
+ regRec.setGroupid(requestEntity.getUpdatedUserInfo().getGroupId());
+ regRec.setAuthlevel(KdcCommonUtils.nullSafeParseInt(requestEntity.getUpdatedUserInfo().getAuthLevel()));
+ regRec.setLinecolor(requestEntity.getUpdatedUserInfo().getLineColor());
+ regRec.setMarkercolor(KdcCommonUtils.nullSafeParseInt(requestEntity.getUpdatedUserInfo().getMarkerColor()));
+ regRec.setUpdateuserid(requestEntity.getUserInfo().getUserId());
+ regRec.setUpdatedate(KdcCommonUtils.getNowTimestamp());
+
+ this.settingUserMapper.updateUserMaster(regRec, condRec);
+
+ if (iconUpdate) {
+ PushNotificationCounter counter = new PushNotificationCounter();
+ // アイコン登録通知(Push通知)送信
+ this.sendPushNotification(requestEntity.getUpdatedUserInfo(), counter);
+ responseEntity.setMessage("ユーザアイコン変更Push通知 OK:" + counter.getSendCompleteCnt() + " NG:"
+ + counter.getSendErrorCnt() + " TokenID未設定:" + counter.getSendExceptCnt());
+ }
+
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ /**
+ * アイコン登録Push通知.
+ * @param userInfo
+ * @param counter
+ */
+ private void sendPushNotification(UserInfoEntity userInfo, PushNotificationCounter counter) {
+ // アイコン変更したユーザの表示を行うユーザに通知する
+ List<PushNotificationEntity> notifyList = this.pushNotificationMapper
+ .selectSendIconTokenIdList(userInfo.getUserId(), true);
+ this.pushNotificationService.setApiKey();
+ this.pushNotificationService.sendAlert(ApiIdEnum.valueOf(CommonConst.API_ID_SETTING_USER),
+ PushNotificationEnum.USERICON, userInfo, notifyList, counter, logger);
+ logger.info("ユーザアイコン変更Push通知 OK:" + counter.getSendCompleteCnt() + " NG:" + counter.getSendErrorCnt()
+ + " TokenID未設定:" + counter.getSendExceptCnt());
+ for (String token : counter.getErrorTokenList()) {
+ logger.info("Send Error:" + token);
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/base/DeviceInfoCoreEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/base/DeviceInfoCoreEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/base/DeviceInfoCoreEntity.java (revision 2)
@@ -0,0 +1,46 @@
+package com.kdc.common.entity.api.base;
+
+public class DeviceInfoCoreEntity {
+
+ private String userId;
+ private String telephoneNumber;
+ private String deviceId;
+
+ /**
+ * @return userId
+ */
+ public String getUserId() {
+ return userId;
+ }
+ /**
+ * @param userId セットする userId
+ */
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ /**
+ * @return telephoneNumber
+ */
+ public String getTelephoneNumber() {
+ return telephoneNumber;
+ }
+ /**
+ * @param telephoneNumber セットする telephoneNumber
+ */
+ public void setTelephoneNumber(String telephoneNumber) {
+ this.telephoneNumber = telephoneNumber;
+ }
+ /**
+ * @return deviceId
+ */
+ public String getDeviceId() {
+ return deviceId;
+ }
+ /**
+ * @param deviceId セットする deviceId
+ */
+ public void setDeviceId(String deviceId) {
+ this.deviceId = deviceId;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/base/DeviceInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/base/DeviceInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/base/DeviceInfoEntity.java (revision 2)
@@ -0,0 +1,20 @@
+package com.kdc.common.entity.api.base;
+
+public class DeviceInfoEntity extends DeviceInfoCoreEntity {
+
+ private String tokenId;
+
+ /**
+ * @return tokenId
+ */
+ public String getTokenId() {
+ return tokenId;
+ }
+ /**
+ * @param tokenId セットする tokenId
+ */
+ public void setTokenId(String tokenId) {
+ this.tokenId = tokenId;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/base/RequestBaseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/base/RequestBaseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/base/RequestBaseEntity.java (revision 2)
@@ -0,0 +1,54 @@
+package com.kdc.common.entity.api.base;
+
+public class RequestBaseEntity {
+
+ private UserInfoEntity userInfo;
+ private DeviceInfoEntity deviceInfo;
+ private int forceLogin;
+
+ /**
+ * @return userInfo
+ */
+ public UserInfoEntity getUserInfo() {
+ return userInfo;
+ }
+
+ /**
+ * @param userInfo
+ * セットする userInfo
+ */
+ public void setUserInfo(UserInfoEntity userInfo) {
+ this.userInfo = userInfo;
+ }
+
+ /**
+ * @return deviceInfo
+ */
+ public DeviceInfoEntity getDeviceInfo() {
+ return deviceInfo;
+ }
+
+ /**
+ * @param deviceInfo
+ * セットする deviceInfo
+ */
+ public void setDeviceInfo(DeviceInfoEntity deviceInfo) {
+ this.deviceInfo = deviceInfo;
+ }
+
+ /**
+ * @return forceLogin
+ */
+ public int getForceLogin() {
+ return forceLogin;
+ }
+
+ /**
+ * @param forceLogin
+ * セットする forceLogin
+ */
+ public void setForceLogin(int forceLogin) {
+ this.forceLogin = forceLogin;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/base/ResponseBaseEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/base/ResponseBaseEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/base/ResponseBaseEntity.java (revision 2)
@@ -0,0 +1,54 @@
+package com.kdc.common.entity.api.base;
+
+public class ResponseBaseEntity {
+
+ private Integer apiId;
+ private Integer resultCd;
+ private String message;
+
+ /**
+ * @return apiId
+ */
+ public Integer getApiId() {
+ return apiId;
+ }
+
+ /**
+ * @param apiId
+ * セットする apiId
+ */
+ public void setApiId(Integer apiId) {
+ this.apiId = apiId;
+ }
+
+ /**
+ * @return resultCd
+ */
+ public Integer getResultCd() {
+ return resultCd;
+ }
+
+ /**
+ * @param resultCd
+ * セットする resultCd
+ */
+ public void setResultCd(Integer resultCd) {
+ this.resultCd = resultCd;
+ }
+
+ /**
+ * @return message
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * @param message
+ * セットする message
+ */
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/base/UserInfoCoreEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/base/UserInfoCoreEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/base/UserInfoCoreEntity.java (revision 2)
@@ -0,0 +1,59 @@
+package com.kdc.common.entity.api.base;
+
+public class UserInfoCoreEntity {
+
+ private String userId;
+ private String password;
+ private String groupId;
+ private String authLevel;
+
+ /**
+ * @return userId
+ */
+ public String getUserId() {
+ return userId;
+ }
+ /**
+ * @param userId セットする userId
+ */
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ /**
+ * @return password
+ */
+ public String getPassword() {
+ return password;
+ }
+ /**
+ * @param password セットする password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+ /**
+ * @return groupId
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+ /**
+ * @param groupId セットする groupId
+ */
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+ /**
+ * @return authLevel
+ */
+ public String getAuthLevel() {
+ return authLevel;
+ }
+ /**
+ * @param authLevel セットする authLevel
+ */
+ public void setAuthLevel(String authLevel) {
+ this.authLevel = authLevel;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/base/UserInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/base/UserInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/base/UserInfoEntity.java (revision 2)
@@ -0,0 +1,59 @@
+package com.kdc.common.entity.api.base;
+
+public class UserInfoEntity extends UserInfoCoreEntity {
+
+ private String userName;
+ private String iconId;
+ private String lineColor;
+ private String markerColor;
+
+ /**
+ * @return userName
+ */
+ public String getUserName() {
+ return userName;
+ }
+ /**
+ * @param userName セットする userName
+ */
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+ /**
+ * @return iconId
+ */
+ public String getIconId() {
+ return iconId;
+ }
+ /**
+ * @param iconId セットする iconId
+ */
+ public void setIconId(String iconId) {
+ this.iconId = iconId;
+ }
+ /**
+ * @return lineColor
+ */
+ public String getLineColor() {
+ return lineColor;
+ }
+ /**
+ * @param lineColor セットする lineColor
+ */
+ public void setLineColor(String lineColor) {
+ this.lineColor = lineColor;
+ }
+ /**
+ * @return markerColor
+ */
+ public String getMarkerColor() {
+ return markerColor;
+ }
+ /**
+ * @param markerColor セットする markerColor
+ */
+ public void setMarkerColor(String markerColor) {
+ this.markerColor = markerColor;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/LocationInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/LocationInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/LocationInfoEntity.java (revision 2)
@@ -0,0 +1,134 @@
+package com.kdc.common.entity.api;
+
+public class LocationInfoEntity {
+
+ private String dispOrder;
+ private String movingDistance;
+ private String latitude;
+ private String longitude;
+ private String batteryLevel;
+ private String receptionStatus;
+ private String connectionStatus;
+ private String lastLocationDate;
+
+ /**
+ * @return dispOrder
+ */
+ public String getDispOrder() {
+ return dispOrder;
+ }
+
+ /**
+ * @param dispOrder
+ * セットする dispOrder
+ */
+ public void setDispOrder(String dispOrder) {
+ this.dispOrder = dispOrder;
+ }
+
+ /**
+ * @return movingDistance
+ */
+ public String getMovingDistance() {
+ return movingDistance;
+ }
+
+ /**
+ * @param movingDistance
+ * セットする movingDistance
+ */
+ public void setMovingDistance(String movingDistance) {
+ this.movingDistance = movingDistance;
+ }
+
+ /**
+ * @return latitude
+ */
+ public String getLatitude() {
+ return latitude;
+ }
+
+ /**
+ * @param latitude
+ * セットする latitude
+ */
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
+
+ /**
+ * @return longitude
+ */
+ public String getLongitude() {
+ return longitude;
+ }
+
+ /**
+ * @param longitude
+ * セットする longitude
+ */
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
+
+ /**
+ * @return batteryLevel
+ */
+ public String getBatteryLevel() {
+ return batteryLevel;
+ }
+
+ /**
+ * @param batteryLevel
+ * セットする batteryLevel
+ */
+ public void setBatteryLevel(String batteryLevel) {
+ this.batteryLevel = batteryLevel;
+ }
+
+ /**
+ * @return receptionStatus
+ */
+ public String getReceptionStatus() {
+ return receptionStatus;
+ }
+
+ /**
+ * @param receptionStatus
+ * セットする receptionStatus
+ */
+ public void setReceptionStatus(String receptionStatus) {
+ this.receptionStatus = receptionStatus;
+ }
+
+ /**
+ * @return connectionStatus
+ */
+ public String getConnectionStatus() {
+ return connectionStatus;
+ }
+
+ /**
+ * @param connectionStatus
+ * セットする connectionStatus
+ */
+ public void setConnectionStatus(String connectionStatus) {
+ this.connectionStatus = connectionStatus;
+ }
+
+ /**
+ * @return lastLocationDate
+ */
+ public String getLastLocationDate() {
+ return lastLocationDate;
+ }
+
+ /**
+ * @param lastLocationDate
+ * セットする lastLocationDate
+ */
+ public void setLastLocationDate(String lastLocationDate) {
+ this.lastLocationDate = lastLocationDate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/LocationRecordInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/LocationRecordInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/LocationRecordInfoEntity.java (revision 2)
@@ -0,0 +1,86 @@
+package com.kdc.common.entity.api;
+
+public class LocationRecordInfoEntity {
+
+ private String recordDate;
+ private String latitude;
+ private String longitude;
+ private String batteryLevel;
+ private String receptionStatus;
+
+ /**
+ * @return recordDate
+ */
+ public String getRecordDate() {
+ return recordDate;
+ }
+
+ /**
+ * @param recordDate
+ * セットする recordDate
+ */
+ public void setRecordDate(String recordDate) {
+ this.recordDate = recordDate;
+ }
+
+ /**
+ * @return latitude
+ */
+ public String getLatitude() {
+ return latitude;
+ }
+
+ /**
+ * @param latitude
+ * セットする latitude
+ */
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
+
+ /**
+ * @return longitude
+ */
+ public String getLongitude() {
+ return longitude;
+ }
+
+ /**
+ * @param longitude
+ * セットする longitude
+ */
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
+
+ /**
+ * @return batteryLevel
+ */
+ public String getBatteryLevel() {
+ return batteryLevel;
+ }
+
+ /**
+ * @param batteryLevel
+ * セットする batteryLevel
+ */
+ public void setBatteryLevel(String batteryLevel) {
+ this.batteryLevel = batteryLevel;
+ }
+
+ /**
+ * @return receptionStatus
+ */
+ public String getReceptionStatus() {
+ return receptionStatus;
+ }
+
+ /**
+ * @param receptionStatus
+ * セットする receptionStatus
+ */
+ public void setReceptionStatus(String receptionStatus) {
+ this.receptionStatus = receptionStatus;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/PlaceDisplayConfigInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/PlaceDisplayConfigInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/PlaceDisplayConfigInfoEntity.java (revision 2)
@@ -0,0 +1,38 @@
+package com.kdc.common.entity.api;
+
+public class PlaceDisplayConfigInfoEntity {
+
+ private String authLevel;
+ private PlaceDisplayInfoEntity placeDisplayInfo;
+
+ /**
+ * @return authLevel
+ */
+ public String getAuthLevel() {
+ return authLevel;
+ }
+
+ /**
+ * @param authLevel
+ * セットする authLevel
+ */
+ public void setAuthLevel(String authLevel) {
+ this.authLevel = authLevel;
+ }
+
+ /**
+ * @return placeDisplayInfo
+ */
+ public PlaceDisplayInfoEntity getPlaceDisplayInfo() {
+ return placeDisplayInfo;
+ }
+
+ /**
+ * @param placeDisplayInfo
+ * セットする placeDisplayInfo
+ */
+ public void setPlaceDisplayInfo(PlaceDisplayInfoEntity placeDisplayInfo) {
+ this.placeDisplayInfo = placeDisplayInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/PlaceDisplayInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/PlaceDisplayInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/PlaceDisplayInfoEntity.java (revision 2)
@@ -0,0 +1,38 @@
+package com.kdc.common.entity.api;
+
+public class PlaceDisplayInfoEntity {
+
+ private String placeId;
+ private String placeDispFlg;
+
+ /**
+ * @return placeId
+ */
+ public String getPlaceId() {
+ return placeId;
+ }
+
+ /**
+ * @param placeId
+ * セットする placeId
+ */
+ public void setPlaceId(String placeId) {
+ this.placeId = placeId;
+ }
+
+ /**
+ * @return placeDispFlg
+ */
+ public String getPlaceDispFlg() {
+ return placeDispFlg;
+ }
+
+ /**
+ * @param placeDispFlg
+ * セットする placeDispFlg
+ */
+ public void setPlaceDispFlg(String placeDispFlg) {
+ this.placeDispFlg = placeDispFlg;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/PlaceInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/PlaceInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/PlaceInfoEntity.java (revision 2)
@@ -0,0 +1,134 @@
+package com.kdc.common.entity.api;
+
+public class PlaceInfoEntity {
+
+ private String placeId;
+ private String placeName;
+ private String placeTypeCd;
+ private String latitude;
+ private String longitude;
+ private String radius;
+ private String iconId;
+ private String dispFlg;
+
+ /**
+ * @return placeId
+ */
+ public String getPlaceId() {
+ return placeId;
+ }
+
+ /**
+ * @param placeId
+ * セットする placeId
+ */
+ public void setPlaceId(String placeId) {
+ this.placeId = placeId;
+ }
+
+ /**
+ * @return placeName
+ */
+ public String getPlaceName() {
+ return placeName;
+ }
+
+ /**
+ * @param placeName
+ * セットする placeName
+ */
+ public void setPlaceName(String placeName) {
+ this.placeName = placeName;
+ }
+
+ /**
+ * @return placeTypeCd
+ */
+ public String getPlaceTypeCd() {
+ return placeTypeCd;
+ }
+
+ /**
+ * @param placeTypeCd
+ * セットする placeTypeCd
+ */
+ public void setPlaceTypeCd(String placeTypeCd) {
+ this.placeTypeCd = placeTypeCd;
+ }
+
+ /**
+ * @return latitude
+ */
+ public String getLatitude() {
+ return latitude;
+ }
+
+ /**
+ * @param latitude
+ * セットする latitude
+ */
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
+
+ /**
+ * @return longitude
+ */
+ public String getLongitude() {
+ return longitude;
+ }
+
+ /**
+ * @param longitude
+ * セットする longitude
+ */
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
+
+ /**
+ * @return radius
+ */
+ public String getRadius() {
+ return radius;
+ }
+
+ /**
+ * @param radius
+ * セットする radius
+ */
+ public void setRadius(String radius) {
+ this.radius = radius;
+ }
+
+ /**
+ * @return iconId
+ */
+ public String getIconId() {
+ return iconId;
+ }
+
+ /**
+ * @param iconId
+ * セットする iconId
+ */
+ public void setIconId(String iconId) {
+ this.iconId = iconId;
+ }
+
+ /**
+ * @return dispFlg
+ */
+ public String getDispFlg() {
+ return dispFlg;
+ }
+
+ /**
+ * @param dispFlg
+ * セットする dispFlg
+ */
+ public void setDispFlg(String dispFlg) {
+ this.dispFlg = dispFlg;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/PlaceNotificationConfigInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/PlaceNotificationConfigInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/PlaceNotificationConfigInfoEntity.java (revision 2)
@@ -0,0 +1,56 @@
+package com.kdc.common.entity.api;
+
+import java.util.List;
+
+public class PlaceNotificationConfigInfoEntity {
+
+ private String authLevel;
+ private String notificationAuthLevel;
+ private List<PlaceNotificationInfoEntity> placeNotificationInfo;
+
+ /**
+ * @return authLevel
+ */
+ public String getAuthLevel() {
+ return authLevel;
+ }
+
+ /**
+ * @param authLevel
+ * セットする authLevel
+ */
+ public void setAuthLevel(String authLevel) {
+ this.authLevel = authLevel;
+ }
+
+ /**
+ * @return notificationAuthLevel
+ */
+ public String getNotificationAuthLevel() {
+ return notificationAuthLevel;
+ }
+
+ /**
+ * @param notificationAuthLevel
+ * セットする notificationAuthLevel
+ */
+ public void setNotificationAuthLevel(String notificationAuthLevel) {
+ this.notificationAuthLevel = notificationAuthLevel;
+ }
+
+ /**
+ * @return placeNotificationInfo
+ */
+ public List<PlaceNotificationInfoEntity> getPlaceNotificationInfo() {
+ return placeNotificationInfo;
+ }
+
+ /**
+ * @param placeNotificationInfo
+ * セットする placeNotificationInfo
+ */
+ public void setPlaceNotificationInfo(List<PlaceNotificationInfoEntity> placeNotificationInfo) {
+ this.placeNotificationInfo = placeNotificationInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/PlaceNotificationInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/PlaceNotificationInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/PlaceNotificationInfoEntity.java (revision 2)
@@ -0,0 +1,102 @@
+package com.kdc.common.entity.api;
+
+public class PlaceNotificationInfoEntity {
+
+ private String placeId;
+ private String placeAlertFlg;
+ private String placeNotification;
+ private String placePopup;
+ private String placeAlarmTime;
+ private String placeVibrationTime;
+
+ /**
+ * @return placeId
+ */
+ public String getPlaceId() {
+ return placeId;
+ }
+
+ /**
+ * @param placeId
+ * セットする placeId
+ */
+ public void setPlaceId(String placeId) {
+ this.placeId = placeId;
+ }
+
+ /**
+ * @return placeAlertFlg
+ */
+ public String getPlaceAlertFlg() {
+ return placeAlertFlg;
+ }
+
+ /**
+ * @param placeAlertFlg
+ * セットする placeAlertFlg
+ */
+ public void setPlaceAlertFlg(String placeAlertFlg) {
+ this.placeAlertFlg = placeAlertFlg;
+ }
+
+ /**
+ * @return placeNotification
+ */
+ public String getPlaceNotification() {
+ return placeNotification;
+ }
+
+ /**
+ * @param placeNotification
+ * セットする placeNotification
+ */
+ public void setPlaceNotification(String placeNotification) {
+ this.placeNotification = placeNotification;
+ }
+
+ /**
+ * @return placePopup
+ */
+ public String getPlacePopup() {
+ return placePopup;
+ }
+
+ /**
+ * @param placePopup
+ * セットする placePopup
+ */
+ public void setPlacePopup(String placePopup) {
+ this.placePopup = placePopup;
+ }
+
+ /**
+ * @return placeAlarmTime
+ */
+ public String getPlaceAlarmTime() {
+ return placeAlarmTime;
+ }
+
+ /**
+ * @param placeAlarmTime
+ * セットする placeAlarmTime
+ */
+ public void setPlaceAlarmTime(String placeAlarmTime) {
+ this.placeAlarmTime = placeAlarmTime;
+ }
+
+ /**
+ * @return placeVibrationTime
+ */
+ public String getPlaceVibrationTime() {
+ return placeVibrationTime;
+ }
+
+ /**
+ * @param placeVibrationTime
+ * セットする placeVibrationTime
+ */
+ public void setPlaceVibrationTime(String placeVibrationTime) {
+ this.placeVibrationTime = placeVibrationTime;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/PushNotificationEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/PushNotificationEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/PushNotificationEntity.java (revision 2)
@@ -0,0 +1,86 @@
+package com.kdc.common.entity.api;
+
+public class PushNotificationEntity {
+
+ private String tokenid;
+ private String notification;
+ private String popup;
+ private String alarmtime;
+ private String vibrationtime;
+
+ /**
+ * @return tokenid
+ */
+ public String getTokenid() {
+ return tokenid;
+ }
+
+ /**
+ * @param tokenid
+ * セットする tokenid
+ */
+ public void setTokenid(String tokenid) {
+ this.tokenid = tokenid;
+ }
+
+ /**
+ * @return notification
+ */
+ public String getNotification() {
+ return notification;
+ }
+
+ /**
+ * @param notification
+ * セットする notification
+ */
+ public void setNotification(String notification) {
+ this.notification = notification;
+ }
+
+ /**
+ * @return popup
+ */
+ public String getPopup() {
+ return popup;
+ }
+
+ /**
+ * @param popup
+ * セットする popup
+ */
+ public void setPopup(String popup) {
+ this.popup = popup;
+ }
+
+ /**
+ * @return alarmtime
+ */
+ public String getAlarmtime() {
+ return alarmtime;
+ }
+
+ /**
+ * @param alarmtime
+ * セットする alarmtime
+ */
+ public void setAlarmtime(String alarmtime) {
+ this.alarmtime = alarmtime;
+ }
+
+ /**
+ * @return vibrationtime
+ */
+ public String getVibrationtime() {
+ return vibrationtime;
+ }
+
+ /**
+ * @param vibrationtime
+ * セットする vibrationtime
+ */
+ public void setVibrationtime(String vibrationtime) {
+ this.vibrationtime = vibrationtime;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/TransmissionConfigInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/TransmissionConfigInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/TransmissionConfigInfoEntity.java (revision 2)
@@ -0,0 +1,101 @@
+package com.kdc.common.entity.api;
+
+public class TransmissionConfigInfoEntity {
+
+ private String authLevel;
+ private String dayOfWeek;
+ private String configNo;
+ private String startTime;
+ private String endTime;
+ private String interval;
+
+ /**
+ * @return authLevel
+ */
+ public String getAuthLevel() {
+ return authLevel;
+ }
+
+ /**
+ * @param authLevel
+ * セットする authLevel
+ */
+ public void setAuthLevel(String authLevel) {
+ this.authLevel = authLevel;
+ }
+
+ /**
+ * @return dayOfWeek
+ */
+ public String getDayOfWeek() {
+ return dayOfWeek;
+ }
+
+ /**
+ * @param dayOfWeek
+ * セットする dayOfWeek
+ */
+ public void setDayOfWeek(String dayOfWeek) {
+ this.dayOfWeek = dayOfWeek;
+ }
+
+ /**
+ * @return configNo
+ */
+ public String getConfigNo() {
+ return configNo;
+ }
+
+ /**
+ * @param configNo セットする configNo
+ */
+ public void setConfigNo(String configNo) {
+ this.configNo = configNo;
+ }
+
+ /**
+ * @return startTime
+ */
+ public String getStartTime() {
+ return startTime;
+ }
+
+ /**
+ * @param startTime
+ * セットする startTime
+ */
+ public void setStartTime(String startTime) {
+ this.startTime = startTime;
+ }
+
+ /**
+ * @return endTime
+ */
+ public String getEndTime() {
+ return endTime;
+ }
+
+ /**
+ * @param endTime
+ * セットする endTime
+ */
+ public void setEndTime(String endTime) {
+ this.endTime = endTime;
+ }
+
+ /**
+ * @return interval
+ */
+ public String getInterval() {
+ return interval;
+ }
+
+ /**
+ * @param interval
+ * セットする interval
+ */
+ public void setInterval(String interval) {
+ this.interval = interval;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/UpdateInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/UpdateInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/UpdateInfoEntity.java (revision 2)
@@ -0,0 +1,86 @@
+package com.kdc.common.entity.api;
+
+public class UpdateInfoEntity {
+
+ private Integer userUpdateFlg;
+ private Integer userNotificationUpdateFlg;
+ private Integer placeNotificationUpdateFlg;
+ private Integer transmissionUpdateFlg;
+ private Integer utilityUpdateFlg;
+
+ /**
+ * @return userUpdateFlg
+ */
+ public Integer getUserUpdateFlg() {
+ return userUpdateFlg;
+ }
+
+ /**
+ * @param userUpdateFlg
+ * セットする userUpdateFlg
+ */
+ public void setUserUpdateFlg(Integer userUpdateFlg) {
+ this.userUpdateFlg = userUpdateFlg;
+ }
+
+ /**
+ * @return userNotificationUpdateFlg
+ */
+ public Integer getUserNotificationUpdateFlg() {
+ return userNotificationUpdateFlg;
+ }
+
+ /**
+ * @param userNotificationUpdateFlg
+ * セットする userNotificationUpdateFlg
+ */
+ public void setUserNotificationUpdateFlg(Integer userNotificationUpdateFlg) {
+ this.userNotificationUpdateFlg = userNotificationUpdateFlg;
+ }
+
+ /**
+ * @return placeNotificationUpdateFlg
+ */
+ public Integer getPlaceNotificationUpdateFlg() {
+ return placeNotificationUpdateFlg;
+ }
+
+ /**
+ * @param placeNotificationUpdateFlg
+ * セットする placeNotificationUpdateFlg
+ */
+ public void setPlaceNotificationUpdateFlg(Integer placeNotificationUpdateFlg) {
+ this.placeNotificationUpdateFlg = placeNotificationUpdateFlg;
+ }
+
+ /**
+ * @return transmissionUpdateFlg
+ */
+ public Integer getTransmissionUpdateFlg() {
+ return transmissionUpdateFlg;
+ }
+
+ /**
+ * @param transmissionUpdateFlg
+ * セットする transmissionUpdateFlg
+ */
+ public void setTransmissionUpdateFlg(Integer transmissionUpdateFlg) {
+ this.transmissionUpdateFlg = transmissionUpdateFlg;
+ }
+
+ /**
+ * @return utilityUpdateFlg
+ */
+ public Integer getUtilityUpdateFlg() {
+ return utilityUpdateFlg;
+ }
+
+ /**
+ * @param utilityUpdateFlg
+ * セットする utilityUpdateFlg
+ */
+ public void setUtilityUpdateFlg(Integer utilityUpdateFlg) {
+ this.utilityUpdateFlg = utilityUpdateFlg;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/UserLocationInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/UserLocationInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/UserLocationInfoEntity.java (revision 2)
@@ -0,0 +1,58 @@
+package com.kdc.common.entity.api;
+
+import java.util.List;
+
+import com.kdc.common.entity.api.base.UserInfoEntity;
+
+public class UserLocationInfoEntity {
+
+ private UserInfoEntity userInfo;
+ private LocationInfoEntity locationInfo;
+ private List<LocationRecordInfoEntity> locationRecordInfo;
+
+ /**
+ * @return userInfo
+ */
+ public UserInfoEntity getUserInfo() {
+ return userInfo;
+ }
+
+ /**
+ * @param userInfo
+ * セットする userInfo
+ */
+ public void setUserInfo(UserInfoEntity userInfo) {
+ this.userInfo = userInfo;
+ }
+
+ /**
+ * @return locationInfo
+ */
+ public LocationInfoEntity getLocationInfo() {
+ return locationInfo;
+ }
+
+ /**
+ * @param locationInfo
+ * セットする locationInfo
+ */
+ public void setLocationInfo(LocationInfoEntity locationInfo) {
+ this.locationInfo = locationInfo;
+ }
+
+ /**
+ * @return locationRecordInfo
+ */
+ public List<LocationRecordInfoEntity> getLocationRecordInfo() {
+ return locationRecordInfo;
+ }
+
+ /**
+ * @param locationRecordInfo
+ * セットする locationRecordInfo
+ */
+ public void setLocationRecordInfo(List<LocationRecordInfoEntity> locationRecordInfo) {
+ this.locationRecordInfo = locationRecordInfo;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/UserNotificationConfigInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/UserNotificationConfigInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/UserNotificationConfigInfoEntity.java (revision 2)
@@ -0,0 +1,374 @@
+package com.kdc.common.entity.api;
+
+public class UserNotificationConfigInfoEntity {
+
+ private String authLevel;
+ private String notificationAuthLevel;
+ private String locationDisplayFlg;
+ private String movingDistanceDisplayFlg;
+ private String batteryLevelDisplayFlg;
+ private String accessTimeDisplayFlg;
+ private String receptionLevelDisplayFlg;
+ private String batterylevelAlertFlg;
+ private String batteryNotification;
+ private String batteryPopup;
+ private String batteryAlarmTime;
+ private String batteryVibrationTime;
+ private String batteryReference;
+ private String connectionAlertFlg;
+ private String connectionNotification;
+ private String connectionPopup;
+ private String connectionAlarmTime;
+ private String connectionVibrationTime;
+ private String sosAlertFlg;
+ private String sosNotification;
+ private String sosPopup;
+ private String sosAlarmTime;
+ private String sosVibrationTime;
+
+ /**
+ * @return authLevel
+ */
+ public String getAuthLevel() {
+ return authLevel;
+ }
+
+ /**
+ * @param authLevel
+ * セットする authLevel
+ */
+ public void setAuthLevel(String authLevel) {
+ this.authLevel = authLevel;
+ }
+
+ /**
+ * @return notificationAuthLevel
+ */
+ public String getNotificationAuthLevel() {
+ return notificationAuthLevel;
+ }
+
+ /**
+ * @param notificationAuthLevel
+ * セットする notificationAuthLevel
+ */
+ public void setNotificationAuthLevel(String notificationAuthLevel) {
+ this.notificationAuthLevel = notificationAuthLevel;
+ }
+
+ /**
+ * @return locationDisplayFlg
+ */
+ public String getLocationDisplayFlg() {
+ return locationDisplayFlg;
+ }
+
+ /**
+ * @param locationDisplayFlg
+ * セットする locationDisplayFlg
+ */
+ public void setLocationDisplayFlg(String locationDisplayFlg) {
+ this.locationDisplayFlg = locationDisplayFlg;
+ }
+
+ /**
+ * @return movingDistanceDisplayFlg
+ */
+ public String getMovingDistanceDisplayFlg() {
+ return movingDistanceDisplayFlg;
+ }
+
+ /**
+ * @param movingDistanceDisplayFlg
+ * セットする movingDistanceDisplayFlg
+ */
+ public void setMovingDistanceDisplayFlg(String movingDistanceDisplayFlg) {
+ this.movingDistanceDisplayFlg = movingDistanceDisplayFlg;
+ }
+
+ /**
+ * @return batteryLevelDisplayFlg
+ */
+ public String getBatteryLevelDisplayFlg() {
+ return batteryLevelDisplayFlg;
+ }
+
+ /**
+ * @param batteryLevelDisplayFlg
+ * セットする batteryLevelDisplayFlg
+ */
+ public void setBatteryLevelDisplayFlg(String batteryLevelDisplayFlg) {
+ this.batteryLevelDisplayFlg = batteryLevelDisplayFlg;
+ }
+
+ /**
+ * @return accessTimeDisplayFlg
+ */
+ public String getAccessTimeDisplayFlg() {
+ return accessTimeDisplayFlg;
+ }
+
+ /**
+ * @param accessTimeDisplayFlg
+ * セットする accessTimeDisplayFlg
+ */
+ public void setAccessTimeDisplayFlg(String accessTimeDisplayFlg) {
+ this.accessTimeDisplayFlg = accessTimeDisplayFlg;
+ }
+
+ /**
+ * @return receptionLevelDisplayFlg
+ */
+ public String getReceptionLevelDisplayFlg() {
+ return receptionLevelDisplayFlg;
+ }
+
+ /**
+ * @param receptionLevelDisplayFlg
+ * セットする receptionLevelDisplayFlg
+ */
+ public void setReceptionLevelDisplayFlg(String receptionLevelDisplayFlg) {
+ this.receptionLevelDisplayFlg = receptionLevelDisplayFlg;
+ }
+
+ /**
+ * @return batterylevelAlertFlg
+ */
+ public String getBatterylevelAlertFlg() {
+ return batterylevelAlertFlg;
+ }
+
+ /**
+ * @param batterylevelAlertFlg
+ * セットする batterylevelAlertFlg
+ */
+ public void setBatterylevelAlertFlg(String batterylevelAlertFlg) {
+ this.batterylevelAlertFlg = batterylevelAlertFlg;
+ }
+
+ /**
+ * @return batteryNotification
+ */
+ public String getBatteryNotification() {
+ return batteryNotification;
+ }
+
+ /**
+ * @param batteryNotification
+ * セットする batteryNotification
+ */
+ public void setBatteryNotification(String batteryNotification) {
+ this.batteryNotification = batteryNotification;
+ }
+
+ /**
+ * @return batteryPopup
+ */
+ public String getBatteryPopup() {
+ return batteryPopup;
+ }
+
+ /**
+ * @param batteryPopup
+ * セットする batteryPopup
+ */
+ public void setBatteryPopup(String batteryPopup) {
+ this.batteryPopup = batteryPopup;
+ }
+
+ /**
+ * @return batteryAlarmTime
+ */
+ public String getBatteryAlarmTime() {
+ return batteryAlarmTime;
+ }
+
+ /**
+ * @param batteryAlarmTime
+ * セットする batteryAlarmTime
+ */
+ public void setBatteryAlarmTime(String batteryAlarmTime) {
+ this.batteryAlarmTime = batteryAlarmTime;
+ }
+
+ /**
+ * @return batteryVibrationTime
+ */
+ public String getBatteryVibrationTime() {
+ return batteryVibrationTime;
+ }
+
+ /**
+ * @param batteryVibrationTime
+ * セットする batteryVibrationTime
+ */
+ public void setBatteryVibrationTime(String batteryVibrationTime) {
+ this.batteryVibrationTime = batteryVibrationTime;
+ }
+
+ /**
+ * @return batteryReference
+ */
+ public String getBatteryReference() {
+ return batteryReference;
+ }
+
+ /**
+ * @param batteryReference
+ * セットする batteryReference
+ */
+ public void setBatteryReference(String batteryReference) {
+ this.batteryReference = batteryReference;
+ }
+
+ /**
+ * @return connectionAlertFlg
+ */
+ public String getConnectionAlertFlg() {
+ return connectionAlertFlg;
+ }
+
+ /**
+ * @param connectionAlertFlg
+ * セットする connectionAlertFlg
+ */
+ public void setConnectionAlertFlg(String connectionAlertFlg) {
+ this.connectionAlertFlg = connectionAlertFlg;
+ }
+
+ /**
+ * @return connectionNotification
+ */
+ public String getConnectionNotification() {
+ return connectionNotification;
+ }
+
+ /**
+ * @param connectionNotification
+ * セットする connectionNotification
+ */
+ public void setConnectionNotification(String connectionNotification) {
+ this.connectionNotification = connectionNotification;
+ }
+
+ /**
+ * @return connectionPopup
+ */
+ public String getConnectionPopup() {
+ return connectionPopup;
+ }
+
+ /**
+ * @param connectionPopup
+ * セットする connectionPopup
+ */
+ public void setConnectionPopup(String connectionPopup) {
+ this.connectionPopup = connectionPopup;
+ }
+
+ /**
+ * @return connectionAlarmTime
+ */
+ public String getConnectionAlarmTime() {
+ return connectionAlarmTime;
+ }
+
+ /**
+ * @param connectionAlarmTime
+ * セットする connectionAlarmTime
+ */
+ public void setConnectionAlarmTime(String connectionAlarmTime) {
+ this.connectionAlarmTime = connectionAlarmTime;
+ }
+
+ /**
+ * @return connectionVibrationTime
+ */
+ public String getConnectionVibrationTime() {
+ return connectionVibrationTime;
+ }
+
+ /**
+ * @param connectionVibrationTime
+ * セットする connectionVibrationTime
+ */
+ public void setConnectionVibrationTime(String connectionVibrationTime) {
+ this.connectionVibrationTime = connectionVibrationTime;
+ }
+
+ /**
+ * @return sosAlertFlg
+ */
+ public String getSosAlertFlg() {
+ return sosAlertFlg;
+ }
+
+ /**
+ * @param sosAlertFlg
+ * セットする sosAlertFlg
+ */
+ public void setSosAlertFlg(String sosAlertFlg) {
+ this.sosAlertFlg = sosAlertFlg;
+ }
+
+ /**
+ * @return sosNotification
+ */
+ public String getSosNotification() {
+ return sosNotification;
+ }
+
+ /**
+ * @param sosNotification
+ * セットする sosNotification
+ */
+ public void setSosNotification(String sosNotification) {
+ this.sosNotification = sosNotification;
+ }
+
+ /**
+ * @return sosPopup
+ */
+ public String getSosPopup() {
+ return sosPopup;
+ }
+
+ /**
+ * @param sosPopup
+ * セットする sosPopup
+ */
+ public void setSosPopup(String sosPopup) {
+ this.sosPopup = sosPopup;
+ }
+
+ /**
+ * @return sosAlarmTime
+ */
+ public String getSosAlarmTime() {
+ return sosAlarmTime;
+ }
+
+ /**
+ * @param sosAlarmTime
+ * セットする sosAlarmTime
+ */
+ public void setSosAlarmTime(String sosAlarmTime) {
+ this.sosAlarmTime = sosAlarmTime;
+ }
+
+ /**
+ * @return sosVibrationTime
+ */
+ public String getSosVibrationTime() {
+ return sosVibrationTime;
+ }
+
+ /**
+ * @param sosVibrationTime
+ * セットする sosVibrationTime
+ */
+ public void setSosVibrationTime(String sosVibrationTime) {
+ this.sosVibrationTime = sosVibrationTime;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/api/UtilityConfigInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/api/UtilityConfigInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/api/UtilityConfigInfoEntity.java (revision 2)
@@ -0,0 +1,134 @@
+package com.kdc.common.entity.api;
+
+public class UtilityConfigInfoEntity {
+
+ private String configId;
+ private String configCode;
+ private String configName;
+ private String configParam1;
+ private String configParam2;
+ private String configParam3;
+ private String configParam4;
+ private String configParam5;
+
+ /**
+ * @return configId
+ */
+ public String getConfigId() {
+ return configId;
+ }
+
+ /**
+ * @param configId
+ * セットする configId
+ */
+ public void setConfigId(String configId) {
+ this.configId = configId;
+ }
+
+ /**
+ * @return configCode
+ */
+ public String getConfigCode() {
+ return configCode;
+ }
+
+ /**
+ * @param configCode
+ * セットする configCode
+ */
+ public void setConfigCode(String configCode) {
+ this.configCode = configCode;
+ }
+
+ /**
+ * @return configName
+ */
+ public String getConfigName() {
+ return configName;
+ }
+
+ /**
+ * @param configName
+ * セットする configName
+ */
+ public void setConfigName(String configName) {
+ this.configName = configName;
+ }
+
+ /**
+ * @return configParam1
+ */
+ public String getConfigParam1() {
+ return configParam1;
+ }
+
+ /**
+ * @param configParam1
+ * セットする configParam1
+ */
+ public void setConfigParam1(String configParam1) {
+ this.configParam1 = configParam1;
+ }
+
+ /**
+ * @return configParam2
+ */
+ public String getConfigParam2() {
+ return configParam2;
+ }
+
+ /**
+ * @param configParam2
+ * セットする configParam2
+ */
+ public void setConfigParam2(String configParam2) {
+ this.configParam2 = configParam2;
+ }
+
+ /**
+ * @return configParam3
+ */
+ public String getConfigParam3() {
+ return configParam3;
+ }
+
+ /**
+ * @param configParam3
+ * セットする configParam3
+ */
+ public void setConfigParam3(String configParam3) {
+ this.configParam3 = configParam3;
+ }
+
+ /**
+ * @return configParam4
+ */
+ public String getConfigParam4() {
+ return configParam4;
+ }
+
+ /**
+ * @param configParam4
+ * セットする configParam4
+ */
+ public void setConfigParam4(String configParam4) {
+ this.configParam4 = configParam4;
+ }
+
+ /**
+ * @return configParam5
+ */
+ public String getConfigParam5() {
+ return configParam5;
+ }
+
+ /**
+ * @param configParam5
+ * セットする configParam5
+ */
+ public void setConfigParam5(String configParam5) {
+ this.configParam5 = configParam5;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/AdministratorMasterEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/AdministratorMasterEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/AdministratorMasterEntity.java (revision 2)
@@ -0,0 +1,47 @@
+package com.kdc.common.entity.db;
+
+
+public class AdministratorMasterEntity extends CommonColumnsEntity {
+
+ private String administratorid;
+ private String administratorname;
+ private String password;
+
+ /**
+ * @return administratorid
+ */
+ public String getAdministratorid() {
+ return administratorid;
+ }
+ /**
+ * @param administratorid セットする administratorid
+ */
+ public void setAdministratorid(String administratorid) {
+ this.administratorid = administratorid;
+ }
+ /**
+ * @return administratorname
+ */
+ public String getAdministratorname() {
+ return administratorname;
+ }
+ /**
+ * @param administratorname セットする administratorname
+ */
+ public void setAdministratorname(String administratorname) {
+ this.administratorname = administratorname;
+ }
+ /**
+ * @return password
+ */
+ public String getPassword() {
+ return password;
+ }
+ /**
+ * @param password セットする password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/CommonColumnsEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/CommonColumnsEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/CommonColumnsEntity.java (revision 2)
@@ -0,0 +1,74 @@
+package com.kdc.common.entity.db;
+
+import java.sql.Timestamp;
+
+public class CommonColumnsEntity {
+
+ private int delflg;
+ private String registeruserid;
+ private Timestamp registerdate;
+ private String updateuserid;
+ private Timestamp updatedate;
+
+ /**
+ * @return delflg
+ */
+ public int getDelflg() {
+ return delflg;
+ }
+ /**
+ * @param delflg セットする delflg
+ */
+ public void setDelflg(int delflg) {
+ this.delflg = delflg;
+ }
+ /**
+ * @return registeruserid
+ */
+ public String getRegisteruserid() {
+ return registeruserid;
+ }
+ /**
+ * @param registeruserid セットする registeruserid
+ */
+ public void setRegisteruserid(String registeruserid) {
+ this.registeruserid = registeruserid;
+ }
+ /**
+ * @return registerdate
+ */
+ public Timestamp getRegisterdate() {
+ return registerdate;
+ }
+ /**
+ * @param registerdate セットする registerdate
+ */
+ public void setRegisterdate(Timestamp registerdate) {
+ this.registerdate = registerdate;
+ }
+ /**
+ * @return updateuserid
+ */
+ public String getUpdateuserid() {
+ return updateuserid;
+ }
+ /**
+ * @param updateuserid セットする updateuserid
+ */
+ public void setUpdateuserid(String updateuserid) {
+ this.updateuserid = updateuserid;
+ }
+ /**
+ * @return updatedate
+ */
+ public Timestamp getUpdatedate() {
+ return updatedate;
+ }
+ /**
+ * @param updatedate セットする updatedate
+ */
+ public void setUpdatedate(Timestamp updatedate) {
+ this.updatedate = updatedate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/ConfigMasterEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/ConfigMasterEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/ConfigMasterEntity.java (revision 2)
@@ -0,0 +1,118 @@
+package com.kdc.common.entity.db;
+
+public class ConfigMasterEntity extends CommonColumnsEntity {
+
+ private String groupid;
+ private Integer configid;
+ private Integer configcode;
+ private String configname;
+ private String configparam1;
+ private String configparam2;
+ private String configparam3;
+ private String configparam4;
+ private String configparam5;
+
+ /**
+ * @return configid
+ */
+ public Integer getConfigid() {
+ return configid;
+ }
+ /**
+ * @param configid セットする configid
+ */
+ public void setConfigid(Integer configid) {
+ this.configid = configid;
+ }
+ /**
+ * @return configcode
+ */
+ public Integer getConfigcode() {
+ return configcode;
+ }
+ /**
+ * @param configcode セットする configcode
+ */
+ public void setConfigcode(Integer configcode) {
+ this.configcode = configcode;
+ }
+ /**
+ * @return configname
+ */
+ public String getConfigname() {
+ return configname;
+ }
+ /**
+ * @param configname セットする configname
+ */
+ public void setConfigname(String configname) {
+ this.configname = configname;
+ }
+ /**
+ * @return configparam1
+ */
+ public String getConfigparam1() {
+ return configparam1;
+ }
+ /**
+ * @param configparam1 セットする configparam1
+ */
+ public void setConfigparam1(String configparam1) {
+ this.configparam1 = configparam1;
+ }
+ /**
+ * @return configparam2
+ */
+ public String getConfigparam2() {
+ return configparam2;
+ }
+ /**
+ * @param configparam2 セットする configparam2
+ */
+ public void setConfigparam2(String configparam2) {
+ this.configparam2 = configparam2;
+ }
+ /**
+ * @return configparam3
+ */
+ public String getConfigparam3() {
+ return configparam3;
+ }
+ /**
+ * @param configparam3 セットする configparam3
+ */
+ public void setConfigparam3(String configparam3) {
+ this.configparam3 = configparam3;
+ }
+ /**
+ * @return configparam4
+ */
+ public String getConfigparam4() {
+ return configparam4;
+ }
+ /**
+ * @param configparam4 セットする configparam4
+ */
+ public void setConfigparam4(String configparam4) {
+ this.configparam4 = configparam4;
+ }
+ /**
+ * @return configparam5
+ */
+ public String getConfigparam5() {
+ return configparam5;
+ }
+ /**
+ * @param configparam5 セットする configparam5
+ */
+ public void setConfigparam5(String configparam5) {
+ this.configparam5 = configparam5;
+ }
+ public String getGroupid() {
+ return groupid;
+ }
+ public void setGroupid(String groupid) {
+ this.groupid = groupid;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/GroupInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/GroupInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/GroupInfoEntity.java (revision 2)
@@ -0,0 +1,112 @@
+package com.kdc.common.entity.db;
+
+public class GroupInfoEntity extends CommonColumnsEntity {
+
+ private String groupid;
+ private String groupname;
+ private String configparam1;
+ private String configparam2;
+ private String configparam3;
+ private String configparam4;
+ private String configparam5;
+
+
+ /**
+ * @return groupid
+ */
+ public String getGroupid() {
+ return groupid;
+ }
+
+ /**
+ * @param groupid セットする groupid
+ */
+ public void setGroupid(String groupid) {
+ this.groupid = groupid;
+ }
+
+ /**
+ * @return groupname
+ */
+ public String getGroupname() {
+ return groupname;
+ }
+
+ /**
+ * @param groupname セットする groupname
+ */
+ public void setGroupname(String groupname) {
+ this.groupname = groupname;
+ }
+
+ /**
+ * @return configparam1
+ */
+ public String getConfigparam1() {
+ return configparam1;
+ }
+
+ /**
+ * @param configparam1 セットする configparam1
+ */
+ public void setConfigparam1(String configparam1) {
+ this.configparam1 = configparam1;
+ }
+
+ /**
+ * @return configparam2
+ */
+ public String getConfigparam2() {
+ return configparam2;
+ }
+
+ /**
+ * @param configparam2セットする configparam2
+ */
+ public void setConfigparam2(String configparam2) {
+ this.configparam2 = configparam2;
+ }
+
+ /**
+ * @return configparam3
+ */
+ public String getConfigparam3() {
+ return configparam3;
+ }
+
+ /**
+ * @param configparam3セットする configparam3
+ */
+ public void setConfigparam3(String configparam3) {
+ this.configparam3 = configparam3;
+ }
+
+ /**
+ * @return configparam4
+ */
+ public String getConfigparam4() {
+ return configparam4;
+ }
+
+ /**
+ * @param configparam4 セットする configparam4
+ */
+ public void setConfigparam4(String configparam4) {
+ this.configparam4 = configparam4;
+ }
+
+ /**
+ * @return configparam5
+ */
+ public String getConfigparam5() {
+ return configparam5;
+ }
+
+ /**
+ * @param configparam5 セットする configparam5
+ */
+ public void setConfigparam5(String configparam5) {
+ this.configparam5 = configparam5;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/InvitationManagementEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/InvitationManagementEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/InvitationManagementEntity.java (revision 2)
@@ -0,0 +1,113 @@
+package com.kdc.common.entity.db;
+
+import java.sql.Timestamp;
+
+public class InvitationManagementEntity extends CommonColumnsEntity {
+
+ private String invitationcode;
+ private String owneruserid;
+ private String guestuserid;
+ private String guesttelephonenumber;
+ private String groupid;
+ private Integer authlevel;
+ private Timestamp expirationdate;
+ private Integer usedflg;
+
+ /**
+ * @return invitationcode
+ */
+ public String getInvitationcode() {
+ return invitationcode;
+ }
+ /**
+ * @param invitationcode セットする invitationcode
+ */
+ public void setInvitationcode(String invitationcode) {
+ this.invitationcode = invitationcode;
+ }
+ /**
+ * @return owneruserid
+ */
+ public String getOwneruserid() {
+ return owneruserid;
+ }
+ /**
+ * @param owneruserid セットする owneruserid
+ */
+ public void setOwneruserid(String owneruserid) {
+ this.owneruserid = owneruserid;
+ }
+ /**
+ * @return guestuserid
+ */
+ public String getGuestuserid() {
+ return guestuserid;
+ }
+ /**
+ * @param guestuserid セットする guestuserid
+ */
+ public void setGuestuserid(String guestuserid) {
+ this.guestuserid = guestuserid;
+ }
+ /**
+ * @return guesttelephonenumber
+ */
+ public String getGuesttelephonenumber() {
+ return guesttelephonenumber;
+ }
+ /**
+ * @param guesttelephonenumber セットする guesttelephonenumber
+ */
+ public void setGuesttelephonenumber(String guesttelephonenumber) {
+ this.guesttelephonenumber = guesttelephonenumber;
+ }
+ /**
+ * @return groupid
+ */
+ public String getGroupid() {
+ return groupid;
+ }
+ /**
+ * @param groupid セットする groupid
+ */
+ public void setGroupid(String groupid) {
+ this.groupid = groupid;
+ }
+ /**
+ * @return authlevel
+ */
+ public Integer getAuthlevel() {
+ return authlevel;
+ }
+ /**
+ * @param authlevel セットする authlevel
+ */
+ public void setAuthlevel(Integer authlevel) {
+ this.authlevel = authlevel;
+ }
+ /**
+ * @return expirationdate
+ */
+ public Timestamp getExpirationdate() {
+ return expirationdate;
+ }
+ /**
+ * @param expirationdate セットする expirationdate
+ */
+ public void setExpirationdate(Timestamp expirationdate) {
+ this.expirationdate = expirationdate;
+ }
+ /**
+ * @return usedflg
+ */
+ public Integer getUsedflg() {
+ return usedflg;
+ }
+ /**
+ * @param usedflg セットする usedflg
+ */
+ public void setUsedflg(Integer usedflg) {
+ this.usedflg = usedflg;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/NotificationInfoEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/NotificationInfoEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/NotificationInfoEntity.java (revision 2)
@@ -0,0 +1,120 @@
+package com.kdc.common.entity.db;
+
+public class NotificationInfoEntity extends CommonColumnsEntity{
+
+ //グループID
+ private String groupId;
+ //ユーザーID
+ private String userId;
+ //通知日
+ private String notificationDate;
+ //通知時間
+ private String notificationTime;
+ //管理レベル
+ private Integer authLevel;
+ //通知先管理レベル
+ private Integer notificationLevel;
+ //通知フラグ
+ private Integer notificationFlg;
+ //メッセージ
+ private String message;
+ /**
+ * @return groupId
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+ /**
+ * @param groupId セットする groupId
+ */
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+ /**
+ * @return userId
+ */
+ public String getUserId() {
+ return userId;
+ }
+ /**
+ * @param userId セットする userId
+ */
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ /**
+ * @return notificationDate
+ */
+ public String getNotificationDate() {
+ return notificationDate;
+ }
+ /**
+ * @param notificationDate セットする notificationDate
+ */
+ public void setNotificationDate(String notificationDate) {
+ this.notificationDate = notificationDate;
+ }
+ /**
+ * @return notificationTime
+ */
+ public String getNotificationTime() {
+ return notificationTime;
+ }
+ /**
+ * @param notificationTime セットする notificationTime
+ */
+ public void setNotificationTime(String notificationTime) {
+ this.notificationTime = notificationTime;
+ }
+ /**
+ * @return authLevel
+ */
+ public Integer getAuthLevel() {
+ return authLevel;
+ }
+ /**
+ * @param authLevel セットする authLevel
+ */
+ public void setAuthLevel(Integer authLevel) {
+ this.authLevel = authLevel;
+ }
+ /**
+ * @return notificationLevel
+ */
+ public Integer getNotificationLevel() {
+ return notificationLevel;
+ }
+ /**
+ * @param notificationLevel セットする notificationLevel
+ */
+ public void setNotificationLevel(Integer notificationLevel) {
+ this.notificationLevel = notificationLevel;
+ }
+ /**
+ * @return notificationFlg
+ */
+ public Integer getNotificationFlg() {
+ return notificationFlg;
+ }
+ /**
+ * @param notificationFlg セットする notificationFlg
+ */
+ public void setNotificationFlg(Integer notificationFlg) {
+ this.notificationFlg = notificationFlg;
+ }
+ /**
+ * @return message
+ */
+ public String getMessage() {
+ return message;
+ }
+ /**
+ * @param message セットする message
+ */
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
+
+
Index: kdc/src/main/java/com/kdc/common/entity/db/PlaceAlertConfigEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/PlaceAlertConfigEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/PlaceAlertConfigEntity.java (revision 2)
@@ -0,0 +1,118 @@
+package com.kdc.common.entity.db;
+
+public class PlaceAlertConfigEntity extends CommonColumnsEntity {
+
+ private String groupid;
+ private Integer authlevel;
+ private Integer notificationauthlevel;
+ private String placeid;
+ private Integer placealertflg;
+ private Integer placenotification;
+ private Integer placepopup;
+ private Integer placealarmtime;
+ private Integer placevibrationtime;
+
+ /**
+ * @return authlevel
+ */
+ public Integer getAuthlevel() {
+ return authlevel;
+ }
+ /**
+ * @param authlevel セットする authlevel
+ */
+ public void setAuthlevel(Integer authlevel) {
+ this.authlevel = authlevel;
+ }
+ /**
+ * @return notificationauthlevel
+ */
+ public Integer getNotificationauthlevel() {
+ return notificationauthlevel;
+ }
+ /**
+ * @param notificationauthlevel セットする notificationauthlevel
+ */
+ public void setNotificationauthlevel(Integer notificationauthlevel) {
+ this.notificationauthlevel = notificationauthlevel;
+ }
+ /**
+ * @return placeid
+ */
+ public String getPlaceid() {
+ return placeid;
+ }
+ /**
+ * @param placeid セットする placeid
+ */
+ public void setPlaceid(String placeid) {
+ this.placeid = placeid;
+ }
+ /**
+ * @return placealertflg
+ */
+ public Integer getPlacealertflg() {
+ return placealertflg;
+ }
+ /**
+ * @param placealertflg セットする placealertflg
+ */
+ public void setPlacealertflg(Integer placealertflg) {
+ this.placealertflg = placealertflg;
+ }
+ /**
+ * @return placenotification
+ */
+ public Integer getPlacenotification() {
+ return placenotification;
+ }
+ /**
+ * @param placenotification セットする placenotification
+ */
+ public void setPlacenotification(Integer placenotification) {
+ this.placenotification = placenotification;
+ }
+ /**
+ * @return placepopup
+ */
+ public Integer getPlacepopup() {
+ return placepopup;
+ }
+ /**
+ * @param placepopup セットする placepopup
+ */
+ public void setPlacepopup(Integer placepopup) {
+ this.placepopup = placepopup;
+ }
+ /**
+ * @return placealarmtime
+ */
+ public Integer getPlacealarmtime() {
+ return placealarmtime;
+ }
+ /**
+ * @param placealarmtime セットする placealarmtime
+ */
+ public void setPlacealarmtime(Integer placealarmtime) {
+ this.placealarmtime = placealarmtime;
+ }
+ /**
+ * @return placevibrationtime
+ */
+ public Integer getPlacevibrationtime() {
+ return placevibrationtime;
+ }
+ /**
+ * @param placevibrationtime セットする placevibrationtime
+ */
+ public void setPlacevibrationtime(Integer placevibrationtime) {
+ this.placevibrationtime = placevibrationtime;
+ }
+
+ public String getGroupid() {
+ return groupid;
+ }
+ public void setGroupid(String groupid) {
+ this.groupid = groupid;
+ }
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/PlaceAlertRecordEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/PlaceAlertRecordEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/PlaceAlertRecordEntity.java (revision 2)
@@ -0,0 +1,61 @@
+package com.kdc.common.entity.db;
+
+import java.sql.Timestamp;
+
+public class PlaceAlertRecordEntity extends CommonColumnsEntity {
+
+ private String userid;
+ private String placeid;
+ private Timestamp lastplaceinalertdate;
+ private Timestamp lastplaceoutalertdate;
+
+ /**
+ * @return userid
+ */
+ public String getUserid() {
+ return userid;
+ }
+ /**
+ * @param userid セットする userid
+ */
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+ /**
+ * @return placeid
+ */
+ public String getPlaceid() {
+ return placeid;
+ }
+ /**
+ * @param placeid セットする placeid
+ */
+ public void setPlaceid(String placeid) {
+ this.placeid = placeid;
+ }
+ /**
+ * @return lastplaceinalertdate
+ */
+ public Timestamp getLastplaceinalertdate() {
+ return lastplaceinalertdate;
+ }
+ /**
+ * @param lastplaceinalertdate セットする lastplaceinalertdate
+ */
+ public void setLastplaceinalertdate(Timestamp lastplaceinalertdate) {
+ this.lastplaceinalertdate = lastplaceinalertdate;
+ }
+ /**
+ * @return lastplaceoutalertdate
+ */
+ public Timestamp getLastplaceoutalertdate() {
+ return lastplaceoutalertdate;
+ }
+ /**
+ * @param lastplaceoutalertdate セットする lastplaceoutalertdate
+ */
+ public void setLastplaceoutalertdate(Timestamp lastplaceoutalertdate) {
+ this.lastplaceoutalertdate = lastplaceoutalertdate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/PlaceDisplayConfigEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/PlaceDisplayConfigEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/PlaceDisplayConfigEntity.java (revision 2)
@@ -0,0 +1,46 @@
+package com.kdc.common.entity.db;
+
+public class PlaceDisplayConfigEntity extends CommonColumnsEntity {
+
+ private Integer authlevel;
+ private String placeid;
+ private Integer placedispflg;
+
+ /**
+ * @return authlevel
+ */
+ public Integer getAuthlevel() {
+ return authlevel;
+ }
+ /**
+ * @param authlevel セットする authlevel
+ */
+ public void setAuthlevel(Integer authlevel) {
+ this.authlevel = authlevel;
+ }
+ /**
+ * @return placeid
+ */
+ public String getPlaceid() {
+ return placeid;
+ }
+ /**
+ * @param placeid セットする placeid
+ */
+ public void setPlaceid(String placeid) {
+ this.placeid = placeid;
+ }
+ /**
+ * @return placedispflg
+ */
+ public Integer getPlacedispflg() {
+ return placedispflg;
+ }
+ /**
+ * @param placedispflg セットする placedispflg
+ */
+ public void setPlacedispflg(Integer placedispflg) {
+ this.placedispflg = placedispflg;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/PlaceMasterEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/PlaceMasterEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/PlaceMasterEntity.java (revision 2)
@@ -0,0 +1,100 @@
+package com.kdc.common.entity.db;
+
+public class PlaceMasterEntity extends CommonColumnsEntity {
+
+ private String groupid;
+ private String placeid;
+ private String placename;
+ private Integer placetypeflg;
+ private String longitudeandlatitude;
+ private Integer radius;
+ private String iconid;
+
+ /**
+ * @return groupid
+ */
+ public String getGroupid() {
+ return groupid;
+ }
+
+ /**
+ * @param groupid セットする groupid
+ */
+ public void setGroupid(String groupid) {
+ this.groupid = groupid;
+ }
+
+ /**
+ * @return placeid
+ */
+ public String getPlaceid() {
+ return placeid;
+ }
+ /**
+ * @param placeid セットする placeid
+ */
+ public void setPlaceid(String placeid) {
+ this.placeid = placeid;
+ }
+ /**
+ * @return placename
+ */
+ public String getPlacename() {
+ return placename;
+ }
+ /**
+ * @param placename セットする placename
+ */
+ public void setPlacename(String placename) {
+ this.placename = placename;
+ }
+ /**
+ * @return placetypeflg
+ */
+ public Integer getPlacetypeflg() {
+ return placetypeflg;
+ }
+ /**
+ * @param placetypeflg セットする placetypeflg
+ */
+ public void setPlacetypeflg(Integer placetypeflg) {
+ this.placetypeflg = placetypeflg;
+ }
+ /**
+ * @return longitudeandlatitude
+ */
+ public String getLongitudeandlatitude() {
+ return longitudeandlatitude;
+ }
+ /**
+ * @param longitudeandlatitude セットする longitudeandlatitude
+ */
+ public void setLongitudeandlatitude(String longitudeandlatitude) {
+ this.longitudeandlatitude = longitudeandlatitude;
+ }
+ /**
+ * @return radius
+ */
+ public Integer getRadius() {
+ return radius;
+ }
+ /**
+ * @param radius セットする radius
+ */
+ public void setRadius(Integer radius) {
+ this.radius = radius;
+ }
+ /**
+ * @return iconid
+ */
+ public String getIconid() {
+ return iconid;
+ }
+ /**
+ * @param iconid セットする iconid
+ */
+ public void setIconid(String iconid) {
+ this.iconid = iconid;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/PlaceMasterEntityWrapper.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/PlaceMasterEntityWrapper.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/PlaceMasterEntityWrapper.java (revision 2)
@@ -0,0 +1,76 @@
+package com.kdc.common.entity.db;
+
+import java.math.BigDecimal;
+
+import org.apache.commons.lang3.StringUtils;
+
+public class PlaceMasterEntityWrapper extends PlaceMasterEntity {
+
+ private BigDecimal latitude;
+ private BigDecimal longitude;
+
+ /**
+ * @return latitude
+ */
+ public BigDecimal getLatitude() {
+ return latitude;
+ }
+ /**
+ * @param latitude セットする latitude
+ */
+ public void setLatitude(BigDecimal latitude) {
+ this.latitude = latitude;
+ }
+ /**
+ * @param latitude セットする latitude
+ */
+ public void setLatitude(String latitude) {
+ this.latitude = new BigDecimal(latitude);
+ }
+ /**
+ * @return longitude
+ */
+ public BigDecimal getLongitude() {
+ return longitude;
+ }
+ /**
+ * @param longitude セットする longitude
+ */
+ public void setLongitude(BigDecimal longitude) {
+ this.longitude = longitude;
+ }
+ /**
+ * @param longitude セットする longitude
+ */
+ public void setLongitude(String longitude) {
+ this.longitude = new BigDecimal(longitude);
+ }
+ /**
+ * @return longitudeandlatitude
+ */
+ @Deprecated
+ public String getLongitudeandlatitude() {
+ return String.format("(%s,%s)", this.latitude, this.longitude);
+ }
+ /**
+ * @param latitude セットする latitude
+ * @param longitude セットする longitude
+ */
+ public void setLongitudeandlatitude(BigDecimal latitude, BigDecimal longitude) {
+ this.latitude = latitude;
+ this.longitude = longitude;
+ }
+ /**
+ * @param longitudeandlatitude セットする longitudeandlatitude
+ */
+ @Deprecated
+ public void setLongitudeandlatitude(String longitudeandlatitude) {
+ super.setLongitudeandlatitude(longitudeandlatitude);
+ longitudeandlatitude = StringUtils.remove(longitudeandlatitude, '(');
+ longitudeandlatitude = StringUtils.remove(longitudeandlatitude, ')');
+ String temp[] = longitudeandlatitude.split(",");
+ this.latitude = new BigDecimal(temp[0]);
+ this.longitude = new BigDecimal(temp[1]);
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/SendIntervalConfigEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/SendIntervalConfigEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/SendIntervalConfigEntity.java (revision 2)
@@ -0,0 +1,107 @@
+package com.kdc.common.entity.db;
+
+import java.sql.Time;
+
+public class SendIntervalConfigEntity extends CommonColumnsEntity {
+
+ private String groupid;
+ private Integer authlevel;
+ private Integer dayofweek;
+ private Integer configno;
+ private Integer usingflag;
+ private Time starttime;
+ private Time endtime;
+ private Integer transmissioninterval;
+
+ /**
+ * @return authlevel
+ */
+ public Integer getAuthlevel() {
+ return authlevel;
+ }
+ /**
+ * @param authlevel セットする authlevel
+ */
+ public void setAuthlevel(Integer authlevel) {
+ this.authlevel = authlevel;
+ }
+ /**
+ * @return dayofweek
+ */
+ public Integer getDayofweek() {
+ return dayofweek;
+ }
+ /**
+ * @param dayofweek セットする dayofweek
+ */
+ public void setDayofweek(Integer dayofweek) {
+ this.dayofweek = dayofweek;
+ }
+ /**
+ * @return configno
+ */
+ public Integer getConfigno() {
+ return configno;
+ }
+ /**
+ * @param configno セットする configno
+ */
+ public void setConfigno(Integer configno) {
+ this.configno = configno;
+ }
+ /**
+ * @return usingflag
+ */
+ public Integer getUsingflag() {
+ return usingflag;
+ }
+ /**
+ * @param usingflag セットする usingflag
+ */
+ public void setUsingflag(Integer usingflag) {
+ this.usingflag = usingflag;
+ }
+ /**
+ * @return starttime
+ */
+ public Time getStarttime() {
+ return starttime;
+ }
+ /**
+ * @param starttime セットする starttime
+ */
+ public void setStarttime(Time starttime) {
+ this.starttime = starttime;
+ }
+ /**
+ * @return endtime
+ */
+ public Time getEndtime() {
+ return endtime;
+ }
+ /**
+ * @param endtime セットする endtime
+ */
+ public void setEndtime(Time endtime) {
+ this.endtime = endtime;
+ }
+ /**
+ * @return transmissioninterval
+ */
+ public Integer getTransmissioninterval() {
+ return transmissioninterval;
+ }
+ /**
+ * @param transmissioninterval セットする transmissioninterval
+ */
+ public void setTransmissioninterval(Integer transmissioninterval) {
+ this.transmissioninterval = transmissioninterval;
+ }
+ public String getGroupid() {
+ return groupid;
+ }
+ public void setGroupid(String groupid) {
+ this.groupid = groupid;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/UserAlertConfigEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/UserAlertConfigEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/UserAlertConfigEntity.java (revision 2)
@@ -0,0 +1,312 @@
+package com.kdc.common.entity.db;
+
+public class UserAlertConfigEntity extends CommonColumnsEntity {
+
+ private String groupid;
+ private Integer authlevel;
+ private Integer notificationauthlevel;
+ private Integer locationdisplayflg;
+ private Integer movingdistancedisplayflg;
+ private Integer batteryleveldisplayflg;
+ private Integer accesstimedisplayflg;
+ private Integer receptionstatusdisplayflg;
+ private Integer batterylevelalertflg;
+ private Integer batterynotification;
+ private Integer batterypopup;
+ private Integer batteryalarmtime;
+ private Integer batteryvibrationtime;
+ private Integer batteryreference;
+ private Integer connectionalertflg;
+ private Integer connectionnotification;
+ private Integer connectionpopup;
+ private Integer connectionalarmtime;
+ private Integer connectionvibrationtime;
+ private Integer sosalertflg;
+ private Integer sosnotification;
+ private Integer sospopup;
+ private Integer sosalarmtime;
+ private Integer sosvibrationtime;
+
+ /**
+ * @return authlevel
+ */
+ public Integer getAuthlevel() {
+ return authlevel;
+ }
+ /**
+ * @param authlevel セットする authlevel
+ */
+ public void setAuthlevel(Integer authlevel) {
+ this.authlevel = authlevel;
+ }
+ /**
+ * @return notificationauthlevel
+ */
+ public Integer getNotificationauthlevel() {
+ return notificationauthlevel;
+ }
+ /**
+ * @param notificationauthlevel セットする notificationauthlevel
+ */
+ public void setNotificationauthlevel(Integer notificationauthlevel) {
+ this.notificationauthlevel = notificationauthlevel;
+ }
+ /**
+ * @return locationdisplayflg
+ */
+ public Integer getLocationdisplayflg() {
+ return locationdisplayflg;
+ }
+ /**
+ * @param locationdisplayflg セットする locationdisplayflg
+ */
+ public void setLocationdisplayflg(Integer locationdisplayflg) {
+ this.locationdisplayflg = locationdisplayflg;
+ }
+ /**
+ * @return movingdistancedisplayflg
+ */
+ public Integer getMovingdistancedisplayflg() {
+ return movingdistancedisplayflg;
+ }
+ /**
+ * @param movingdistancedisplayflg セットする movingdistancedisplayflg
+ */
+ public void setMovingdistancedisplayflg(Integer movingdistancedisplayflg) {
+ this.movingdistancedisplayflg = movingdistancedisplayflg;
+ }
+ /**
+ * @return batteryleveldisplayflg
+ */
+ public Integer getBatteryleveldisplayflg() {
+ return batteryleveldisplayflg;
+ }
+ /**
+ * @param batteryleveldisplayflg セットする batteryleveldisplayflg
+ */
+ public void setBatteryleveldisplayflg(Integer batteryleveldisplayflg) {
+ this.batteryleveldisplayflg = batteryleveldisplayflg;
+ }
+ /**
+ * @return accesstimedisplayflg
+ */
+ public Integer getAccesstimedisplayflg() {
+ return accesstimedisplayflg;
+ }
+ /**
+ * @param accesstimedisplayflg セットする accesstimedisplayflg
+ */
+ public void setAccesstimedisplayflg(Integer accesstimedisplayflg) {
+ this.accesstimedisplayflg = accesstimedisplayflg;
+ }
+ /**
+ * @return receptionstatusdisplayflg
+ */
+ public Integer getReceptionstatusdisplayflg() {
+ return receptionstatusdisplayflg;
+ }
+ /**
+ * @param receptionstatusdisplayflg セットする receptionstatusdisplayflg
+ */
+ public void setReceptionstatusdisplayflg(Integer receptionstatusdisplayflg) {
+ this.receptionstatusdisplayflg = receptionstatusdisplayflg;
+ }
+ /**
+ * @return batterylevelalertflg
+ */
+ public Integer getBatterylevelalertflg() {
+ return batterylevelalertflg;
+ }
+ /**
+ * @param batterylevelalertflg セットする batterylevelalertflg
+ */
+ public void setBatterylevelalertflg(Integer batterylevelalertflg) {
+ this.batterylevelalertflg = batterylevelalertflg;
+ }
+ /**
+ * @return batterynotification
+ */
+ public Integer getBatterynotification() {
+ return batterynotification;
+ }
+ /**
+ * @param batterynotification セットする batterynotification
+ */
+ public void setBatterynotification(Integer batterynotification) {
+ this.batterynotification = batterynotification;
+ }
+ /**
+ * @return batterypopup
+ */
+ public Integer getBatterypopup() {
+ return batterypopup;
+ }
+ /**
+ * @param batterypopup セットする batterypopup
+ */
+ public void setBatterypopup(Integer batterypopup) {
+ this.batterypopup = batterypopup;
+ }
+ /**
+ * @return batteryalarmtime
+ */
+ public Integer getBatteryalarmtime() {
+ return batteryalarmtime;
+ }
+ /**
+ * @param batteryalarmtime セットする batteryalarmtime
+ */
+ public void setBatteryalarmtime(Integer batteryalarmtime) {
+ this.batteryalarmtime = batteryalarmtime;
+ }
+ /**
+ * @return batteryvibrationtime
+ */
+ public Integer getBatteryvibrationtime() {
+ return batteryvibrationtime;
+ }
+ /**
+ * @param batteryvibrationtime セットする batteryvibrationtime
+ */
+ public void setBatteryvibrationtime(Integer batteryvibrationtime) {
+ this.batteryvibrationtime = batteryvibrationtime;
+ }
+ /**
+ * @return batteryreference
+ */
+ public Integer getBatteryreference() {
+ return batteryreference;
+ }
+ /**
+ * @param batteryreference セットする batteryreference
+ */
+ public void setBatteryreference(Integer batteryreference) {
+ this.batteryreference = batteryreference;
+ }
+ /**
+ * @return connectionalertflg
+ */
+ public Integer getConnectionalertflg() {
+ return connectionalertflg;
+ }
+ /**
+ * @param connectionalertflg セットする connectionalertflg
+ */
+ public void setConnectionalertflg(Integer connectionalertflg) {
+ this.connectionalertflg = connectionalertflg;
+ }
+ /**
+ * @return connectionnotification
+ */
+ public Integer getConnectionnotification() {
+ return connectionnotification;
+ }
+ /**
+ * @param connectionnotification セットする connectionnotification
+ */
+ public void setConnectionnotification(Integer connectionnotification) {
+ this.connectionnotification = connectionnotification;
+ }
+ /**
+ * @return connectionpopup
+ */
+ public Integer getConnectionpopup() {
+ return connectionpopup;
+ }
+ /**
+ * @param connectionpopup セットする connectionpopup
+ */
+ public void setConnectionpopup(Integer connectionpopup) {
+ this.connectionpopup = connectionpopup;
+ }
+ /**
+ * @return connectionalarmtime
+ */
+ public Integer getConnectionalarmtime() {
+ return connectionalarmtime;
+ }
+ /**
+ * @param connectionalarmtime セットする connectionalarmtime
+ */
+ public void setConnectionalarmtime(Integer connectionalarmtime) {
+ this.connectionalarmtime = connectionalarmtime;
+ }
+ /**
+ * @return connectionvibrationtime
+ */
+ public Integer getConnectionvibrationtime() {
+ return connectionvibrationtime;
+ }
+ /**
+ * @param connectionvibrationtime セットする connectionvibrationtime
+ */
+ public void setConnectionvibrationtime(Integer connectionvibrationtime) {
+ this.connectionvibrationtime = connectionvibrationtime;
+ }
+ /**
+ * @return sosalertflg
+ */
+ public Integer getSosalertflg() {
+ return sosalertflg;
+ }
+ /**
+ * @param sosalertflg セットする sosalertflg
+ */
+ public void setSosalertflg(Integer sosalertflg) {
+ this.sosalertflg = sosalertflg;
+ }
+ /**
+ * @return sosnotification
+ */
+ public Integer getSosnotification() {
+ return sosnotification;
+ }
+ /**
+ * @param sosnotification セットする sosnotification
+ */
+ public void setSosnotification(Integer sosnotification) {
+ this.sosnotification = sosnotification;
+ }
+ /**
+ * @return sospopup
+ */
+ public Integer getSospopup() {
+ return sospopup;
+ }
+ /**
+ * @param sospopup セットする sospopup
+ */
+ public void setSospopup(Integer sospopup) {
+ this.sospopup = sospopup;
+ }
+ /**
+ * @return sosalarmtime
+ */
+ public Integer getSosalarmtime() {
+ return sosalarmtime;
+ }
+ /**
+ * @param sosalarmtime セットする sosalarmtime
+ */
+ public void setSosalarmtime(Integer sosalarmtime) {
+ this.sosalarmtime = sosalarmtime;
+ }
+ /**
+ * @return sosvibrationtime
+ */
+ public Integer getSosvibrationtime() {
+ return sosvibrationtime;
+ }
+ /**
+ * @param sosvibrationtime セットする sosvibrationtime
+ */
+ public void setSosvibrationtime(Integer sosvibrationtime) {
+ this.sosvibrationtime = sosvibrationtime;
+ }
+ public String getGroupid() {
+ return groupid;
+ }
+ public void setGroupid(String groupid) {
+ this.groupid = groupid;
+ }
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/UserAlertRecordEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/UserAlertRecordEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/UserAlertRecordEntity.java (revision 2)
@@ -0,0 +1,74 @@
+package com.kdc.common.entity.db;
+
+import java.sql.Timestamp;
+
+public class UserAlertRecordEntity extends CommonColumnsEntity {
+
+ private String userid;
+ private Timestamp lastbatteryalertdate;
+ private Timestamp lastdisconnectionalertdate;
+ private Timestamp lastreconnectionalertdate;
+ private Timestamp lastsosalertdate;
+
+ /**
+ * @return userid
+ */
+ public String getUserid() {
+ return userid;
+ }
+ /**
+ * @param userid セットする userid
+ */
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+ /**
+ * @return lastbatteryalertdate
+ */
+ public Timestamp getLastbatteryalertdate() {
+ return lastbatteryalertdate;
+ }
+ /**
+ * @param lastbatteryalertdate セットする lastbatteryalertdate
+ */
+ public void setLastbatteryalertdate(Timestamp lastbatteryalertdate) {
+ this.lastbatteryalertdate = lastbatteryalertdate;
+ }
+ /**
+ * @return lastdisconnectionalertdate
+ */
+ public Timestamp getLastdisconnectionalertdate() {
+ return lastdisconnectionalertdate;
+ }
+ /**
+ * @param lastdisconnectionalertdate セットする lastdisconnectionalertdate
+ */
+ public void setLastdisconnectionalertdate(Timestamp lastdisconnectionalertdate) {
+ this.lastdisconnectionalertdate = lastdisconnectionalertdate;
+ }
+ /**
+ * @return lastreconnectionalertdate
+ */
+ public Timestamp getLastreconnectionalertdate() {
+ return lastreconnectionalertdate;
+ }
+ /**
+ * @param lastreconnectionalertdate セットする lastreconnectionalertdate
+ */
+ public void setLastreconnectionalertdate(Timestamp lastreconnectionalertdate) {
+ this.lastreconnectionalertdate = lastreconnectionalertdate;
+ }
+ /**
+ * @return lastsosalertdate
+ */
+ public Timestamp getLastsosalertdate() {
+ return lastsosalertdate;
+ }
+ /**
+ * @param lastsosalertdate セットする lastsosalertdate
+ */
+ public void setLastsosalertdate(Timestamp lastsosalertdate) {
+ this.lastsosalertdate = lastsosalertdate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/UserDeviceEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/UserDeviceEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/UserDeviceEntity.java (revision 2)
@@ -0,0 +1,74 @@
+package com.kdc.common.entity.db;
+
+import java.sql.Timestamp;
+
+public class UserDeviceEntity extends CommonColumnsEntity {
+
+ private String userid;
+ private String telephonenumber;
+ private String deviceid;
+ private String tokenid;
+ private Timestamp configsyncdate;
+
+ /**
+ * @return userid
+ */
+ public String getUserid() {
+ return userid;
+ }
+ /**
+ * @param userid セットする userid
+ */
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+ /**
+ * @return telephonenumber
+ */
+ public String getTelephonenumber() {
+ return telephonenumber;
+ }
+ /**
+ * @param telephonenumber セットする telephonenumber
+ */
+ public void setTelephonenumber(String telephonenumber) {
+ this.telephonenumber = telephonenumber;
+ }
+ /**
+ * @return deviceid
+ */
+ public String getDeviceid() {
+ return deviceid;
+ }
+ /**
+ * @param deviceid セットする deviceid
+ */
+ public void setDeviceid(String deviceid) {
+ this.deviceid = deviceid;
+ }
+ /**
+ * @return tokenid
+ */
+ public String getTokenid() {
+ return tokenid;
+ }
+ /**
+ * @param tokenid セットする tokenid
+ */
+ public void setTokenid(String tokenid) {
+ this.tokenid = tokenid;
+ }
+ /**
+ * @return configsyncdate
+ */
+ public Timestamp getConfigsyncdate() {
+ return configsyncdate;
+ }
+ /**
+ * @param configsyncdate セットする configsyncdate
+ */
+ public void setConfigsyncdate(Timestamp configsyncdate) {
+ this.configsyncdate = configsyncdate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/UserLocationEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/UserLocationEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/UserLocationEntity.java (revision 2)
@@ -0,0 +1,100 @@
+package com.kdc.common.entity.db;
+
+import java.sql.Timestamp;
+
+public class UserLocationEntity extends CommonColumnsEntity {
+
+ private String userid;
+ private String longitudeandlatitude;
+ private Integer movingdistance;
+ private Integer batterylevel;
+ private Integer receptionstatus;
+ private Integer connectionstatus;
+ private Timestamp lastlocationdate;
+
+ /**
+ * @return userid
+ */
+ public String getUserid() {
+ return userid;
+ }
+ /**
+ * @param userid セットする userid
+ */
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+ /**
+ * @return longitudeandlatitude
+ */
+ public String getLongitudeandlatitude() {
+ return longitudeandlatitude;
+ }
+ /**
+ * @param longitudeandlatitude セットする longitudeandlatitude
+ */
+ public void setLongitudeandlatitude(String longitudeandlatitude) {
+ this.longitudeandlatitude = longitudeandlatitude;
+ }
+ /**
+ * @return movingdistance
+ */
+ public Integer getMovingdistance() {
+ return movingdistance;
+ }
+ /**
+ * @param movingdistance セットする movingdistance
+ */
+ public void setMovingdistance(Integer movingdistance) {
+ this.movingdistance = movingdistance;
+ }
+ /**
+ * @return batterylevel
+ */
+ public Integer getBatterylevel() {
+ return batterylevel;
+ }
+ /**
+ * @param batterylevel セットする batterylevel
+ */
+ public void setBatterylevel(Integer batterylevel) {
+ this.batterylevel = batterylevel;
+ }
+ /**
+ * @return receptionstatus
+ */
+ public Integer getReceptionstatus() {
+ return receptionstatus;
+ }
+ /**
+ * @param receptionstatus セットする receptionstatus
+ */
+ public void setReceptionstatus(Integer receptionstatus) {
+ this.receptionstatus = receptionstatus;
+ }
+ /**
+ * @return connectionstatus
+ */
+ public Integer getConnectionstatus() {
+ return connectionstatus;
+ }
+ /**
+ * @param connectionstatus セットする connectionstatus
+ */
+ public void setConnectionstatus(Integer connectionstatus) {
+ this.connectionstatus = connectionstatus;
+ }
+ /**
+ * @return lastlocationdate
+ */
+ public Timestamp getLastlocationdate() {
+ return lastlocationdate;
+ }
+ /**
+ * @param lastlocationdate セットする lastlocationdate
+ */
+ public void setLastlocationdate(Timestamp lastlocationdate) {
+ this.lastlocationdate = lastlocationdate;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/UserLocationEntityWrapper.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/UserLocationEntityWrapper.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/UserLocationEntityWrapper.java (revision 2)
@@ -0,0 +1,76 @@
+package com.kdc.common.entity.db;
+
+import java.math.BigDecimal;
+
+import org.apache.commons.lang3.StringUtils;
+
+public class UserLocationEntityWrapper extends UserLocationEntity {
+
+ private BigDecimal latitude;
+ private BigDecimal longitude;
+
+ /**
+ * @return latitude
+ */
+ public BigDecimal getLatitude() {
+ return latitude;
+ }
+ /**
+ * @param latitude セットする latitude
+ */
+ public void setLatitude(BigDecimal latitude) {
+ this.latitude = latitude;
+ }
+ /**
+ * @param latitude セットする latitude
+ */
+ public void setLatitude(String latitude) {
+ this.latitude = new BigDecimal(latitude);
+ }
+ /**
+ * @return longitude
+ */
+ public BigDecimal getLongitude() {
+ return longitude;
+ }
+ /**
+ * @param longitude セットする longitude
+ */
+ public void setLongitude(BigDecimal longitude) {
+ this.longitude = longitude;
+ }
+ /**
+ * @param longitude セットする longitude
+ */
+ public void setLongitude(String longitude) {
+ this.longitude = new BigDecimal(longitude);
+ }
+ /**
+ * @return longitudeandlatitude
+ */
+ @Deprecated
+ public String getLongitudeandlatitude() {
+ return String.format("(%s,%s)", this.latitude, this.longitude);
+ }
+ /**
+ * @param latitude セットする latitude
+ * @param longitude セットする longitude
+ */
+ public void setLongitudeandlatitude(BigDecimal latitude, BigDecimal longitude) {
+ this.latitude = latitude;
+ this.longitude = longitude;
+ }
+ /**
+ * @param longitudeandlatitude セットする longitudeandlatitude
+ */
+ @Deprecated
+ public void setLongitudeandlatitude(String longitudeandlatitude) {
+ super.setLongitudeandlatitude(longitudeandlatitude);
+ longitudeandlatitude = StringUtils.remove(longitudeandlatitude, '(');
+ longitudeandlatitude = StringUtils.remove(longitudeandlatitude, ')');
+ String temp[] = longitudeandlatitude.split(",");
+ this.latitude = new BigDecimal(temp[0]);
+ this.longitude = new BigDecimal(temp[1]);
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/UserLocationRecordEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/UserLocationRecordEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/UserLocationRecordEntity.java (revision 2)
@@ -0,0 +1,74 @@
+package com.kdc.common.entity.db;
+
+import java.sql.Timestamp;
+
+public class UserLocationRecordEntity extends CommonColumnsEntity {
+
+ private String userid;
+ private Timestamp receivedate;
+ private String longitudeandlatitude;
+ private Integer batterylevel;
+ private Integer receptionstatus;
+
+ /**
+ * @return userid
+ */
+ public String getUserid() {
+ return userid;
+ }
+ /**
+ * @param userid セットする userid
+ */
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+ /**
+ * @return receivedate
+ */
+ public Timestamp getReceivedate() {
+ return receivedate;
+ }
+ /**
+ * @param receivedate セットする receivedate
+ */
+ public void setReceivedate(Timestamp receivedate) {
+ this.receivedate = receivedate;
+ }
+ /**
+ * @return longitudeandlatitude
+ */
+ public String getLongitudeandlatitude() {
+ return longitudeandlatitude;
+ }
+ /**
+ * @param longitudeandlatitude セットする longitudeandlatitude
+ */
+ public void setLongitudeandlatitude(String longitudeandlatitude) {
+ this.longitudeandlatitude = longitudeandlatitude;
+ }
+ /**
+ * @return batterylevel
+ */
+ public Integer getBatterylevel() {
+ return batterylevel;
+ }
+ /**
+ * @param batterylevel セットする batterylevel
+ */
+ public void setBatterylevel(Integer batterylevel) {
+ this.batterylevel = batterylevel;
+ }
+ /**
+ * @return receptionstatus
+ */
+ public Integer getReceptionstatus() {
+ return receptionstatus;
+ }
+ /**
+ * @param receptionstatus セットする receptionstatus
+ */
+ public void setReceptionstatus(Integer receptionstatus) {
+ this.receptionstatus = receptionstatus;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/UserLocationRecordEntityWrapper.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/UserLocationRecordEntityWrapper.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/UserLocationRecordEntityWrapper.java (revision 2)
@@ -0,0 +1,76 @@
+package com.kdc.common.entity.db;
+
+import java.math.BigDecimal;
+
+import org.apache.commons.lang3.StringUtils;
+
+public class UserLocationRecordEntityWrapper extends UserLocationRecordEntity {
+
+ private BigDecimal latitude;
+ private BigDecimal longitude;
+
+ /**
+ * @return latitude
+ */
+ public BigDecimal getLatitude() {
+ return latitude;
+ }
+ /**
+ * @param latitude セットする latitude
+ */
+ public void setLatitude(BigDecimal latitude) {
+ this.latitude = latitude;
+ }
+ /**
+ * @param latitude セットする latitude
+ */
+ public void setLatitude(String latitude) {
+ this.latitude = new BigDecimal(latitude);
+ }
+ /**
+ * @return longitude
+ */
+ public BigDecimal getLongitude() {
+ return longitude;
+ }
+ /**
+ * @param longitude セットする longitude
+ */
+ public void setLongitude(BigDecimal longitude) {
+ this.longitude = longitude;
+ }
+ /**
+ * @param longitude セットする longitude
+ */
+ public void setLongitude(String longitude) {
+ this.longitude = new BigDecimal(longitude);
+ }
+ /**
+ * @return longitudeandlatitude
+ */
+ @Deprecated
+ public String getLongitudeandlatitude() {
+ return String.format("(%s,%s)", this.latitude, this.longitude);
+ }
+ /**
+ * @param latitude セットする latitude
+ * @param longitude セットする longitude
+ */
+ public void setLongitudeandlatitude(BigDecimal latitude, BigDecimal longitude) {
+ this.latitude = latitude;
+ this.longitude = longitude;
+ }
+ /**
+ * @param longitudeandlatitude セットする longitudeandlatitude
+ */
+ @Deprecated
+ public void setLongitudeandlatitude(String longitudeandlatitude) {
+ super.setLongitudeandlatitude(longitudeandlatitude);
+ longitudeandlatitude = StringUtils.remove(longitudeandlatitude, '(');
+ longitudeandlatitude = StringUtils.remove(longitudeandlatitude, ')');
+ String temp[] = longitudeandlatitude.split(",");
+ this.latitude = new BigDecimal(temp[0]);
+ this.longitude = new BigDecimal(temp[1]);
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/db/UserMasterEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/db/UserMasterEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/db/UserMasterEntity.java (revision 2)
@@ -0,0 +1,138 @@
+package com.kdc.common.entity.db;
+
+
+public class UserMasterEntity extends CommonColumnsEntity {
+
+ private String userid;
+ private String password;
+ private String username;
+ private String iconid;
+ private byte[] iconfile;
+ private String groupid;
+ private Integer authlevel;
+ private String linecolor;
+ private Integer markercolor;
+ private Integer disporder;
+
+ /**
+ * @return userid
+ */
+ public String getUserid() {
+ return userid;
+ }
+ /**
+ * @param userid セットする userid
+ */
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+ /**
+ * @return password
+ */
+ public String getPassword() {
+ return password;
+ }
+ /**
+ * @param password セットする password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+ /**
+ * @return username
+ */
+ public String getUsername() {
+ return username;
+ }
+ /**
+ * @param username セットする username
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+ /**
+ * @return iconid
+ */
+ public String getIconid() {
+ return iconid;
+ }
+ /**
+ * @param iconid セットする iconid
+ */
+ public void setIconid(String iconid) {
+ this.iconid = iconid;
+ }
+ /**
+ * @return iconfile
+ */
+ public byte[] getIconfile() {
+ return iconfile;
+ }
+ /**
+ * @param iconfile セットする iconfile
+ */
+ public void setIconfile(byte[] iconfile) {
+ this.iconfile = iconfile;
+ }
+ /**
+ * @return groupid
+ */
+ public String getGroupid() {
+ return groupid;
+ }
+ /**
+ * @param groupid セットする groupid
+ */
+ public void setGroupid(String groupid) {
+ this.groupid = groupid;
+ }
+ /**
+ * @return authlevel
+ */
+ public Integer getAuthlevel() {
+ return authlevel;
+ }
+ /**
+ * @param authlevel セットする authlevel
+ */
+ public void setAuthlevel(Integer authlevel) {
+ this.authlevel = authlevel;
+ }
+ /**
+ * @return linecolor
+ */
+ public String getLinecolor() {
+ return linecolor;
+ }
+ /**
+ * @param linecolor セットする linecolor
+ */
+ public void setLinecolor(String linecolor) {
+ this.linecolor = linecolor;
+ }
+ /**
+ * @return markercolor
+ */
+ public Integer getMarkercolor() {
+ return markercolor;
+ }
+ /**
+ * @param markercolor セットする markercolor
+ */
+ public void setMarkercolor(Integer markercolor) {
+ this.markercolor = markercolor;
+ }
+ /**
+ * @return disporder
+ */
+ public Integer getDisporder() {
+ return disporder;
+ }
+ /**
+ * @param disporder セットする disporder
+ */
+ public void setDisporder(Integer disporder) {
+ this.disporder = disporder;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/web/GoogleMapParamEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/web/GoogleMapParamEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/web/GoogleMapParamEntity.java (revision 2)
@@ -0,0 +1,54 @@
+package com.kdc.common.entity.web;
+
+public class GoogleMapParamEntity {
+
+ private int zoom;
+ private String latitude;
+ private String longitude;
+
+ /**
+ * @return zoom
+ */
+ public int getZoom() {
+ return zoom;
+ }
+
+ /**
+ * @param zoom
+ * セットする zoom
+ */
+ public void setZoom(int zoom) {
+ this.zoom = zoom;
+ }
+
+ /**
+ * @return latitude
+ */
+ public String getLatitude() {
+ return latitude;
+ }
+
+ /**
+ * @param latitude
+ * セットする latitude
+ */
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
+
+ /**
+ * @return longitude
+ */
+ public String getLongitude() {
+ return longitude;
+ }
+
+ /**
+ * @param longitude
+ * セットする longitude
+ */
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/entity/web/WebUserViewEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/web/WebUserViewEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/web/WebUserViewEntity.java (revision 2)
@@ -0,0 +1,163 @@
+package com.kdc.common.entity.web;
+
+
+public class WebUserViewEntity {
+
+ private String userId;
+ private String userName;
+ private String iconDataString;
+ private String groupId;
+ private Integer authLevel;
+ private String lineColor;
+ private String lineColorAlpha;
+ private String lineColorRed;
+ private String lineColorGreen;
+ private String lineColorBlue;
+ private Integer markerColor;
+ private Integer dispOrder;
+
+ /**
+ * @return userId
+ */
+ public String getUserId() {
+ return userId;
+ }
+ /**
+ * @param userId セットする userId
+ */
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ /**
+ * @return userName
+ */
+ public String getUserName() {
+ return userName;
+ }
+ /**
+ * @param userName セットする userName
+ */
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+ /**
+ * @return iconDataString
+ */
+ public String getIconDataString() {
+ return iconDataString;
+ }
+ /**
+ * @param iconDataString セットする iconDataString
+ */
+ public void setIconDataString(String iconDataString) {
+ this.iconDataString = iconDataString;
+ }
+ /**
+ * @return groupId
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+ /**
+ * @param groupId セットする groupId
+ */
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+ /**
+ * @return authLevel
+ */
+ public Integer getAuthLevel() {
+ return authLevel;
+ }
+ /**
+ * @param authLevel セットする authLevel
+ */
+ public void setAuthLevel(Integer authLevel) {
+ this.authLevel = authLevel;
+ }
+ /**
+ * @return lineColor
+ */
+ public String getLineColor() {
+ return lineColor;
+ }
+ /**
+ * @param lineColor セットする lineColor
+ */
+ public void setLineColor(String lineColor) {
+ this.lineColor = lineColor;
+ }
+ /**
+ * @return lineColorRed
+ */
+ public String getLineColorRed() {
+ return lineColorRed;
+ }
+ /**
+ * @param lineColorRed セットする lineColorRed
+ */
+ public void setLineColorRed(String lineColorRed) {
+ this.lineColorRed = lineColorRed;
+ }
+ /**
+ * @return lineColorGreen
+ */
+ public String getLineColorGreen() {
+ return lineColorGreen;
+ }
+ /**
+ * @param lineColorGreen セットする lineColorGreen
+ */
+ public void setLineColorGreen(String lineColorGreen) {
+ this.lineColorGreen = lineColorGreen;
+ }
+ /**
+ * @return lineColorBlue
+ */
+ public String getLineColorBlue() {
+ return lineColorBlue;
+ }
+ /**
+ * @param lineColorBlue セットする lineColorBlue
+ */
+ public void setLineColorBlue(String lineColorBlue) {
+ this.lineColorBlue = lineColorBlue;
+ }
+ /**
+ * @return lineColorAlpha
+ */
+ public String getLineColorAlpha() {
+ return lineColorAlpha;
+ }
+ /**
+ * @param lineColorAlpha セットする lineColorAlpha
+ */
+ public void setLineColorAlpha(String lineColorAlpha) {
+ this.lineColorAlpha = lineColorAlpha;
+ }
+ /**
+ * @return markerColor
+ */
+ public Integer getMarkerColor() {
+ return markerColor;
+ }
+ /**
+ * @param markerColor セットする markerColor
+ */
+ public void setMarkerColor(Integer markerColor) {
+ this.markerColor = markerColor;
+ }
+ /**
+ * @return dispOrder
+ */
+ public Integer getDispOrder() {
+ return dispOrder;
+ }
+ /**
+ * @param dispOrder セットする dispOrder
+ */
+ public void setDispOrder(Integer dispOrder) {
+ this.dispOrder = dispOrder;
+ }
+}
Index: kdc/src/main/java/com/kdc/common/entity/KdcAlertEntity.java
===================================================================
--- kdc/src/main/java/com/kdc/common/entity/KdcAlertEntity.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/entity/KdcAlertEntity.java (revision 2)
@@ -0,0 +1,73 @@
+package com.kdc.common.entity;
+
+
+public class KdcAlertEntity {
+
+ private String userid;
+ private String username;
+ private String placeid;
+ private Integer authlevel;
+ private Integer notificationauthlevel;
+
+ /**
+ * @return userid
+ */
+ public String getUserid() {
+ return userid;
+ }
+ /**
+ * @param userid セットする userid
+ */
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+ /**
+ * @return username
+ */
+ public String getUsername() {
+ return username;
+ }
+ /**
+ * @param username セットする username
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+ /**
+ * @return placeid
+ */
+ public String getPlaceid() {
+ return placeid;
+ }
+ /**
+ * @param placeid セットする placeid
+ */
+ public void setPlaceid(String placeid) {
+ this.placeid = placeid;
+ }
+ /**
+ * @return authlevel
+ */
+ public Integer getAuthlevel() {
+ return authlevel;
+ }
+ /**
+ * @param authlevel セットする authlevel
+ */
+ public void setAuthlevel(Integer authlevel) {
+ this.authlevel = authlevel;
+ }
+ /**
+ * @return notificationauthlevel
+ */
+ public Integer getNotificationauthlevel() {
+ return notificationauthlevel;
+ }
+ /**
+ * @param notificationauthlevel セットする notificationauthlevel
+ */
+ public void setNotificationauthlevel(Integer notificationauthlevel) {
+ this.notificationauthlevel = notificationauthlevel;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/ApiIdEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/ApiIdEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/ApiIdEnum.java (revision 2)
@@ -0,0 +1,144 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * API識別ID Enum
+ */
+public enum ApiIdEnum {
+ /** ログイン */
+ LOGIN(CommonConst.API_ID_LOGIN),
+ /** ユーザ登録 */
+ REGISTER_USER(CommonConst.API_ID_REGISTER_USER),
+ /** 位置情報送信 */
+ SEND_LOCATION(CommonConst.API_ID_SEND_LOCATION),
+ /** ユーザ位置情報取得 */
+ GET_LOCATIONS(CommonConst.API_ID_GET_LOCATIONS),
+ /** 場所情報取得 */
+ GET_PLACES(CommonConst.API_ID_GET_PLACES),
+ /** グループ情報取得 */
+ GET_GROUPS(CommonConst.API_ID_GET_GROUPS),
+ /** ユーザ履歴情報取得 */
+ GET_RECORDS(CommonConst.API_ID_GET_RECORDS),
+ /** 設定取得 */
+ GET_CONFIG(CommonConst.API_ID_GET_CONFIG),
+ /** SOS発信 */
+ SEND_SOS_ALERT(CommonConst.API_ID_SEND_SOS_ALERT),
+ /** 場所登録 */
+ REGISTER_PLACE(CommonConst.API_ID_REGISTER_PLACE),
+ /** グループ登録 */
+ REGISTER_GROUP(CommonConst.API_ID_REGISTER_GROUP),
+ /** 通知情報登録 */
+ REGISTER_NOTIFICATION(CommonConst.API_ID_REGISTER_NOTIFICATION),
+ /** 通知情報取得 */
+ GET_NOTIFICATIONS(CommonConst.API_ID_GET_NOTIFICATIONS),
+
+ /** ユーザ情報変更 */
+ SETTING_USER(CommonConst.API_ID_SETTING_USER),
+ /** アイコン画像ダウンロード */
+ DL_USERICON(CommonConst.API_ID_DL_USERICON),
+ /** 招待コード発行 */
+ GET_INVITATION(CommonConst.API_ID_GET_INVITATION),
+ /** 招待コード認証 */
+ CHECK_INVITATION(CommonConst.API_ID_CHECK_INVITATION),
+ /** APKダウンロード */
+ DL_APK(CommonConst.API_ID_DL_APK),
+ /** (管理者用機能)全ユーザ情報取得 */
+ ADMIN_GET_ALLUSER(CommonConst.API_ID_ADMIN_GET_ALLUSER),
+ /** (管理者用機能)他ユーザ情報変更 */
+ ADMIN_SETTING_USER(CommonConst.API_ID_ADMIN_SETTING_USER),
+ /** (管理者用機能)ユーザ削除 */
+ ADMIN_DELUSER(CommonConst.API_ID_ADMIN_DELUSER),
+ /** サーバ処理(API以外でPush通知を返す特殊番号) */
+ SERVER_PROCESS(CommonConst.API_ID_SERVER_PROCESS),
+ /** ログアウト */
+ LOGOUT(CommonConst.API_ID_LOGOUT),
+ /** ユーザチェック */
+ CHECK_USER(CommonConst.API_ID_CHECK_USER),;
+
+ final int code;
+
+ private ApiIdEnum(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public static ApiIdEnum valueOf(int rm) {
+ switch (rm) {
+
+ case CommonConst.API_ID_LOGIN:
+ return LOGIN;
+
+ case CommonConst.API_ID_REGISTER_USER:
+ return REGISTER_USER;
+
+ case CommonConst.API_ID_SEND_LOCATION:
+ return SEND_LOCATION;
+
+ case CommonConst.API_ID_GET_LOCATIONS:
+ return GET_LOCATIONS;
+
+ case CommonConst.API_ID_GET_PLACES:
+ return GET_PLACES;
+
+ case CommonConst.API_ID_GET_RECORDS:
+ return GET_RECORDS;
+
+ case CommonConst.API_ID_GET_CONFIG:
+ return GET_CONFIG;
+
+ case CommonConst.API_ID_SEND_SOS_ALERT:
+ return SEND_SOS_ALERT;
+
+ case CommonConst.API_ID_REGISTER_PLACE:
+ return REGISTER_PLACE;
+
+ case CommonConst.API_ID_SETTING_USER:
+ return SETTING_USER;
+
+ case CommonConst.API_ID_DL_USERICON:
+ return DL_USERICON;
+
+ case CommonConst.API_ID_GET_INVITATION:
+ return GET_INVITATION;
+
+ case CommonConst.API_ID_CHECK_INVITATION:
+ return CHECK_INVITATION;
+
+ case CommonConst.API_ID_DL_APK:
+ return DL_APK;
+
+ case CommonConst.API_ID_ADMIN_GET_ALLUSER:
+ return ADMIN_GET_ALLUSER;
+
+ case CommonConst.API_ID_ADMIN_SETTING_USER:
+ return ADMIN_SETTING_USER;
+
+ case CommonConst.API_ID_ADMIN_DELUSER:
+ return ADMIN_DELUSER;
+
+ case CommonConst.API_ID_SERVER_PROCESS:
+ return SERVER_PROCESS;
+
+ case CommonConst.API_ID_LOGOUT:
+ return LOGOUT;
+
+ case CommonConst.API_ID_CHECK_USER:
+ return CHECK_USER;
+
+ case CommonConst.API_ID_REGISTER_NOTIFICATION:
+ return REGISTER_NOTIFICATION;
+
+ case CommonConst.API_ID_GET_NOTIFICATIONS:
+ return GET_NOTIFICATIONS;
+
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/ApiIdEnum.java.rej
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/ApiIdEnum.java.rej (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/ApiIdEnum.java.rej (revision 2)
@@ -0,0 +1,12 @@
+diff a/kdc/src/main/java/com/kdc/common/enums/ApiIdEnum.java b/kdc/src/main/java/com/kdc/common/enums/ApiIdEnum.java (rejected hunks)
+@@ -42,7 +42,9 @@
+ ADMIN_DELUSER(CommonConst.API_ID_ADMIN_DELUSER),
+ /** サーバ処理(API以外でPush通知を返す特殊番号) */
+ SERVER_PROCESS(CommonConst.API_ID_SERVER_PROCESS),;
+-
++// /** ログアウト */
++// LOGOUT(CommonConst.API_ID_LOGOUT),;
++
+ final int code;
+
+ private ApiIdEnum(int code) {
Index: kdc/src/main/java/com/kdc/common/enums/AuthLevelEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/AuthLevelEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/AuthLevelEnum.java (revision 2)
@@ -0,0 +1,62 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * 管理レベルEnum
+ */
+public enum AuthLevelEnum {
+ /** ゲスト */
+ GUEST(CommonConst.AUTH_LEVEL_GUEST, "ゲスト"),
+ /** 子供 */
+ CHILD(CommonConst.AUTH_LEVEL_CHILD, "子供"),
+ /** 大人 */
+ ADULT(CommonConst.AUTH_LEVEL_ADULT, "大人"),
+ /** 管理者 */
+ ADMIN(CommonConst.AUTH_LEVEL_ADMIN, "管理者");
+
+ final int code;
+ final String label;
+
+ private AuthLevelEnum(int code, String label) {
+ this.code = code;
+ this.label = label;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getCodeString() {
+ return Integer.toString(this.code);
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getCodeLabel() {
+ return new StringBuilder(getCodeString()).append(":").append(getLabel()).toString();
+ }
+
+ public static AuthLevelEnum valueOf(int rm) {
+ switch (rm) {
+
+ case CommonConst.AUTH_LEVEL_GUEST:
+ return GUEST;
+
+ case CommonConst.AUTH_LEVEL_CHILD:
+ return CHILD;
+
+ case CommonConst.AUTH_LEVEL_ADULT:
+ return ADULT;
+
+ case CommonConst.AUTH_LEVEL_ADMIN:
+ return ADMIN;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/AuthenticationModeEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/AuthenticationModeEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/AuthenticationModeEnum.java (revision 2)
@@ -0,0 +1,43 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * 認証モードEnum
+ */
+public enum AuthenticationModeEnum {
+ /** ログイン */
+ LOGIN(CommonConst.AUTHENTICATION_MODE_LOGIN),
+ /** ユーザ登録 */
+ REGISTER_USER(CommonConst.AUTHENTICATION_MODE_REGISTER_USER),
+ /** 新規グループ作成 */
+ NEW_GROUP(CommonConst.AUTHENTICATION_MODE_NEW_GROUP);
+
+ final int code;
+
+ private AuthenticationModeEnum(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public static AuthenticationModeEnum valueOf(int rm) {
+ switch (rm) {
+
+ case CommonConst.AUTHENTICATION_MODE_LOGIN:
+ return LOGIN;
+
+ case CommonConst.AUTHENTICATION_MODE_REGISTER_USER:
+ return REGISTER_USER;
+
+ case CommonConst.AUTHENTICATION_MODE_NEW_GROUP:
+ return NEW_GROUP;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/ConfirmMessageEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/ConfirmMessageEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/ConfirmMessageEnum.java (revision 2)
@@ -0,0 +1,43 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.KdcCommonUtils;
+
+/**
+ * 確認メッセージ一覧
+ *
+ * @author shimizuh@kksse.co.jp
+ * @since 2017/01/11
+ * @version
+ *
+ */
+public enum ConfirmMessageEnum {
+ // 列挙子(標準メッセージ)
+ DEFAULT_COMMIT("登録しますか?"),
+ DELETE_USER("このユーザを削除します。よろしいですか?"),
+ DELETE_PLACE("選択した場所を削除します。よろしいですか?"),;
+
+ // フィールド
+ final String message;
+
+ // コンストラクタ
+ private ConfirmMessageEnum(String message) {
+ this.message = message;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * 表示する文字列を取得.
+ *
+ * @return メッセージ文字列、{@code null}の場合、文字列"null"を返す
+ */
+ public String getMessageString() {
+ if (KdcCommonUtils.isEmpty(this.message)) {
+ return "null";
+ }
+ return new StringBuilder().append("\"").append(this.message).append("\"").toString();
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/ConnectionStatusEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/ConnectionStatusEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/ConnectionStatusEnum.java (revision 2)
@@ -0,0 +1,37 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * 接続可否Enum
+ */
+public enum ConnectionStatusEnum {
+ /** 切断 */
+ DISCONNECT(CommonConst.CONNECTION_STATUS_DISCONNECT),
+ /** 接続 */
+ CONNECT(CommonConst.CONNECTION_STATUS_CONNECT);
+
+ final int code;
+
+ private ConnectionStatusEnum(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public static ConnectionStatusEnum valueOf(int rm) {
+ switch (rm) {
+
+ case CommonConst.CONNECTION_STATUS_DISCONNECT:
+ return DISCONNECT;
+
+ case CommonConst.CONNECTION_STATUS_CONNECT:
+ return CONNECT;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+}
Index: kdc/src/main/java/com/kdc/common/enums/DayOfWeekEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/DayOfWeekEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/DayOfWeekEnum.java (revision 2)
@@ -0,0 +1,69 @@
+package com.kdc.common.enums;
+
+import java.util.Calendar;
+
+/**
+ * 曜日Enum
+ */
+public enum DayOfWeekEnum {
+ /** 日曜日 */
+ SUNDAY(Calendar.SUNDAY, "日"),
+ /** 月曜日 */
+ MONDAY(Calendar.MONDAY, "月"),
+ /** 火曜日 */
+ TUESDAY(Calendar.TUESDAY, "火"),
+ /** 水曜日 */
+ WEDNESDAY(Calendar.WEDNESDAY, "水"),
+ /** 木曜日 */
+ THURSDAY(Calendar.THURSDAY, "木"),
+ /** 金曜日 */
+ FRIDAY(Calendar.FRIDAY, "金"),
+ /** 土曜日 */
+ SATURDAY(Calendar.SATURDAY, "土");
+
+ final int code;
+ final String label;
+
+ private DayOfWeekEnum(int code, String label) {
+ this.code = code;
+ this.label = label;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public static DayOfWeekEnum valueOf(int rm) {
+ switch (rm) {
+
+ case Calendar.SUNDAY:
+ return SUNDAY;
+
+ case Calendar.MONDAY:
+ return MONDAY;
+
+ case Calendar.TUESDAY:
+ return TUESDAY;
+
+ case Calendar.WEDNESDAY:
+ return WEDNESDAY;
+
+ case Calendar.THURSDAY:
+ return THURSDAY;
+
+ case Calendar.FRIDAY:
+ return FRIDAY;
+
+ case Calendar.SATURDAY:
+ return SATURDAY;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/NotificationTypeEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/NotificationTypeEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/NotificationTypeEnum.java (revision 2)
@@ -0,0 +1,56 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * 通知タイプEnum
+ */
+public enum NotificationTypeEnum {
+ /** 音のみ */
+ SOUND_ONLY(CommonConst.NOTIFICATION_TYPE_SOUND_ONLY, "音のみ"),
+ /** バイブのみ */
+ VIBRATION_ONLY(CommonConst.NOTIFICATION_TYPE_VIBRATION_ONLY, "バイブのみ"),
+ /** 音+バイブ */
+ SOUND_AND_VIBRATION(CommonConst.NOTIFICATION_TYPE_SOUND_AND_VIBRATION, "音+バイブ");
+
+ final int code;
+ final String label;
+
+ private NotificationTypeEnum(int code, String label) {
+ this.code = code;
+ this.label = label;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getCodeString() {
+ return Integer.toString(this.code);
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getCodeLabel() {
+ return new StringBuilder(getCodeString()).append(":").append(getLabel()).toString();
+ }
+
+ public static NotificationTypeEnum valueOf(int rm) {
+ switch (rm) {
+
+ case CommonConst.NOTIFICATION_TYPE_SOUND_ONLY:
+ return SOUND_ONLY;
+
+ case CommonConst.NOTIFICATION_TYPE_VIBRATION_ONLY:
+ return VIBRATION_ONLY;
+
+ case CommonConst.NOTIFICATION_TYPE_SOUND_AND_VIBRATION:
+ return SOUND_AND_VIBRATION;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+}
Index: kdc/src/main/java/com/kdc/common/enums/PlaceTypeEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/PlaceTypeEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/PlaceTypeEnum.java (revision 2)
@@ -0,0 +1,50 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * 場所種別Enum
+ */
+public enum PlaceTypeEnum {
+ /** 通常場所 */
+ NORMAL(CommonConst.PLACE_TYPE_NORMAL, "#3CB371", "#006400"),
+ /** 危険な場所 */
+ DANGER(CommonConst.PLACE_TYPE_DANGER, "#FF0000", "#DC143C");
+
+ final int code;
+ final String circleColor;
+ final String editColor;
+
+ private PlaceTypeEnum(int code, String circleColor, String editColor) {
+ this.code = code;
+ this.circleColor = circleColor;
+ this.editColor = editColor;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getCircleColor() {
+ return circleColor;
+ }
+
+ public String getEditColor() {
+ return editColor;
+ }
+
+ public static PlaceTypeEnum valueOf(int rm) {
+ switch (rm) {
+
+ case CommonConst.PLACE_TYPE_NORMAL:
+ return NORMAL;
+
+ case CommonConst.PLACE_TYPE_DANGER:
+ return DANGER;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/PushNotificationEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/PushNotificationEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/PushNotificationEnum.java (revision 2)
@@ -0,0 +1,78 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * Push通知種別Enum
+ */
+public enum PushNotificationEnum {
+ /** ユーザアイコン */
+ USERICON(CommonConst.PUSH_NOFITICATION_USERICON),
+ /** SOS */
+ SOS(CommonConst.PUSH_NOFITICATION_SOS),
+ /** バッテリー */
+ BATTERY(CommonConst.PUSH_NOFITICATION_BATTERY),
+ /** 接続切断 */
+ DISCONNECT(CommonConst.PUSH_NOFITICATION_DISCONNECT),
+ /** 接続回復 */
+ RECONNECT(CommonConst.PUSH_NOFITICATION_RECONNECT),
+ /** 場所進入(通常場所) */
+ PLACE_NORMAL_IN(CommonConst.PUSH_NOFITICATION_PLACE_NORMAL_IN),
+ /** 場所進入(危険な場所) */
+ PLACE_DANGER_IN(CommonConst.PUSH_NOFITICATION_PLACE_DANGER_IN),
+ /** 場所退出(通常場所) */
+ PLACE_NORMAL_OUT(CommonConst.PUSH_NOFITICATION_PLACE_NORMAL_OUT),
+ /** 場所退出(危険な場所) */
+ PLACE_DANGER_OUT(CommonConst.PUSH_NOFITICATION_PLACE_DANGER_OUT),
+ /** 設定変更(サーバ処理) */
+ CHANGE_CONFIG(CommonConst.PUSH_NOFITICATION_CHANGE_CONFIG),;
+
+ final int code;
+
+ private PushNotificationEnum(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public static PushNotificationEnum valueOf(int rm) {
+ switch (rm) {
+
+ case CommonConst.PUSH_NOFITICATION_USERICON:
+ return USERICON;
+
+ case CommonConst.PUSH_NOFITICATION_SOS:
+ return SOS;
+
+ case CommonConst.PUSH_NOFITICATION_BATTERY:
+ return BATTERY;
+
+ case CommonConst.PUSH_NOFITICATION_DISCONNECT:
+ return DISCONNECT;
+
+ case CommonConst.PUSH_NOFITICATION_RECONNECT:
+ return RECONNECT;
+
+ case CommonConst.PUSH_NOFITICATION_PLACE_NORMAL_IN:
+ return PLACE_NORMAL_IN;
+
+ case CommonConst.PUSH_NOFITICATION_PLACE_DANGER_IN:
+ return PLACE_DANGER_IN;
+
+ case CommonConst.PUSH_NOFITICATION_PLACE_NORMAL_OUT:
+ return PLACE_NORMAL_OUT;
+
+ case CommonConst.PUSH_NOFITICATION_PLACE_DANGER_OUT:
+ return PLACE_DANGER_OUT;
+
+ case CommonConst.PUSH_NOFITICATION_CHANGE_CONFIG:
+ return CHANGE_CONFIG;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/ReceptionStatusEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/ReceptionStatusEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/ReceptionStatusEnum.java (revision 2)
@@ -0,0 +1,63 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * 電波状況Enum
+ */
+public enum ReceptionStatusEnum {
+ /** Wi-Fi */
+ WIFI(CommonConst.RECEPTION_STATUS_WIFI, "Wi-Fi"),
+ /** LTE */
+ LTE(CommonConst.RECEPTION_STATUS_LTE, "LTE"),
+ /** 4G */
+ _4G(CommonConst.RECEPTION_STATUS_4G, "4G"),
+ /** 3G */
+ _3G(CommonConst.RECEPTION_STATUS_3G, "3G"),
+ /** 5G */
+ _5G(CommonConst.RECEPTION_STATUS_5G, "5G"),
+ /** WiMAX */
+ WIMAX(CommonConst.RECEPTION_STATUS_WIMAX, "WiMAX");
+
+ final int code;
+ final String label;
+
+ private ReceptionStatusEnum(int code, String label) {
+ this.code = code;
+ this.label = label;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public static ReceptionStatusEnum valueOf(int rm) {
+ switch (rm) {
+
+ case CommonConst.RECEPTION_STATUS_WIFI:
+ return WIFI;
+
+ case CommonConst.RECEPTION_STATUS_LTE:
+ return LTE;
+
+ case CommonConst.RECEPTION_STATUS_4G:
+ return _4G;
+
+ case CommonConst.RECEPTION_STATUS_3G:
+ return _3G;
+
+ case CommonConst.RECEPTION_STATUS_5G:
+ return _5G;
+
+ case CommonConst.RECEPTION_STATUS_WIMAX:
+ return WIMAX;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+}
Index: kdc/src/main/java/com/kdc/common/enums/RegisterGroupModeEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/RegisterGroupModeEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/RegisterGroupModeEnum.java (revision 2)
@@ -0,0 +1,46 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * グループ登録モードEnum
+ * @author umemoto
+ *
+ */
+public enum RegisterGroupModeEnum {
+
+ /** 登録 */
+ INSERT(CommonConst.REGISTER_PLACE_MODE_INSERT),
+ /** 変更 */
+ UPDATE(CommonConst.REGISTER_PLACE_MODE_UPDATE),
+ /** 削除 */
+ DELETE(CommonConst.REGISTER_PLACE_MODE_DELETE);
+
+ final int code;
+
+ private RegisterGroupModeEnum(int code ) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public static RegisterGroupModeEnum valueOf(int rm) {
+ switch(rm) {
+
+ case CommonConst.REGISTER_GROUP_MODE_INSERT:
+ return INSERT;
+
+ case CommonConst.REGISTER_GROUP_MODE_UPDATE:
+ return UPDATE;
+
+ case CommonConst.REGISTER_GROUP_MODE_DELETE:
+ return DELETE;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/RegisterNotificationModeEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/RegisterNotificationModeEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/RegisterNotificationModeEnum.java (revision 2)
@@ -0,0 +1,46 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * 通知情報登録モードEnum
+ * @author kerimu
+ *
+ */
+public enum RegisterNotificationModeEnum {
+ /** 登録 */
+ INSERT(CommonConst.REGISTER_PLACE_MODE_INSERT),
+ /** 変更 */
+ UPDATE(CommonConst.REGISTER_PLACE_MODE_UPDATE),
+ /** 削除 */
+ DELETE(CommonConst.REGISTER_PLACE_MODE_DELETE);
+
+ final int code;
+
+ private RegisterNotificationModeEnum(int code ) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public static RegisterNotificationModeEnum valueOf(int rm) {
+ switch(rm) {
+
+ case CommonConst.REGISTER_NOTIFICATION_MODE_INSERT:
+ return INSERT;
+
+ case CommonConst.REGISTER_NOTIFICATION_MODE_UPDATE:
+ return UPDATE;
+
+ case CommonConst.REGISTER_NOTIFICATION_MODE_DELETE:
+ return DELETE;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/RegisterPlaceModeEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/RegisterPlaceModeEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/RegisterPlaceModeEnum.java (revision 2)
@@ -0,0 +1,43 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * 場所登録モードEnum
+ */
+public enum RegisterPlaceModeEnum {
+ /** 登録 */
+ INSERT(CommonConst.REGISTER_PLACE_MODE_INSERT),
+ /** 変更 */
+ UPDATE(CommonConst.REGISTER_PLACE_MODE_UPDATE),
+ /** 削除 */
+ DELETE(CommonConst.REGISTER_PLACE_MODE_DELETE);
+
+ final int code;
+
+ private RegisterPlaceModeEnum(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public static RegisterPlaceModeEnum valueOf(int rm) {
+ switch (rm) {
+
+ case CommonConst.REGISTER_PLACE_MODE_INSERT:
+ return INSERT;
+
+ case CommonConst.REGISTER_PLACE_MODE_UPDATE:
+ return UPDATE;
+
+ case CommonConst.REGISTER_PLACE_MODE_DELETE:
+ return DELETE;
+
+ default:
+ throw new IllegalArgumentException("argument out of range");
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/enums/WebPageEnum.java
===================================================================
--- kdc/src/main/java/com/kdc/common/enums/WebPageEnum.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/enums/WebPageEnum.java (revision 2)
@@ -0,0 +1,45 @@
+package com.kdc.common.enums;
+
+import com.kdc.common.util.CommonConst;
+
+/**
+ * 画面一覧Enum
+ */
+public enum WebPageEnum {
+ /** ログイン */
+ LOGIN("login", "ログイン"),
+ /** メイン */
+ MAIN("main", "メイン"),
+// /** 共通設定 */
+// COMMONCONFIG("commonconfig", "共通設定"),
+ /** 管理設定 */
+ AUTHCONFIG("authconfig", "管理設定"),
+ /** ユーザ設定 */
+ USERCONFIG("userconfig", "ユーザ設定"),
+ /** 場所管理 */
+ PLACECONFIG("placeconfig", "場所設定"),
+ /** 履歴 */
+ RECORD("record", "履歴");
+
+ final String id;
+ final String name;
+
+ private WebPageEnum(String id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getPageTitleLabel() {
+ return new StringBuilder().append(CommonConst.KDC_SYSTEM_DISP_NAME).append("  ").append(this.name).append("画面")
+ .toString();
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/util/CommonConst.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/CommonConst.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/CommonConst.java (revision 2)
@@ -0,0 +1,273 @@
+package com.kdc.common.util;
+
+/**
+ * 共通定数クラス.
+ */
+public class CommonConst {
+
+ /** キッズコントロールシステムタイトル */
+ public static final String KDC_SYSTEM_TITLE = "kidcontrol";
+ /** キッズコントロールシステム表示名 */
+ public static final String KDC_SYSTEM_DISP_NAME = "キッズコントロール";
+
+ /** アクセスポイントURL共通部:API */
+ public static final String API_BASE_URL = "/api";
+ /** アクセスポイントURL共通部:サーバ */
+ public static final String WEB_BASE_URL = "/web";
+
+ /** システムモジュールファイル格納ディレクトリパス */
+ // TODO:本番環境に合わせて変更
+ //public static final String SYSTEM_MODULE_PATH = "C:/Shared01/kidcontrol/module/";
+ public static final String SYSTEM_MODULE_PATH = "/Shared01/kidcontrol/module/";
+
+ /** システム設定ファイル名 */
+ public static final String SYSTEM_INI_FILE_NAME = "kidcontrol.ini";
+
+ /** アプリインストールパッケージ(APK)ファイル名 */
+ public static final String APK_FILE_NAME = "kidcontrol.apk";
+
+ /** ユーザデフォルトアイコン画像格納ディレクトリ */
+ public static final String USER_ICON_DIR = "icon/user/";
+ /** 場所アイコン画像格納ディレクトリ */
+ public static final String PLACE_ICON_DIR = "icon/place/";
+ /** マーカーアイコン画像格納ディレクトリ */
+ public static final String MARKER_ICON_DIR = "icon/marker/";
+ /** アイコン画像表示用(Base64) */
+ public static final String ICON_IMG_HEADER = "data:image/png;base64,";
+ /** アイコン画像の幅 */
+ public static final int ICON_WIDTH = 40;
+ /** アイコン画像の高さ */
+ public static final int ICON_HEIGHT = 40;
+
+ /** 結果コード:正常処理 */
+ public static final Integer RESULT_CD_SUCCESS = 0;
+ /** 結果コード:処理失敗 */
+ public static final Integer RESULT_CD_FAILED = 1;
+
+ /** IDヘッダ文字:場所ID */
+ public static final String ID_HEADER_PLACE = "P";
+ /** IDヘッダ文字:設定ID */
+ public static final String ID_HEADER_CONFIG = "C";
+
+ /** フラグ項目:ON */
+ public static final Integer FLG_ON = 1;
+ /** フラグ項目:OFF */
+ public static final Integer FLG_OFF = 0;
+ /** グループID(初期値:1) */
+ public static final String GROUP_ID_1 = "1";
+
+ /*-------- 列挙値 --------*/
+ /** API識別ID:ログイン */
+ public static final int API_ID_LOGIN = 1;
+ /** API識別ID:ユーザ登録 */
+ public static final int API_ID_REGISTER_USER = 2;
+ /** API識別ID:位置情報送信 */
+ public static final int API_ID_SEND_LOCATION = 3;
+ /** API識別ID:ユーザ位置情報取得 */
+ public static final int API_ID_GET_LOCATIONS = 4;
+ /** API識別ID:場所情報取得 */
+ public static final int API_ID_GET_PLACES = 5;
+ /** API識別ID:ユーザ履歴情報取得 */
+ public static final int API_ID_GET_RECORDS = 6;
+ /** API識別ID:設定取得 */
+ public static final int API_ID_GET_CONFIG = 7;
+ /** API識別ID:SOS発信 */
+ public static final int API_ID_SEND_SOS_ALERT = 8;
+ /** API識別ID:場所登録 */
+ public static final int API_ID_REGISTER_PLACE = 9;
+ /** API識別ID:ユーザ情報変更 */
+ public static final int API_ID_SETTING_USER = 10;
+ /** API識別ID:アイコン画像ダウンロード */
+ public static final int API_ID_DL_USERICON = 11;
+ /** API識別ID:招待コード発行 */
+ public static final int API_ID_GET_INVITATION = 12;
+ /** API識別ID:招待コード認証 */
+ public static final int API_ID_CHECK_INVITATION = 13;
+ /** API識別ID:APKダウンロード */
+ public static final int API_ID_DL_APK = 14;
+ /** API識別ID:ログアウト */
+ public static final int API_ID_LOGOUT = 15;
+ /** API識別ID:グループ情報取得 */
+ public static final int API_ID_GET_GROUPS = 16;
+ /** API識別ID:グループ登録 */
+ public static final int API_ID_REGISTER_GROUP = 17;
+ /** API識別ID:通知情報登録 */
+ public static final int API_ID_REGISTER_NOTIFICATION = 18;
+ /** API識別ID:通知情報取得 */
+ public static final int API_ID_GET_NOTIFICATIONS = 19;
+ /** API識別ID:チェックユーザ */
+ public static final int API_ID_CHECK_USER = 20;
+ /** API識別ID:(管理者用機能)全ユーザ情報取得 */
+ public static final int API_ID_ADMIN_GET_ALLUSER = 101;
+ /** API識別ID:(管理者用機能)他ユーザ情報変更 */
+ public static final int API_ID_ADMIN_SETTING_USER = 102;
+ /** API識別ID:(管理者用機能)ユーザ削除 */
+ public static final int API_ID_ADMIN_DELUSER = 103;
+ /** API識別ID:サーバ処理(API以外でPush通知を返す特殊番号) */
+ public static final int API_ID_SERVER_PROCESS = 999;
+
+ /** 管理レベル:ゲスト */
+ public static final int AUTH_LEVEL_GUEST = 1;
+ /** 管理レベル:子供 */
+ public static final int AUTH_LEVEL_CHILD = 2;
+ /** 管理レベル:大人 */
+ public static final int AUTH_LEVEL_ADULT = 3;
+ /** 管理レベル:管理者 */
+ public static final int AUTH_LEVEL_ADMIN = 4;
+
+ /** Push通知種別:ユーザアイコン */
+ public static final int PUSH_NOFITICATION_USERICON = 1;
+ /** Push通知種別:SOS */
+ public static final int PUSH_NOFITICATION_SOS = 2;
+ /** Push通知種別:バッテリー */
+ public static final int PUSH_NOFITICATION_BATTERY = 3;
+ /** Push通知種別:接続切断 */
+ public static final int PUSH_NOFITICATION_DISCONNECT = 4;
+ /** Push通知種別:接続回復 */
+ public static final int PUSH_NOFITICATION_RECONNECT = 5;
+ /** Push通知種別:場所進入(通常場所) */
+ public static final int PUSH_NOFITICATION_PLACE_NORMAL_IN = 6;
+ /** Push通知種別:場所進入(危険な場所) */
+ public static final int PUSH_NOFITICATION_PLACE_DANGER_IN = 7;
+ /** Push通知種別:場所退出(通常場所) */
+ public static final int PUSH_NOFITICATION_PLACE_NORMAL_OUT = 8;
+ /** Push通知種別:場所退出(危険な場所) */
+ public static final int PUSH_NOFITICATION_PLACE_DANGER_OUT = 9;
+ /** Push通知種別:設定変更(サーバ処理) */
+ public static final int PUSH_NOFITICATION_CHANGE_CONFIG = 10;
+
+ /** 通知タイプ:音のみ */
+ public static final int NOTIFICATION_TYPE_SOUND_ONLY = 0;
+ /** 通知タイプ:バイブのみ */
+ public static final int NOTIFICATION_TYPE_VIBRATION_ONLY = 1;
+ /** 通知タイプ:音+バイブ */
+ public static final int NOTIFICATION_TYPE_SOUND_AND_VIBRATION = 2;
+
+ /** 電波状況:Wi-Fi */
+ public static final int RECEPTION_STATUS_WIFI = 1;
+ /** 電波状況:LTE */
+ public static final int RECEPTION_STATUS_LTE = 2;
+ /** 電波状況:4G */
+ public static final int RECEPTION_STATUS_4G = 3;
+ /** 電波状況:3G */
+ public static final int RECEPTION_STATUS_3G = 4;
+ /** 電波状況:5G */
+ public static final int RECEPTION_STATUS_5G = 5;
+ /** 電波状況:WiMAX */
+ public static final int RECEPTION_STATUS_WIMAX = 6;
+
+ /** 接続可否:切断 */
+ public static final int CONNECTION_STATUS_DISCONNECT = 0;
+ /** 接続可否:接続 */
+ public static final int CONNECTION_STATUS_CONNECT = 1;
+
+ /** 場所登録モード:登録 */
+ public static final int REGISTER_PLACE_MODE_INSERT = 1;
+ /** 場所登録モード:変更 */
+ public static final int REGISTER_PLACE_MODE_UPDATE = 2;
+ /** 場所登録モード:削除 */
+ public static final int REGISTER_PLACE_MODE_DELETE = 3;
+
+ /** 場所種別:通常場所 */
+ public static final int PLACE_TYPE_NORMAL = 0;
+ /** 場所種別:危険な場所 */
+ public static final int PLACE_TYPE_DANGER = 1;
+
+ /** 認証モード:ログイン */
+ public static final int AUTHENTICATION_MODE_LOGIN = 1;
+ /** 認証モード:ユーザ登録 */
+ public static final int AUTHENTICATION_MODE_REGISTER_USER = 2;
+ /** 認証モード:新規グループ作成 */
+ public static final int AUTHENTICATION_MODE_NEW_GROUP = 3;
+ /** 認証 招待コード:1111111(ユーザーが存在しない場合にスルーさせる) **/
+ public static final String INVITATION_CD = "1111111";
+
+ /** グループ登録モード:登録 */
+ public static final int REGISTER_GROUP_MODE_INSERT = 1;
+ /** グループ登録モード:変更 */
+ public static final int REGISTER_GROUP_MODE_UPDATE = 2;
+ /** グループ登録モード:削除 */
+ public static final int REGISTER_GROUP_MODE_DELETE = 3;
+
+ /** 通知情報登録モード:登録 */
+ public static final int REGISTER_NOTIFICATION_MODE_INSERT = 1;
+ /** グループ登録モード:変更 */
+ public static final int REGISTER_NOTIFICATION_MODE_UPDATE = 2;
+ /** グループ登録モード:削除 */
+ public static final int REGISTER_NOTIFICATION_MODE_DELETE = 3;
+
+ /*-------- 設定区分 --------*/
+ /** 設定区分ID:初期パスワード */
+ public static final int CONFIG_ID_INIT_PASSWORD = 0;
+ /** 設定区分ID:SOSカウントダウン秒数 */
+ public static final int CONFIG_ID_SOS_COUNTDOWN = 1;
+ /** 設定区分ID:端末切断時間(分) */
+ public static final int CONFIG_ID_DISCONNECT_TIME = 2;
+ /** 設定区分ID:バージョン情報 */
+ public static final int CONFIG_ID_VERSION_NO = 3;
+ /** 設定区分ID:Push通知再送信待機時間(分) */
+ public static final int CONFIG_ID_PUSH_NOTIFICATION_INTERVAL_TIME = 4;
+ /** 設定区分ID:招待コード有効期間(分) */
+ public static final int CONFIG_ID_INVITATION_CODE_EXPIRATION_TIME = 5;
+
+ /*-------- デフォルト値 --------*/
+ // /** デフォルト値:グループID */
+ // public static final String DEFAULT_GROUP_ID = "1";
+
+ /** デフォルト値:通知音時間 */
+ public static final Integer DEFAULT_NOTIFICATION_TIME_SOUND = 3;
+ /** デフォルト値:通知バイブ時間 */
+ public static final Integer DEFAULT_NOTIFICATION_TIME_VIBRATION = 3;
+ /** デフォルト値:バッテリー通知基準値 */
+ public static final Integer DEFAULT_NOTIFICATION_BATTERY = 30;
+
+ /** デフォルト値:GoogleMap初期表示座標 */
+ public static final String DEFAULT_MAP_LATITUDE = "35.632899";
+ public static final String DEFAULT_MAP_LONGITUDE = "139.880458";
+ public static final String DEFAULT_MAP_ZOOM = "15";
+
+ /** デフォルト値:GoogleMap上に配置する場所の円の半径 */
+ public static final Integer DEFAULT_PLACE_RADIUS = 10;
+ public static final Integer PLACE_RADIUS_MIN = 10;
+ public static final Integer PLACE_RADIUS_MAX = 1000;
+
+ /*-------- その他定数値 --------*/
+ /** 招待コードの桁数 */
+ public static final int INVITATION_CODE_LENGTH = 7;
+ /** ユーザIDの最大文字数 */
+ public static final int USER_ID_MAX_LENGTH = 15;
+ /** パスワードの最大文字数 */
+ public static final int PASSWORD_MAX_LENGTH = 15;
+ /** ユーザ名の最大文字数 */
+ public static final int USER_NAME_MAX_LENGTH = 15;
+ /** グループIDの最大文字数 */
+ public static final int GROUP_ID_MAX_LENGTH = 15;
+ /** 場所名の最大文字数 */
+ public static final int PLACE_NAME_MAX_LENGTH = 15;
+ /** グループ名の最大文字数 */
+ public static final int GROUP_NAME_MAX_LENGTH = 15;
+ /** 通知日の最大文字数 */
+ public static final int NOTIFICATION_DATE_MAX_LENGTH = 8;
+ /** 通知時間の最大文字数 */
+ public static final int NOTIFICATION_TIME_MAX_LENGTH = 4;
+ /** 電話番号の桁数(ハイフン無し) */
+ public static final int TELEPHONE_NUMBER_LENGTH = 11;
+
+ /** 送信間隔の曜日当たり設定可能件数 */
+ public static final int SEND_INTERVAL_CONFIG_COUNT = 5;
+
+ /*-------- 内部処理用 --------*/
+ /** PostgreSQL SQLSTATE:一意制約違反 */
+ public static final String SQLSTATE_UNIQUE_VIOLATION = "23505";
+
+ /** WGS84測地系 赤道半径 */
+ public static final double WGS84_EQU_RAD = 6378137.000000;
+ /** WGS84測地系 極半径 */
+ public static final double WGS84_POL_RAD = 6356752.314245;
+
+ /*-------- 2018/11/20仕様追加 初期ユーザチェック用 --------*/
+ /** 初期ユーザ存在チェック用:存在しない */
+ public static final int CHECK_USER_NOT_EXIST = 0;
+ /** 初期ユーザ存在チェック用:存在する */
+ public static final int CHECK_USER_EXIST = 1;
+}
Index: kdc/src/main/java/com/kdc/common/util/CommonService.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/CommonService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/CommonService.java (revision 2)
@@ -0,0 +1,310 @@
+package com.kdc.common.util;
+
+import java.security.SecureRandom;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ResourceLoader;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.base.DeviceInfoCoreEntity;
+import com.kdc.common.entity.api.base.RequestBaseEntity;
+import com.kdc.common.entity.api.base.ResponseBaseEntity;
+import com.kdc.common.entity.api.base.UserInfoCoreEntity;
+import com.kdc.common.entity.db.InvitationManagementEntity;
+import com.kdc.common.entity.db.UserDeviceEntity;
+import com.kdc.common.entity.db.UserMasterEntity;
+import com.kdc.common.enums.AuthLevelEnum;
+import com.kdc.mybatis.mapper.common.entity.InvitationManagementMapper;
+import com.kdc.mybatis.mapper.common.entity.UserDeviceMapper;
+import com.kdc.mybatis.mapper.common.entity.UserMasterMapper;
+import com.kdc.mybatis.mapper.common.util.CommonServiceMapper;
+
+/**
+ * 共通サービスクラス.
+ */
+@Service
+public class CommonService {
+
+ @Autowired
+ private UserMasterMapper userMasterMapper;
+
+ @Autowired
+ private UserDeviceMapper userDeviceMapper;
+
+ @Autowired
+ private InvitationManagementMapper invitationManagementMapper;
+
+ @Autowired
+ private CommonServiceMapper commonServiceMapper;
+
+ @Autowired
+ ResourceLoader resourceLoader;
+
+ /**
+ * 共通パラメータチェック.
+ *
+ * @param reqEntity
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean checkBaseParameter(RequestBaseEntity reqEntity, ResponseBaseEntity resEntity) {
+
+ // ユーザ情報
+ if (reqEntity.getUserInfo() == null) {
+ resEntity.setMessage("userInfo is Empty");
+ return false;
+ }
+ // 単項目チェック
+ if (!this.checkUserInfoValues(reqEntity.getUserInfo(), resEntity)) {
+ return false;
+ }
+ // 存在チェック
+ if (!this.checkUserExists(reqEntity.getUserInfo(), resEntity)) {
+ return false;
+ }
+
+ // 端末情報
+ if (reqEntity.getDeviceInfo() == null) {
+ resEntity.setMessage("deviceInfo is Empty");
+ return false;
+ }
+ // 単項目チェック
+ if (!this.checkDeviceInfoValues(reqEntity.getDeviceInfo(), resEntity)) {
+ return false;
+ }
+ // 存在チェック
+ if (!this.checkDeviceExists(reqEntity.getDeviceInfo(), resEntity)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * ユーザ情報単項目チェック.
+ *
+ * @param userInfoCore
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean checkUserInfoValues(UserInfoCoreEntity userInfoCore, ResponseBaseEntity resEntity) {
+ // 必須チェック
+ if (StringUtils.isEmpty(userInfoCore.getUserId())) {
+ resEntity.setMessage("userInfo.userId is Empty");
+ return false;
+ }
+ if (StringUtils.isEmpty(userInfoCore.getGroupId())) {
+ resEntity.setMessage("userInfo.groupId is Empty");
+ return false;
+ }
+ if (StringUtils.isEmpty(userInfoCore.getAuthLevel())) {
+ resEntity.setMessage("userInfo.authLevel is Empty");
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * ユーザ存在チェック.
+ *
+ * @param userInfo
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean checkUserExists(UserInfoCoreEntity userInfo, ResponseBaseEntity resEntity) {
+ // ユーザ情報変更時に対応するためIDのみで認証
+ UserMasterEntity entity = this.userMasterMapper.selectByPk(userInfo.getUserId(), CommonConst.FLG_OFF);
+ if (entity == null) {
+ resEntity.setMessage("userInfo not exists");
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * 管理者権限判定.
+ *
+ * @param userInfo
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean isAdminUser(UserInfoCoreEntity userInfo, ResponseBaseEntity resEntity) {
+ if (!StringUtils.equals(userInfo.getAuthLevel(), Integer.toString(AuthLevelEnum.ADMIN.getCode()))) {
+ resEntity.setMessage("unauthorized user");
+ return false;
+ }
+ UserMasterEntity entity = this.userMasterMapper.selectUser(userInfo.getUserId(), userInfo.getPassword(),
+ CommonConst.FLG_OFF);
+ if (entity == null) {
+ resEntity.setMessage("userInfo not exists");
+ return false;
+ }
+ if (!AuthLevelEnum.ADMIN.equals(AuthLevelEnum.valueOf(entity.getAuthlevel()))) {
+ resEntity.setMessage("unauthorized user");
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * 端末情報単項目チェック.
+ *
+ * @param deviceInfoCore
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean checkDeviceInfoValues(DeviceInfoCoreEntity deviceInfoCore, ResponseBaseEntity resEntity) {
+ // 必須チェック
+ if (StringUtils.isEmpty(deviceInfoCore.getTelephoneNumber())) {
+ resEntity.setMessage("deviceInfo.telephoneNumber is Empty");
+ return false;
+ }
+ if (StringUtils.isEmpty(deviceInfoCore.getDeviceId())) {
+ resEntity.setMessage("deviceInfo.deviceId is Empty");
+ return false;
+ }
+
+ // 電話番号チェック
+//2018/1/12 DEL umemoto SIMなしの場合は端末ID(15桁)が入るため。
+// if (StringUtils.length(deviceInfoCore.getTelephoneNumber()) != CommonConst.TELEPHONE_NUMBER_LENGTH) {
+// resEntity.setMessage("deviceInfo.telephoneNumber is Wrong");
+// return false;
+// }
+
+ return true;
+ }
+
+ /**
+ * 端末存在チェック.
+ *
+ * @param deviceInfo
+ * @param resEntity
+ * @return Boolean
+ */
+ public Boolean checkDeviceExists(DeviceInfoCoreEntity deviceInfo, ResponseBaseEntity resEntity) {
+ UserDeviceEntity entity = this.userDeviceMapper.selectDevice(deviceInfo.getTelephoneNumber(),
+ CommonConst.FLG_OFF);
+ if (entity != null && KdcCommonUtils.nullSafeEquals(deviceInfo.getUserId(), entity.getUserid())
+ && KdcCommonUtils.nullSafeEquals(deviceInfo.getDeviceId(), entity.getDeviceid())) {
+ return true;
+ }
+ resEntity.setMessage("deviceInfo not exists");
+ return false;
+ }
+
+ /**
+ * 既存ユーザと重複しないように色の文字列リストを取得する.
+ *
+ * @param count
+ * 要求件数
+ * @return RGB値を16進表現した文字列のリスト
+ */
+ public List<String> getNewColors(int count) {
+ String[] rgb = { "00", "33", "66", "99", "CC", "FF" };
+ String red = "";
+ String green = "";
+ String blue = "";
+ List<String> colorList = new ArrayList<>();
+ List<String> usedColorList = new ArrayList<>();
+ StringBuilder colorCode = new StringBuilder();
+ Random rand = new SecureRandom();
+
+ // 使用されているライン表示色のリストを取得
+ List<UserMasterEntity> list = this.userMasterMapper.selectAll(CommonConst.FLG_OFF);
+ for (UserMasterEntity entity : list) {
+ usedColorList.add(entity.getLinecolor());
+ }
+
+ for (int i = 0; i < count; i++) {
+ while (true) {
+ // RED
+ red = rgb[rand.nextInt(6)];
+ // GREEN
+ green = rgb[rand.nextInt(6)];
+ // BLUE
+ blue = rgb[rand.nextInt(6)];
+ // グレースケール色(R/G/Bの値が同一)は除外するのでやり直し
+ if (StringUtils.equals(red, green) && StringUtils.equals(red, blue)) {
+ continue;
+ }
+ colorCode.append(red).append(green).append(blue);
+ // 色が重複していないことを確認
+ for (String usedColor : usedColorList) {
+ if (StringUtils.equals(colorCode, usedColor)) {
+ continue;
+ }
+ }
+ break;
+ }
+ colorList.add(colorCode.toString());
+ // 使用中の色として追加
+ usedColorList.add(colorCode.toString());
+ colorCode.setLength(0); // 複数の色を取得すると落ちるので、一旦クリア
+ }
+
+ return colorList;
+ }
+
+ /**
+ * 招待コードを生成する.
+ *
+ * @return
+ */
+ public String createInvitationCode() {
+ List<String> usedCodeList = new ArrayList<>();
+ StringBuilder invitationCode = new StringBuilder();
+ Random rand = new SecureRandom();
+
+ // 使用されているコードのリストを取得
+ List<InvitationManagementEntity> list = this.invitationManagementMapper.selectValidCode();
+ for (InvitationManagementEntity entity : list) {
+ usedCodeList.add(entity.getInvitationcode());
+ }
+
+ while (true) {
+ for (int i = 0; i < CommonConst.INVITATION_CODE_LENGTH; i++) {
+ invitationCode.append(rand.nextInt(10));
+ }
+ // コード重複していないことを確認
+ for (String usedCode : usedCodeList) {
+ if (StringUtils.equals(invitationCode, usedCode)) {
+ continue;
+ }
+ }
+ break;
+ }
+
+ return invitationCode.toString();
+ }
+
+ /**
+ * ユーザシーケンス番号取得.
+ *
+ * @return
+ */
+ public int getUserIdSeq() {
+ return this.commonServiceMapper.getUserIdSeq();
+ }
+
+ /**
+ * 場所ID発番.
+ *
+ * @return
+ */
+ public String createPlaceId() {
+ return CommonConst.ID_HEADER_PLACE + String.format("%012d", this.commonServiceMapper.getPlaceIdSeq());
+ }
+
+ /**
+ * グループID発番.
+ *
+ * @return
+ */
+ public String createGroupId() {
+ return String.valueOf(this.commonServiceMapper.getGroupIdSeq());
+ }
+
+}
\ No newline at end of file
Index: kdc/src/main/java/com/kdc/common/util/CronSetting.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/CronSetting.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/CronSetting.java (revision 2)
@@ -0,0 +1,30 @@
+package com.kdc.common.util;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * cron設定ファイル読込処理.
+ */
+@Component
+@ConfigurationProperties(prefix = "cron")
+public class CronSetting {
+
+ private String connectTask;
+
+ /**
+ * @return connectTask
+ */
+ public String getConnectTask() {
+ return connectTask;
+ }
+
+ /**
+ * @param connectTask
+ * セットする connectTask
+ */
+ public void setConnectTask(String connectTask) {
+ this.connectTask = connectTask;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/util/IconDataSet.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/IconDataSet.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/IconDataSet.java (revision 2)
@@ -0,0 +1,40 @@
+package com.kdc.common.util;
+
+/**
+ * アイコン画像データクラス.
+ */
+public class IconDataSet {
+
+ private String iconName;
+ private byte[] iconData;
+
+ /**
+ * @return iconName
+ */
+ public String getIconName() {
+ return iconName;
+ }
+
+ /**
+ * @param iconName
+ * セットする iconName
+ */
+ public void setIconName(String iconName) {
+ this.iconName = iconName;
+ }
+
+ /**
+ * @return iconData
+ */
+ public byte[] getIconData() {
+ return iconData;
+ }
+
+ /**
+ * @param iconData
+ * セットする iconData
+ */
+ public void setIconData(byte[] iconData) {
+ this.iconData = iconData;
+ }
+}
Index: kdc/src/main/java/com/kdc/common/util/KdcCommonUtils.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/KdcCommonUtils.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/KdcCommonUtils.java (revision 2)
@@ -0,0 +1,851 @@
+package com.kdc.common.util;
+
+import java.awt.AlphaComposite;
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Toolkit;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+import java.awt.image.AreaAveragingScaleFilter;
+import java.awt.image.BufferedImage;
+import java.awt.image.FilteredImageSource;
+import java.awt.image.ImageFilter;
+import java.awt.image.ImageProducer;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.math.BigDecimal;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import javax.imageio.ImageIO;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.tomcat.util.http.fileupload.IOUtils;
+import org.springframework.stereotype.Component;
+import com.kdc.common.entity.api.base.DeviceInfoEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.db.PlaceMasterEntityWrapper;
+import com.kdc.common.enums.ApiIdEnum;
+
+/**
+ * キッズコントロール用ユーティリティクラス.
+ */
+@Component
+public class KdcCommonUtils {
+
+ private static DateTimeFormatter DATEFORMAT_DATETIME = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
+ private static DateTimeFormatter DATEFORMAT_DATE = DateTimeFormatter.ofPattern("yyyyMMdd");
+ private static DateTimeFormatter DATEFORMAT_TIME = DateTimeFormatter.ofPattern("HHmm");
+ private static DateTimeFormatter DATEFORMAT_TIME_DISP = DateTimeFormatter.ofPattern("H:mm");
+ private static DateTimeFormatter DATEFORMAT_TIME_HMS_DISP = DateTimeFormatter.ofPattern("H:mm:ss");
+ private static DateTimeFormatter DATEFORMAT_CALENDARDATE = DateTimeFormatter.ofPattern("yyyy.MM.dd E");
+
+ private static double WGS84_ECC_POW2 = (Math.pow(CommonConst.WGS84_EQU_RAD, 2)
+ - Math.pow(CommonConst.WGS84_POL_RAD, 2)) / Math.pow(CommonConst.WGS84_EQU_RAD, 2);
+ private static double WGS84_MARC_CON = CommonConst.WGS84_EQU_RAD * (1 - WGS84_ECC_POW2);
+
+ private static Map<String, String> propertyMap = new HashMap<>();
+
+ public static UserColorSet[] USER_COLOR_LIST;
+
+ /**
+ * プロパティ情報を取得.
+ *
+ * @param key
+ * @return 設定ファイルのプロパティ情報
+ */
+ public static String getProperty(String key) {
+ if (propertyMap.isEmpty()) {
+ loadPropertiesFromIni();
+ }
+ if (propertyMap.containsKey(key)) {
+ return propertyMap.get(key);
+ } else {
+ return loadPropertiesFromIni(key);
+ }
+ }
+
+ /**
+ * 設定ファイルからプロパティ情報をロードする
+ */
+ public static void loadPropertiesFromIni() {
+ try {
+ Properties properties = getPropertyFile();
+ // Mapに格納
+ for (Map.Entry<Object, Object> e : properties.entrySet()) {
+ propertyMap.put(e.getKey().toString(), e.getValue().toString());
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return;
+ }
+
+ /**
+ * 設定ファイルからキーを指定してプロパティ情報をロードする
+ *
+ * @param key
+ * @return プロパティ情報配列
+ */
+ public static String loadPropertiesFromIni(String key) {
+ String value = new String();
+ try {
+ value = getPropertyFile().getProperty(key, null);
+ if (StringUtils.isNotEmpty(value)) {
+ propertyMap.put(key, value);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return value;
+ }
+
+ /**
+ * プロパティファイルを取得する
+ *
+ * @return プロパティ情報
+ * @throws IOException
+ */
+ public static Properties getPropertyFile() throws IOException {
+ Properties properties = new Properties();
+ // プロパティファイルのパスを指定する
+ String strpass = CommonConst.SYSTEM_MODULE_PATH + CommonConst.SYSTEM_INI_FILE_NAME;
+
+ InputStream istream = new FileInputStream(strpass);
+ InputStreamReader ireader = new InputStreamReader(istream, "SJIS");
+ properties.load(ireader);
+ istream.close();
+
+ return properties;
+ }
+
+ /**
+ * 現在日時のTimestamp値を取得
+ *
+ * @return 現在日時Timestampの文字列
+ */
+ public static Timestamp getNowTimestamp() {
+ return Timestamp.valueOf(LocalDateTime.now().withNano(0));
+ }
+
+ /**
+ * 現在日時文字列(YYYYMMDDHHMISS)を取得
+ *
+ * @return 現在日時yyyyMMddHHmmssの文字列
+ */
+ public static String getNowDateTimeString() {
+ return LocalDateTime.now().format(DATEFORMAT_DATETIME);
+ }
+
+ /**
+ * 現在日付文字列(YYYYMMDD)を取得
+ *
+ * @return 現在日時yyyyMMddの文字列
+ */
+ public static String getNowDateString() {
+ return LocalDateTime.now().format(DATEFORMAT_DATE);
+ }
+
+ /**
+ * Timestamp値を日時文字列(YYYYMMDDHHMISS)に変換
+ *
+ * @param srcTimestamp
+ * @return 日時yyyyMMddHHmmssの文字列
+ */
+ public static String timestampToDateTimeString(Timestamp srcTimestamp) {
+ if (srcTimestamp == null) {
+ return null;
+ }
+ return srcTimestamp.toLocalDateTime().format(DATEFORMAT_DATETIME);
+ }
+
+ /**
+ * Timestamp値を日付文字列(YYYYMMDD)に変換
+ *
+ * @param srcTimestamp
+ * @return 日時yyyyMMddの文字列
+ */
+ public static String timestampToDateString(Timestamp srcTimestamp) {
+ if (srcTimestamp == null) {
+ return null;
+ }
+ return srcTimestamp.toLocalDateTime().format(DATEFORMAT_DATE);
+ }
+
+ /**
+ * Time値を時分文字列(HHMI)に変換
+ *
+ * @param srcTime
+ * @return 時間HHmmの文字列
+ */
+ public static String timeToHourMinuteString(Time srcTime) {
+ if (srcTime == null) {
+ return null;
+ }
+ return srcTime.toLocalTime().format(DATEFORMAT_TIME);
+ }
+
+ /**
+ * Time値を表示用時分文字列(H:MI)に変換
+ *
+ * @param srcTime
+ * @return 時間H:mmの文字列
+ */
+ public static String timeToHourMinuteStringForDisp(Time srcTime) {
+ if (srcTime == null) {
+ return null;
+ }
+ return srcTime.toLocalTime().format(DATEFORMAT_TIME_DISP);
+ }
+
+ /**
+ * Timestamp値を表示用時刻文字列(H:MI:SS)に変換
+ *
+ * @param srcTimestamp
+ * @return 時間H:mm:ssの文字列
+ */
+ public static String timeToTimeStringForDisp(Timestamp srcTimestamp) {
+ if (srcTimestamp == null) {
+ return null;
+ }
+ return srcTimestamp.toLocalDateTime().format(DATEFORMAT_TIME_HMS_DISP);
+ }
+
+ /**
+ * Timestamp値をカレンダー表示用文字列に変換
+ *
+ * @param srcTimestamp
+ * @return 日時yyyy.MM.dd Eの文字列
+ */
+ public static String timestampToCalendarDateString(Timestamp srcTimestamp) {
+ if (srcTimestamp == null) {
+ return null;
+ }
+ return srcTimestamp.toLocalDateTime().format(DATEFORMAT_CALENDARDATE);
+ }
+
+ /**
+ * 日時文字列(YYYYMMDDHHMISS)をTimestamp値に変換
+ *
+ * @param srcString
+ * @return 日時yyyyMMddHHmmssのTimestamp値
+ */
+ public static Timestamp dateTimeStringToTimestamp(String srcString) {
+ if (isEmpty(srcString)) {
+ return null;
+ }
+ try {
+ LocalDateTime dateTime = LocalDateTime.parse(srcString, DATEFORMAT_DATETIME);
+ return Timestamp.valueOf(dateTime);
+ } catch (DateTimeParseException e) {
+ // 時間部分指定無しの場合は00:00:00扱いで変換可
+ return dateStringToTimestamp(srcString);
+ }
+ }
+
+ /**
+ * 日付文字列(YYYYMMDD)をTimestamp値に変換
+ *
+ * @param srcString
+ * @return 日時yyyyMMddのTimestamp値
+ */
+ public static Timestamp dateStringToTimestamp(String srcString) {
+ if (isEmpty(srcString)) {
+ return null;
+ }
+ try {
+ LocalDate date = LocalDate.parse(srcString, DATEFORMAT_DATE);
+ return Timestamp.valueOf(date.atTime(LocalTime.MIN));
+ } catch (DateTimeParseException e) {
+ return null;
+ }
+ }
+
+ /**
+ * 時分文字列(HHMI)をTime値に変換
+ *
+ * @param srcString
+ * @return 日時HHmmのTime値
+ */
+ public static Time hourMinuteStringToTime(String srcString) {
+ if (isEmpty(srcString)) {
+ return null;
+ }
+ try {
+ LocalTime time = LocalTime.parse(srcString, DATEFORMAT_TIME);
+ return Time.valueOf(time);
+ } catch (DateTimeParseException e) {
+ return null;
+ }
+ }
+
+ /**
+ * 表示用時分文字列(HH:MI)をTime値に変換
+ *
+ * @param srcString
+ * @return 日時H:mmのTime値
+ */
+ public static Time hourMinuteStringForDispToTime(String srcString) {
+ if (isEmpty(srcString)) {
+ return null;
+ }
+ try {
+ LocalTime time = LocalTime.parse(srcString, DATEFORMAT_TIME_DISP);
+ return Time.valueOf(time);
+ } catch (DateTimeParseException e) {
+ // 通常の時分文字列も変換可
+ return hourMinuteStringToTime(srcString);
+ }
+ }
+
+ /**
+ * 日時文字列(YYYYMMDDHHMISS)が正しい形式かどうか判定する.
+ *
+ * @param srcString
+ * @return 判定結果
+ */
+ public static boolean checkDateTimeString(String srcString) {
+ if (isEmpty(srcString)) {
+ return false;
+ }
+ try {
+ LocalDateTime.parse(srcString, DATEFORMAT_DATETIME);
+ return true;
+ } catch (DateTimeParseException e) {
+ return false;
+ }
+ }
+
+ /**
+ * 日付文字列(YYYYMMDD)が正しい形式かどうか判定する.
+ *
+ * @param srcString
+ * @return 判定結果
+ */
+ public static boolean checkDateString(String srcString) {
+ if (isEmpty(srcString)) {
+ return false;
+ }
+ try {
+ LocalDate.parse(srcString, DATEFORMAT_DATE);
+ return true;
+ } catch (DateTimeParseException e) {
+ return false;
+ }
+ }
+
+ /**
+ * 時分文字列(HHMI)が正しい形式かどうか判定する.
+ *
+ * @param srcString
+ * @return 判定結果
+ */
+ public static boolean checkHourMinuteString(String srcString) {
+ if (isEmpty(srcString)) {
+ return false;
+ }
+ try {
+ LocalTime.parse(srcString, DATEFORMAT_TIME);
+ return true;
+ } catch (DateTimeParseException e) {
+ return false;
+ }
+ }
+
+ /**
+ * あるTimestamp値から指定日時後のTimestamp値を取得
+ *
+ * @param srcTimestamp
+ * @param year
+ * @param month
+ * @param day
+ * @param hour
+ * @param minute
+ * @param second
+ * @return Timestamp値
+ */
+ public static Timestamp timestampPlusDateTime(Timestamp srcTimestamp, int year, int month, int day, int hour,
+ int minute, int second) {
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(srcTimestamp);
+ cal.add(Calendar.YEAR, year);
+ cal.add(Calendar.MONTH, month);
+ cal.add(Calendar.DAY_OF_MONTH, day);
+ cal.add(Calendar.HOUR, hour);
+ cal.add(Calendar.MINUTE, minute);
+ cal.add(Calendar.SECOND, second);
+ return new Timestamp(cal.getTime().getTime());
+ }
+
+ /**
+ * あるTimestamp値から指定年月日後のTimestamp値を取得
+ *
+ * @param srcTimestamp
+ * @param year
+ * @param month
+ * @param day
+ * @return Timestamp値
+ */
+ public static Timestamp timestampPlusDate(Timestamp srcTimestamp, int year, int month, int day) {
+ return timestampPlusDateTime(srcTimestamp, year, month, day, 0, 0, 0);
+ }
+
+ /**
+ * あるTimestamp値から指定時間後のTimestamp値を取得
+ *
+ * @param srcTimestamp
+ * @param hour
+ * @param minute
+ * @param second
+ * @return Timestamp値
+ */
+ public static Timestamp timestampPlusTime(Timestamp srcTimestamp, int hour, int minute, int second) {
+ return timestampPlusDateTime(srcTimestamp, 0, 0, 0, hour, minute, second);
+ }
+
+ /**
+ * String型のフラグ項目のON/OFFを判定
+ *
+ * @param flg
+ * @return 判定結果
+ */
+ public static boolean isFlgOn(String flg) {
+ return StringUtils.equals(flg, CommonConst.FLG_ON.toString());
+ }
+
+ /**
+ * IntegerフラグをBoolean値に変換
+ *
+ * @param flg
+ * @return 変換結果
+ */
+ public static boolean isFlgOn(Integer flg) {
+ return CommonConst.FLG_ON.equals(flg);
+ }
+
+ /**
+ * Boolean値をIntegerフラグに変換する.
+ *
+ * @param flg
+ * @return 変換結果
+ */
+ public static Integer valueFlg(boolean flg) {
+ return flg ? CommonConst.FLG_ON : CommonConst.FLG_OFF;
+ }
+
+ /**
+ * 拡張null判定。null、空文字に加えて文字列"null"もtrueと判定する.
+ *
+ * @param val
+ * 判定文字列
+ * @return 判定結果
+ */
+ public static boolean isEmpty(String val) {
+ if (StringUtils.isEmpty(val) || StringUtils.equals(val, "null")) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * 比較対象文字列が同一かどうかを判定する。 Nullと空文字、空文字とNull、NullとNull、空文字と空文字は同一とみなす.
+ *
+ * @param equalsFrom
+ * 比較文字列
+ * @param equalsTo
+ * 比較文字列
+ * @return 比較結果
+ */
+ public static boolean nullSafeEquals(String equalsFrom, String equalsTo) {
+ if (isEmpty(equalsFrom) && isEmpty(equalsTo)) {
+ return true;
+ }
+ return StringUtils.equals(equalsFrom, equalsTo);
+ }
+
+ /**
+ * nullの場合に、空値を返し、null以外の場合は引数を返す.
+ *
+ * @param val
+ * 変換対象数値
+ * @return 変換結果
+ */
+ public static String nullToEmpty(String val) {
+ if (isEmpty(val)) {
+ return "";
+ }
+ return val;
+ }
+
+ /**
+ * nullの場合に、0を返し、null以外の場合は引数を返す.
+ *
+ * @param val
+ * 変換対象数値
+ * @return 変換結果
+ */
+ public static String nullToZero(String val) {
+ if (isEmpty(val)) {
+ return "0";
+ }
+ return val;
+ }
+
+ /**
+ * nullまたは変換不能の場合にnullを返し、それ以外の場合はIntegerを返す
+ *
+ * @param val
+ * 変換対象数値
+ * @return 変換結果
+ */
+ public static Integer nullSafeParseInt(String val) {
+ try {
+ return isEmpty(val) ? null : Integer.parseInt(val);
+ } catch (NumberFormatException e) {
+ return null;
+ }
+ }
+
+ /**
+ * 2地点間の距離を算出.
+ *
+ * @param startLat
+ * 始点の緯度
+ * @param startLng
+ * 始点の経度
+ * @param endLat
+ * 終点の緯度
+ * @param endLng
+ * 終点の経度
+ * @return 距離(m)
+ */
+ public static String computeDistance(BigDecimal startLat, BigDecimal startLng, BigDecimal endLat,
+ BigDecimal endLng) {
+
+ Double dStartLat = startLat.doubleValue();
+ Double dStartLng = startLng.doubleValue();
+ Double dEndLat = endLat.doubleValue();
+ Double dEndLng = endLng.doubleValue();
+
+ Double mLat = Math.toRadians((dStartLat + dEndLat) / 2.000000);
+ Double dLat = Math.toRadians(dStartLat - dEndLat);
+ Double dLng = Math.toRadians(dStartLng - dEndLng);
+
+ Double w = Math.sqrt(1 - WGS84_ECC_POW2 * Math.pow(Math.sin(mLat), 2));
+
+ Double mRad = WGS84_MARC_CON / Math.pow(w, 3);
+ Double vRad = CommonConst.WGS84_EQU_RAD / w;
+
+ Double distance = Math.sqrt(Math.pow(dLat * mRad, 2) + Math.pow(dLng * vRad * Math.cos(mLat), 2));
+
+ return String.format("%.0f", distance);
+ }
+
+ /**
+ * 場所との重なり判定.
+ *
+ * @return 位置情報が場所の範囲内にある場合true
+ */
+ public static boolean userPlaceEngaged(BigDecimal locationLat, BigDecimal locationLng,
+ PlaceMasterEntityWrapper place) {
+ // 位置情報の座標と場所の中心座標との距離が半径以内ならば、場所の範囲内
+ int distance = Integer
+ .parseInt(computeDistance(locationLat, locationLng, place.getLatitude(), place.getLongitude()));
+ if (distance <= place.getRadius()) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * 新たなユーザ表示色セットを取得する.
+ */
+ public static UserColorSet getNewUserColorSet(int userSeq) {
+ if (USER_COLOR_LIST == null) {
+ int userColors = Integer.parseInt(nullToZero(getProperty("userColors")));
+ USER_COLOR_LIST = new UserColorSet[userColors];
+ for (int i = 1; i <= userColors; i++) {
+ String[] userColor = StringUtils.split(getProperty("userColor" + i), ",");
+ USER_COLOR_LIST[i - 1] = new UserColorSet(userColor[0], userColor[1], i);
+ }
+ }
+ int mod = Math.floorMod(userSeq - 1, USER_COLOR_LIST.length);
+ return USER_COLOR_LIST[mod];
+ }
+
+ /**
+ * マーカー表示色のint値を取得する
+ *
+ * @param rgb
+ * @return hsbvals[0]
+ */
+ public static int getMarkerColorFromRGB(String rgb) {
+ float[] hsbvals = { 0, 0, 0 };
+ int red = (int) Long.parseLong(StringUtils.substring(rgb, 0, 2), 16);
+ int green = (int) Long.parseLong(StringUtils.substring(rgb, 2, 4), 16);
+ int blue = (int) Long.parseLong(StringUtils.substring(rgb, 4, 6), 16);
+ Color.RGBtoHSB(red, green, blue, hsbvals);
+ return (int) hsbvals[0];
+ }
+
+ /**
+ * ユーザのデフォルトアイコンのリストを取得する.
+ *
+ * @return アイコンリスト
+ */
+ public static List<IconDataSet> getUserDefaultIconList() {
+ return getIconList(CommonConst.SYSTEM_MODULE_PATH + CommonConst.USER_ICON_DIR);
+ }
+
+ /**
+ * 場所アイコンのリストを取得する.
+ *
+ * @return アイコンリスト
+ */
+ public static List<IconDataSet> getPlaceIconList() {
+ return getIconList(CommonConst.SYSTEM_MODULE_PATH + CommonConst.PLACE_ICON_DIR);
+ }
+
+ /**
+ * マーカーアイコンのリストを取得する.
+ *
+ * @return アイコンリスト
+ */
+ public static List<IconDataSet> getMarkerIconList() {
+ return getIconList(CommonConst.SYSTEM_MODULE_PATH + CommonConst.MARKER_ICON_DIR);
+ }
+
+ /**
+ * 指定されたアイコン格納ディレクトリからアイコンのリストを取得する.
+ *
+ * @param iconDir
+ * ディレクトリパス
+ * @return アイコンリスト
+ */
+ private static List<IconDataSet> getIconList(String iconDir) {
+
+ List<IconDataSet> dataList = new ArrayList<>();
+
+ File baseDir = new File(iconDir);
+ File[] listOfFiles = baseDir.listFiles();
+
+ if (listOfFiles != null) {
+ for (File item : listOfFiles) {
+ if (item.isFile()) {
+ try {
+ IconDataSet data = new IconDataSet();
+ data.setIconName(StringUtils.substringBeforeLast(item.getName(), "."));
+ InputStream istream = new FileInputStream(item.getPath());
+ ByteArrayOutputStream outPutStream = new ByteArrayOutputStream();
+ IOUtils.copy(istream, outPutStream);
+ data.setIconData(KdcCommonUtils.scaleImage(outPutStream.toByteArray(), CommonConst.ICON_WIDTH,
+ CommonConst.ICON_HEIGHT, "png"));
+ istream.close();
+ dataList.add(data);
+ } catch (IOException e) {
+ e.getStackTrace();
+ }
+ }
+ }
+ }
+
+ return dataList;
+ }
+
+ /**
+ * 画像のバイトストリームデータをアイコン表示用サイズに整形したうえで、Base64文字列に変換する
+ *
+ * @param in
+ * 画像バイトストリーム
+ * @return Base64変換後の画像バイトデータ
+ */
+ public static String getIconStringBase64(byte[] in) {
+ if (in.length == 0) {
+ return "";
+ }
+ return Base64.getEncoder()
+ .encodeToString(scaleImage(in, CommonConst.ICON_WIDTH, CommonConst.ICON_HEIGHT, "png"));
+ }
+
+ /**
+ * 画像のバイトストリームをリサイズする
+ *
+ * @param in
+ * 画像バイトデータ
+ * @param width
+ * 画像バイトデータ
+ * @param height
+ * 画像バイトデータ
+ * @param formatName
+ * 画像バイトデータ
+ * @return 画像バイトストリーム
+ */
+ public static byte[] scaleImage(byte[] in, int width, int height, String formatName) {
+ try {
+ BufferedImage org = ImageIO.read(new ByteArrayInputStream(in));
+ ImageFilter filter = new AreaAveragingScaleFilter(width, height);
+ ImageProducer p = new FilteredImageSource(org.getSource(), filter);
+ java.awt.Image dstImage = Toolkit.getDefaultToolkit().createImage(p);
+ BufferedImage dst = new BufferedImage(dstImage.getWidth(null), dstImage.getHeight(null),
+ BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g = dst.createGraphics();
+
+ // 背景を透過色に設定してイメージを作成する
+ g.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 0.0f));
+ Rectangle2D.Double rect = new Rectangle2D.Double(0, 0, dst.getWidth(), dst.getHeight());
+ g.fill(rect);
+ g.setPaintMode();
+
+ g.drawImage(dstImage, 0, 0, null);
+ g.dispose();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ImageIO.write(dst, formatName, baos);
+ return baos.toByteArray();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ /**
+ * ユーザのアイコン画像を、マップ上のマーカーとして表示するアイコン画像に加工する.
+ *
+ * @param userIconFile
+ * アイコン画像ファイル
+ * @param markerColorId
+ * マーカー表示色
+ * @return base64でエンコードされたバイト配列
+ * @throws IOException
+ */
+ public static String createUserMarkerIconString(byte[] userIconFile, byte[] markerBaseFile) throws IOException {
+ // ユーザアイコン画像
+ BufferedImage userIconImg = ImageIO.read(new ByteArrayInputStream(userIconFile));
+ // ユーザアイコンを表示するマーカーアイコン画像
+ BufferedImage markerImage = ImageIO.read(new ByteArrayInputStream(markerBaseFile));
+
+ // ユーザアイコン画像を円型に切り取る
+ BufferedImage userChipImg = new BufferedImage(userIconImg.getWidth(), userIconImg.getHeight(),
+ BufferedImage.TYPE_INT_ARGB);
+ Graphics2D gr = userChipImg.createGraphics();
+ gr.setColor(new Color(0, 1F, 0, 1F));
+ RoundRectangle2D rr = new RoundRectangle2D.Double(7.0, 7.0, userIconImg.getWidth() - 15.5,
+ userIconImg.getHeight() - 15.5, 40, 40);
+ gr.fill(rr);
+ BasicStroke wideStroke = new BasicStroke(4.0f);
+ gr.setStroke(wideStroke);
+ gr.setComposite(AlphaComposite.SrcIn);
+ gr.drawImage(userIconImg, 0, 0, null);
+ gr.dispose();
+
+ // 切り取ったユーザアイコンをマーカーアイコンに重ねる
+ Graphics graphics1 = null;
+ graphics1 = markerImage.getGraphics();
+ int x = 0;
+ int y = -3;
+ graphics1.drawImage(userChipImg, x, y, null);
+
+ // 合成後の画像を保持
+ ByteArrayOutputStream byteImg = new ByteArrayOutputStream();
+ ImageIO.write(markerImage, "png", byteImg);
+
+ return Base64.getEncoder().encodeToString(byteImg.toByteArray());
+ }
+
+ /**
+ * API開始ログ出力
+ *
+ * @param api
+ * API識別ID
+ * @param userInfo
+ * ユーザ情報クラス
+ * @param deviceInfo
+ * 端末情報クラス
+ * @return ログ文字列
+ */
+ public static String getApiStartLog(ApiIdEnum api, UserInfoEntity userInfo, DeviceInfoEntity deviceInfo) {
+ StringBuilder logString = new StringBuilder();
+ logString.append("API Called:");
+ logString.append(api.toString());
+ logString.append(" UserId:");
+ logString.append(userInfo.getUserId());
+ logString.append(" TelephoneNumber:");
+ logString.append(deviceInfo.getTelephoneNumber());
+ return logString.toString();
+ }
+
+ /**
+ * API終了ログ出力
+ *
+ * @param api
+ * API識別ID
+ * @param userInfo
+ * ユーザ情報クラス
+ * @param deviceInfo
+ * 端末情報クラス
+ * @param status
+ * Httpレスポンスステータスコード
+ * @param resultCd
+ * 処理結果コード
+ * @return ログ文字列
+ */
+ public static String getApiEndLog(ApiIdEnum api, UserInfoEntity userInfo, DeviceInfoEntity deviceInfo,
+ Integer status, Integer resultCd) {
+ StringBuilder logString = new StringBuilder();
+ logString.append("API Complete:");
+ logString.append(api.toString());
+ logString.append(" UserId:");
+ logString.append(userInfo.getUserId());
+ logString.append(" TelephoneNumber:");
+ logString.append(deviceInfo.getTelephoneNumber());
+ logString.append(" Status:");
+ logString.append(status);
+ logString.append(" resultCd:");
+ logString.append(resultCd);
+ return logString.toString();
+ }
+
+ /**
+ * APIエラーログ出力
+ *
+ * @param api
+ * API識別ID
+ * @param userInfo
+ * ユーザ情報クラス
+ * @param deviceInfo
+ * 端末情報クラス
+ * @param error
+ * エラーコード
+ * @return ログ文字列
+ */
+ public static String getApiErrorLog(ApiIdEnum api, UserInfoEntity userInfo, DeviceInfoEntity deviceInfo,
+ String error) {
+ StringBuilder logString = new StringBuilder();
+ logString.append("API Failed:");
+ logString.append(api.toString());
+ logString.append(" UserId:");
+ logString.append(userInfo.getUserId());
+ logString.append(" TelephoneNumber:");
+ logString.append(deviceInfo.getTelephoneNumber());
+ logString.append(" Error:");
+ logString.append(error);
+ return logString.toString();
+ }
+}
Index: kdc/src/main/java/com/kdc/common/util/KdcJavaScriptUtils.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/KdcJavaScriptUtils.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/KdcJavaScriptUtils.java (revision 2)
@@ -0,0 +1,205 @@
+package com.kdc.common.util;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.WebRequest;
+import com.kdc.common.entity.web.GoogleMapParamEntity;
+
+/**
+ * JavaString操作ユーティリティクラス.
+ */
+@Component
+public class KdcJavaScriptUtils {
+
+ /**
+ * JavaScriptでURL文字列を組み立てるコードを返す.
+ *
+ * @param url
+ * url文字列
+ * @param paramMap
+ * 引数マップ
+ * @return URL文字列組み立てJavaScriptコード文字列 ({@code not null})
+ */
+ public static String getJsUrlBuilder(String url, LinkedHashMap<String, String> paramMap) {
+ // パラメータ文字列を生成
+ StringBuilder param = new StringBuilder();
+ for (Map.Entry<String, String> item : paramMap.entrySet()) {
+ param.append(param.length() == 0 ? ",\"?\"," : ",\"&\",");
+ param.append(String.format("\"%s\"", item.getKey())).append(",\"=\",");
+ param.append(item.getValue());
+ }
+ // URL を生成
+ StringBuilder js = new StringBuilder();
+ js.append("[");
+ js.append(String.format("\"%s\"", url));
+ js.append(param);
+ js.append("].join(\"\")");
+ return js.toString();
+ }
+
+ /**
+ * GoogleMap Javascript設定
+ */
+ public static String getJsGoogleMap(String mapCanvasName, GoogleMapParamEntity defaultMapParam, String eventJs) {
+ StringBuilder js = new StringBuilder();
+ js.append("var mapCanvas;\n");
+ js.append("var mapObj;\n");
+ js.append("var mapOps;\n");
+ js.append("var originalMarkerObj;\n");
+ js.append("var originalCircleObj;\n");
+ js.append("google.maps.event.addDomListener(window, 'load', function() {\n");
+ // Map初期設定
+ js.append(getJsInitMap(mapCanvasName, defaultMapParam)).append("\n");
+ // Mapイベント追加
+ js.append(eventJs);
+ js.append("});\n");
+ return js.toString();
+ }
+
+ /**
+ * GoogleMap 初期設定
+ *
+ * @param mapCanvasName
+ * @param mapParam
+ * @return js文字列
+ */
+ public static String getJsInitMap(String mapCanvasName, GoogleMapParamEntity mapParam) {
+ StringBuilder js = new StringBuilder();
+ js.append("mapCanvas = ");
+ js.append(String.format("document.getElementById('%s');\n", mapCanvasName));
+ js.append("mapOps = {");
+ js.append("zoom: ");
+ js.append(String.format("%d,", mapParam.getZoom()));
+ js.append("center: ");
+ js.append(String.format("new google.maps.LatLng(%s, %s),", mapParam.getLatitude(), mapParam.getLongitude()));
+ js.append("mapTypeId: google.maps.MapTypeId.ROADMAP");
+ js.append("};\n");
+ js.append("mapObj = new google.maps.Map(mapCanvas, mapOps);\n");
+ return js.toString();
+ }
+
+ /**
+ * GoogleMap クリックイベント追加
+ *
+ * @param eventJs
+ * @return js文字列
+ */
+ public static String getJsAddEventClick(String eventJs) {
+ StringBuilder js = new StringBuilder();
+ js.append("google.maps.event.addListener(mapObj, 'click', function(e) {\n");
+ js.append(eventJs);
+ js.append("})\n");
+ return js.toString();
+ }
+
+ /**
+ * マーカーの座標をGoogleMapに渡す.
+ *
+ * @return 座標設定js文字列
+ */
+ public static String getJsSetMarkerOnClick() {
+ StringBuilder js = new StringBuilder();
+ // js.append("markerObj =");
+ // js.append("new google.maps.Marker({");
+ // js.append("position: e.latLng,");
+ // js.append("map: mapObj");
+ // js.append("});\n");
+ js.append("var lat = e.latLng.lat();\n");
+ js.append("var lng = e.latLng.lng();\n");
+ js.append("originalMarkerObj.setPosition(new google.maps.LatLng(lat, lng));\n");
+ js.append("originalMarkerObj.setMap(mapObj);\n");
+ js.append("document.getElementById('latitude').value = lat;\n");
+ js.append("document.getElementById('longitude').value = lng;\n");
+ return js.toString();
+ }
+
+ /**
+ * 地図の中心座標をGoogleMapに渡す.
+ * @param editable
+ * @return 座標設定js文字列
+ */
+ public static String getJsSetCircleOnClick(boolean editable) {
+ StringBuilder js = new StringBuilder();
+ // js.append("var circleObj =");
+ // js.append("new google.maps.Circle({");
+ // js.append("center: e.latLng,");
+ // js.append("radius: 108,");
+ // js.append("draggable: true,");
+ // js.append("editable: true,");
+ // js.append("map: mapObj");
+ // js.append("});\n");
+ js.append("var lat = e.latLng.lat();\n");
+ js.append("var lng = e.latLng.lng();\n");
+ js.append("if(originalCircleObj){\n");
+ js.append("originalCircleObj.setCenter(new google.maps.LatLng(lat, lng));\n");
+ js.append("}else{\n");
+ js.append("var circleOpts = {");
+ js.append("center: new google.maps.LatLng(lat, lng),");
+ js.append(String.format("radius: %d,", CommonConst.DEFAULT_PLACE_RADIUS));
+ if (editable) {
+ js.append("draggable: true,");
+ js.append("editable: true,");
+ }
+ js.append("map: mapObj");
+ js.append("};\n");
+ js.append("originalCircleObj = new google.maps.Circle(circleOpts);\n");
+ if (editable) {
+ js.append("originalCircleObj.addListener(\"center_changed\", function(argument) {\n");
+ js.append("var lat = originalCircleObj.latLng.lat();\n");
+ js.append("var lng = originalCircleObj.latLng.lng();\n");
+ js.append("document.getElementById('latitude').value = lat;\n");
+ js.append("document.getElementById('longitude').value = lng;\n");
+ js.append("});\n");
+ js.append("originalCircleObj.addListener(\"radius_changed\", function(argument) {\n");
+ js.append("var rad = originalCircleObj.getRadius();\n");
+ js.append("document.getElementById('radius').value = rad;\n");
+ js.append("});\n");
+ }
+ js.append("};\n");
+ // js.append("originalCircleObj.setCenter(new google.maps.LatLng(lat,
+ // lng));\n");
+ // js.append(String.format("originalCircleObj.setRadius(%d);\n",
+ // CommonConst.DEFAULT_PLACE_RADIUS));
+ // js.append("originalCircleObj.setMap(mapObj);\n");
+ js.append("document.getElementById('latitude').value = lat;\n");
+ js.append("document.getElementById('longitude').value = lng;\n");
+ return js.toString();
+ }
+
+ /**
+ * Formのinputdata情報を取得する.
+ *
+ * @param request
+ * リクエスト情報
+ * @param name
+ * name
+ */
+ public static String getFormSerializeArrayName(WebRequest request, String name) {
+
+ int cnt = 0;
+ String result = "";
+ // 一覧表示複数選択チェックを初期化
+ while (!KdcCommonUtils.nullSafeEquals(request.getParameter("inputdata[" + cnt + "][name]"), "")) {
+ if (KdcCommonUtils.nullSafeEquals(
+ KdcCommonUtils.nullToEmpty(request.getParameter("inputdata[" + cnt + "][name]")), name)) {
+ result = request.getParameter("inputdata[" + cnt + "][value]");
+ break;
+ }
+ cnt++;
+ }
+
+ return result;
+ }
+
+ /**
+ * Formのチェックがonか比較する.
+ * @param formItem
+ * @return
+ */
+ public static boolean getFormItemChecked(String formItem) {
+ return StringUtils.equals(formItem, "on");
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/util/KdcScheduledService.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/KdcScheduledService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/KdcScheduledService.java (revision 2)
@@ -0,0 +1,235 @@
+package com.kdc.common.util;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+
+import com.kdc.common.entity.KdcAlertEntity;
+import com.kdc.common.entity.api.PushNotificationEntity;
+import com.kdc.common.entity.db.ConfigMasterEntity;
+import com.kdc.common.entity.db.GroupInfoEntity;
+import com.kdc.common.entity.db.UserAlertRecordEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.enums.AuthLevelEnum;
+import com.kdc.common.enums.PushNotificationEnum;
+import com.kdc.mybatis.mapper.common.entity.ConfigMasterMapper;
+import com.kdc.mybatis.mapper.common.entity.GroupMasterMapper;
+import com.kdc.mybatis.mapper.common.entity.UserAlertRecordMapper;
+import com.kdc.mybatis.mapper.common.util.KdcScheduledMapper;
+import com.kdc.mybatis.mapper.common.util.PushNotificationMapper;
+
+/**
+ * キッズコントロール 常駐タスク処理.
+ */
+@Controller
+public class KdcScheduledService {
+
+ private static final Logger logger = LoggerFactory.getLogger(KdcScheduledService.class);
+
+ @Autowired
+ private ConfigMasterMapper configMasterMapper;
+
+ @Autowired
+ private PushNotificationService pushNotificationService;
+
+ @Autowired
+ private PushNotificationMapper pushNotificationMapper;
+
+ @Autowired
+ private KdcScheduledMapper kdcScheduledMapper;
+
+ @Autowired
+ private UserAlertRecordMapper userAlertRecordMapper;
+
+ @Autowired
+ private GroupMasterMapper groupMasterMapper;
+
+ /**
+ * Push通知処理実行
+ */
+ public void doTask() {
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(nowTimestamp);
+ int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
+
+ //グループ番号ごとに判定、通知
+ List<GroupInfoEntity> groupList = groupMasterMapper.selectAll(CommonConst.FLG_OFF);
+ for ( int i = 0; i < groupList.size(); i++) {
+ String groupid = groupList.get(i).getGroupid();
+ // 送信間隔設定の対象時間外は何もしない
+ if (this.kdcScheduledMapper.searchUsingSendInterval(dayOfWeek, nowTimestamp,groupid) > 0) {
+
+ // 接続切断判定
+ this.kdcScheduledMapper.updateDisconnect(dayOfWeek, nowTimestamp, "system", groupid);
+
+ // 接続切断通知対象トークンIDの管理レベル別リスト
+ Map<AuthLevelEnum, List<PushNotificationEntity>> notifyMap = new LinkedHashMap<>();
+ for (AuthLevelEnum item : AuthLevelEnum.values()) {
+ notifyMap.put(item,
+ this.pushNotificationMapper.selectConnectionAlertTokenIdListByAuthLevel(item.getCode(),groupid));
+ }
+
+ // 設定マスタからパラメータ取得
+ List<ConfigMasterEntity> configList = new ArrayList<>();
+ // 切断判定の基準時間
+ configList = this.configMasterMapper.selectCodeList(CommonConst.CONFIG_ID_DISCONNECT_TIME,groupid);
+ int disconnectTime = (configList != null) ? Integer.parseInt(configList.get(0).getConfigparam1()) : 0;
+ // Push通知再送信待機時間
+ configList = this.configMasterMapper.selectCodeList(CommonConst.CONFIG_ID_PUSH_NOTIFICATION_INTERVAL_TIME,groupid);
+ int intervalTime = (configList != null)
+ ? Integer.parseInt(KdcCommonUtils.nullToZero(configList.get(0).getConfigparam1())) : 0;
+ boolean connectionNotificationOneTime = (configList != null)
+ ? KdcCommonUtils.isFlgOn(configList.get(0).getConfigparam3()) : false;
+
+ this.pushNotificationService.setApiKey();
+
+ // 接続切断Push通知
+ this.sendDisconnectionAlert(notifyMap, dayOfWeek, nowTimestamp, disconnectTime, intervalTime,
+ connectionNotificationOneTime);
+ // 接続回復Push通知
+ this.sendReconnectionAlert(notifyMap, dayOfWeek, nowTimestamp);
+ }
+ }
+ }
+
+ /**
+ * 接続切断通知.
+ *
+ * @param notifyMap
+ * 通知対象トークンIDの管理レベル別リスト
+ * @param dayOfWeek
+ * 曜日区分
+ * @param nowTimestamp
+ * 現在日時
+ * @param disconnectTime
+ * 切断時間
+ * @param intervalTime
+ * 再送信待機時間
+ * @param connectionNotificationOneTime
+ * 再接続判定結果
+ */
+ private void sendDisconnectionAlert(Map<AuthLevelEnum, List<PushNotificationEntity>> notifyMap, int dayOfWeek,
+ Timestamp nowTimestamp, int disconnectTime, int intervalTime,
+ boolean connectionNotificationOneTime) {
+ PushNotificationCounter counter = new PushNotificationCounter();
+ boolean sendNotify = false;
+
+ List<KdcAlertEntity> alertList = this.kdcScheduledMapper.searchUserOnDisconnectionAlert(dayOfWeek, nowTimestamp,
+ disconnectTime);
+ for (KdcAlertEntity alertEntity : alertList) {
+ UserAlertRecordEntity userAlertRecord = this.userAlertRecordMapper.selectByPk(alertEntity.getUserid(),
+ CommonConst.FLG_OFF);
+ if (userAlertRecord == null || userAlertRecord.getLastdisconnectionalertdate() == null) {
+ // 通知記録が無い=初回の通知は必ず送信
+ sendNotify = true;
+ } else if (connectionNotificationOneTime
+ && StringUtils.equals(KdcCommonUtils.timestampToDateString(nowTimestamp),
+ KdcCommonUtils.timestampToDateString(userAlertRecord.getLastdisconnectionalertdate()))) {
+ // 1日1回しか通知しない設定
+ sendNotify = false;
+ } else if (nowTimestamp.after(KdcCommonUtils
+ .timestampPlusTime(userAlertRecord.getLastdisconnectionalertdate(), 0, intervalTime, 0))) {
+ // 前回の通知時間から、再通知待機時間(分)が経過していれば通知する
+ sendNotify = true;
+ }
+
+ if (sendNotify) {
+ if (this.sendAlert(PushNotificationEnum.DISCONNECT, alertEntity, notifyMap, counter)) {
+ // 通知時間をDBに記録
+ this.pushNotificationService.upsertUserAlertRecord(PushNotificationEnum.DISCONNECT,
+ alertEntity.getUserid());
+ }
+ }
+ }
+ logger.info("接続切断Push通知 OK:" + counter.getSendCompleteCnt() + " NG:" + counter.getSendErrorCnt());
+ for (String token : counter.getErrorTokenList()) {
+ logger.info("Send Error:" + token);
+ }
+ }
+
+ /**
+ * 接続回復通知.
+ *
+ * @param notifyMap
+ * 通知対象トークンIDの管理レベル別リスト
+ * @param dayOfWeek
+ * 曜日区分
+ * @param nowTimestamp
+ * 現在日時
+ */
+ private void sendReconnectionAlert(Map<AuthLevelEnum, List<PushNotificationEntity>> notifyMap, int dayOfWeek,
+ Timestamp nowTimestamp) {
+ PushNotificationCounter counter = new PushNotificationCounter();
+
+ List<KdcAlertEntity> alertList = this.kdcScheduledMapper.searchUserOnReconnectionAlert(dayOfWeek, nowTimestamp);
+ for (KdcAlertEntity alertEntity : alertList) {
+ // 回復通知は再通知待機時間によらず送信する
+ if (this.sendAlert(PushNotificationEnum.RECONNECT, alertEntity, notifyMap, counter)) {
+ // 通知時間をDBに記録
+ this.pushNotificationService.upsertUserAlertRecord(PushNotificationEnum.RECONNECT,
+ alertEntity.getUserid());
+ }
+ }
+ logger.info("接続回復Push通知 OK:" + counter.getSendCompleteCnt() + " NG:" + counter.getSendErrorCnt());
+ for (String token : counter.getErrorTokenList()) {
+ logger.info("Send Error:" + token);
+ }
+ }
+
+ /**
+ * 通知対象トークンIDに対してPush通知.
+ *
+ * @param pushItem
+ * Push通知種別Enum
+ * @param alertEntity
+ * 通知クラス
+ * @param notifyMap
+ * 通知対象トークンIDの管理レベル別リスト
+ * @param counter
+ * Push通知結果カウントクラス
+ * @return
+ */
+ private Boolean sendAlert(PushNotificationEnum pushItem, KdcAlertEntity alertEntity,
+ Map<AuthLevelEnum, List<PushNotificationEntity>> notifyMap, PushNotificationCounter counter) {
+ boolean completeFlg = false;
+ Integer sendCompleteCnt = 0;
+ Integer sendErrorCnt = 0;
+ Integer sendExceptCnt = 0;
+
+ for (PushNotificationEntity notify : notifyMap.get(AuthLevelEnum.valueOf(alertEntity.getAuthlevel()))) {
+ if (StringUtils.isEmpty(notify.getTokenid())) {
+ sendExceptCnt++;
+ continue;
+ }
+ // Push通知作成&送信
+ if (!this.pushNotificationService.doPush(ApiIdEnum.SERVER_PROCESS, pushItem, alertEntity.getUserid(),
+ alertEntity.getUsername(), false, null, null, notify, logger)) {
+ counter.getErrorTokenList().add(notify.getTokenid());
+ sendErrorCnt++;
+ continue;
+ }
+ sendCompleteCnt++;
+ completeFlg = true;
+ }
+ counter.setSendCompleteCnt(sendCompleteCnt);
+ counter.setSendErrorCnt(sendErrorCnt);
+ counter.setSendExceptCnt(sendExceptCnt);
+ // 1件でも正常送信できていれば送信済みと判定する
+ if (completeFlg) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/util/PushNotificationCounter.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/PushNotificationCounter.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/PushNotificationCounter.java (revision 2)
@@ -0,0 +1,78 @@
+package com.kdc.common.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+
+/**
+ * Push通知結果カウントクラス.
+ */
+@Service
+public class PushNotificationCounter {
+
+ private Integer sendCompleteCnt = 0;
+ private Integer sendErrorCnt = 0;
+ private Integer sendExceptCnt = 0;
+ private List<String> errorTokenList = new ArrayList<>();
+
+ /**
+ * @return sendCompleteCnt
+ */
+ public Integer getSendCompleteCnt() {
+ return sendCompleteCnt;
+ }
+
+ /**
+ * @param sendCompleteCnt
+ * セットする sendCompleteCnt
+ */
+ public void setSendCompleteCnt(Integer sendCompleteCnt) {
+ this.sendCompleteCnt = sendCompleteCnt;
+ }
+
+ /**
+ * @return sendErrorCnt
+ */
+ public Integer getSendErrorCnt() {
+ return sendErrorCnt;
+ }
+
+ /**
+ * @param sendErrorCnt
+ * セットする sendErrorCnt
+ */
+ public void setSendErrorCnt(Integer sendErrorCnt) {
+ this.sendErrorCnt = sendErrorCnt;
+ }
+
+ /**
+ * @return sendExceptCnt
+ */
+ public Integer getSendExceptCnt() {
+ return sendExceptCnt;
+ }
+
+ /**
+ * @param sendExceptCnt
+ * セットする sendExceptCnt
+ */
+ public void setSendExceptCnt(Integer sendExceptCnt) {
+ this.sendExceptCnt = sendExceptCnt;
+ }
+
+ /**
+ * @return errorTokenList
+ */
+ public List<String> getErrorTokenList() {
+ return errorTokenList;
+ }
+
+ /**
+ * @param errorTokenList
+ * セットする errorTokenList
+ */
+ public void setErrorTokenList(List<String> errorTokenList) {
+ this.errorTokenList = errorTokenList;
+ }
+}
Index: kdc/src/main/java/com/kdc/common/util/PushNotificationService.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/PushNotificationService.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/PushNotificationService.java (revision 2)
@@ -0,0 +1,371 @@
+package com.kdc.common.util;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.sql.Timestamp;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kdc.common.entity.api.PushNotificationEntity;
+import com.kdc.common.entity.api.base.UserInfoEntity;
+import com.kdc.common.entity.db.PlaceAlertRecordEntity;
+import com.kdc.common.entity.db.PlaceMasterEntityWrapper;
+import com.kdc.common.entity.db.UserAlertRecordEntity;
+import com.kdc.common.enums.ApiIdEnum;
+import com.kdc.common.enums.PushNotificationEnum;
+import com.kdc.mybatis.mapper.common.entity.PlaceAlertRecordMapper;
+import com.kdc.mybatis.mapper.common.entity.UserAlertRecordMapper;
+
+/**
+ * Push通知サービス.
+ */
+@Service
+public class PushNotificationService {
+
+ private String apiKey;
+
+ @Autowired
+ private UserAlertRecordMapper userAlertRecordMapper;
+
+ @Autowired
+ private PlaceAlertRecordMapper placeAlertRecordMapper;
+
+ /**
+ * APIキーをロードする.
+ */
+ public void setApiKey() {
+ this.apiKey = KdcCommonUtils.getProperty("pushApiKey");
+ }
+
+ /**
+ * 通知対象トークンIDに対してPush通知.
+ *
+ * @param apiItem
+ * API識別ID Enum
+ * @param pushItem
+ * Push通知種別Enum
+ * @param user
+ * ユーザ情報クラス
+ * @param place
+ * 場所マスタクラス
+ * @param notifyList
+ * Push通知先クラスリスト
+ * @param counter
+ * Push通知結果カウントクラス
+ * @param logger
+ * ログ出力クラス
+ * @return 送信結果
+ */
+ public Boolean sendAlert(ApiIdEnum apiItem, PushNotificationEnum pushItem, UserInfoEntity user,
+ PlaceMasterEntityWrapper place, List<PushNotificationEntity> notifyList, PushNotificationCounter counter,
+ Logger logger) {
+ boolean completeFlg = false;
+ Integer sendCompleteCnt = 0;
+ Integer sendErrorCnt = 0;
+ Integer sendExceptCnt = 0;
+
+ for (PushNotificationEntity notify : notifyList) {
+ if (StringUtils.isEmpty(notify.getTokenid())) {
+ sendExceptCnt++;
+ continue;
+ }
+ // Push通知作成&送信
+ boolean doPushResult;
+ if (place != null) {
+ doPushResult = doPush(apiItem, pushItem, user.getUserId(), user.getUserName(), true, place.getPlaceid(),
+ place.getPlacename(), notify, logger);
+ } else {
+ doPushResult = doPush(apiItem, pushItem, user.getUserId(), user.getUserName(), false, null, null,
+ notify, logger);
+ }
+ if (!doPushResult) {
+ counter.getErrorTokenList().add(notify.getTokenid());
+ sendErrorCnt++;
+ continue;
+ }
+ sendCompleteCnt++;
+ completeFlg = true;
+ }
+ counter.setSendCompleteCnt(sendCompleteCnt);
+ counter.setSendErrorCnt(sendErrorCnt);
+ counter.setSendExceptCnt(sendExceptCnt);
+ // 1件でも正常送信できていれば送信済みと判定する
+ if (completeFlg) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * 通知対象トークンIDに対してPush通知.
+ *
+ * @param apiItem
+ * API識別ID Enum
+ * @param pushItem
+ * Push通知種別Enum
+ * @param userInfo
+ * ユーザ情報クラス
+ * @param notifyList
+ * Push通知先クラスリスト
+ * @param counter
+ * Push通知結果カウントクラス
+ * @param logger
+ * ログ出力クラス
+ * @return
+ */
+ public Boolean sendAlert(ApiIdEnum apiItem, PushNotificationEnum pushItem, UserInfoEntity userInfo,
+ List<PushNotificationEntity> notifyList, PushNotificationCounter counter, Logger logger) {
+ return sendAlert(apiItem, pushItem, userInfo, null, notifyList, counter, logger);
+ }
+
+ /**
+ * Push通知.
+ *
+ * @param apiItem
+ * API識別ID Enum
+ * @param pushItem
+ * Push通知種別Enum
+ * @param userId
+ * ユーザID
+ * @param userName
+ * ユーザ名
+ * @param placeRequired
+ * 場所が必須かどうか
+ * @param placeId
+ * 場所ID
+ * @param placeName
+ * 場所名
+ * @param entity
+ * Push通知クラス
+ * @param logger
+ * ログ出力クラス
+ * @return
+ */
+ public Boolean doPush(ApiIdEnum apiItem, PushNotificationEnum pushItem, String userId, String userName,
+ boolean placeRequired, String placeId, String placeName, PushNotificationEntity entity, Logger logger) {
+ if (StringUtils.isEmpty(this.apiKey)) {
+ this.setApiKey();
+ }
+
+ StringBuilder json = new StringBuilder();
+
+ json.append("{");
+ json.append("\"to\":");
+ json.append("\"").append(entity.getTokenid()).append("\"");
+ json.append(", ");
+ json.append("\"priority\":\"high\"");
+ json.append(", ");
+
+ // 主データ部
+ json.append("\"data\":");
+ json.append("{");
+ json.append("\"apiId\":");
+ json.append("\"").append(apiItem.getCode()).append("\"");
+ json.append(", ");
+ json.append("\"title\":");
+ json.append("\"").append(CommonConst.KDC_SYSTEM_TITLE).append("\"");
+ json.append(", ");
+ json.append("\"message\":");
+ json.append("\"").append(pushItem.getCode()).append("\"");
+ json.append(", ");
+ json.append("\"proccessKbn\":");
+ json.append("\"").append(pushItem.getCode()).append("\"");
+ json.append(", ");
+ json.append("\"userId\":");
+ json.append("\"").append(userId).append("\"");
+ json.append(", ");
+ json.append("\"userName\":");
+ json.append("\"").append(userName).append("\"");
+ json.append(", ");
+ if (placeRequired) {
+ json.append("\"placeId\":");
+ json.append("\"").append(placeId).append("\"");
+ json.append(", ");
+ json.append("\"placeName\":");
+ json.append("\"").append(placeName).append("\"");
+ json.append(", ");
+ }
+ json.append("\"notification\":");
+ json.append("\"").append(entity.getNotification()).append("\"");
+ json.append(", ");
+ json.append("\"popup\":");
+ json.append("\"").append(entity.getPopup()).append("\"");
+ json.append(", ");
+ json.append("\"alarmTime\":");
+ json.append("\"").append(entity.getAlarmtime()).append("\"");
+ json.append(", ");
+ json.append("\"vibrationTime\":");
+ json.append("\"").append(entity.getVibrationtime()).append("\"");
+ json.append("}");
+
+ json.append("}");
+
+ logger.info("JSON<" + json.toString() + ">");
+
+ // Firebaseサーバに対しメッセージ送信
+ try {
+ HttpURLConnection connection = null;
+ URL url = new URL("https://fcm.googleapis.com/fcm/send");
+ connection = (HttpURLConnection) url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setInstanceFollowRedirects(false);
+ connection.setRequestProperty("Accept-Language", "jp");
+ connection.setDoOutput(true);
+ connection.setRequestProperty("Content-Type", "application/json; charset=utf-8");
+ // FCM登録時のサーバーキー
+ // SSEテスト用
+ // String apiKey =
+ // "AAAAIRlf0Wg:APA91bHf-kz6mcJPgvkEhdlrENDJHlDD6o-LDbTzMS_SLkbRJIayRpTxLW9Gcf-d19_4HB3_Tf863cPdSHlmm0ubkxwethbeHZD-rf4PwYlFBl6RzCr8YIMfJZLfPV55-7O_xJO4GJWn";
+ // 検証環境用
+ // String apiKey =
+ // "AAAAO8yWyIk:APA91bHeXSUVsyz7Tvf_YeEqWhcbdW1VZsJhy7rYfMHFLJSBn9UsMKLltkOqWWn3czPQwff6GPNDQQ2kXJHWayB-WifNzYNzPYccBjwSq50Mgfy6BR526a6rCbLcVGiSlLryIvD8w5tI";
+ // 本番用
+ // String apiKey =
+ // "AAAAPHnWkLs:APA91bGouJhDOiupP10x9C6hW-htmi-IajL2xvKOGEFnZP7swr-RYPh7iqtcuiBIXabimPSfXzIUgsrdCLNnwcDBOiJaPjIX08q880kGS2mx7_XFTxUT51Q5B3na66UvwwwwQF3AqOtt";
+ connection.setRequestProperty("Authorization", "key=" + this.apiKey);
+ logger.info(this.apiKey);
+ logger.info(connection.toString());
+ OutputStream os = connection.getOutputStream();
+ PrintStream ps = new PrintStream(os);
+ ps.print(json.toString());
+ ps.close();
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
+
+ String buffer = reader.readLine();
+ connection.disconnect();
+
+ logger.info("results<" + buffer + ">");
+
+ // Firebaseサーバからの返信を解析して成功/失敗を判定
+ String[] resultItems = buffer.split(",", 0);
+ boolean successFlg = false;
+ boolean failureFlg = false;
+ for (String resultItem : resultItems) {
+ String[] resultKeyVal = resultItem.split(":", 0);
+ if (StringUtils.equals(StringUtils.remove(resultKeyVal[0], '\"'), "success")) {
+ if (Integer.parseInt(resultKeyVal[1]) > 0) {
+ successFlg = true;
+ }
+ } else if (StringUtils.equals(StringUtils.remove(resultKeyVal[0], '\"'), "failure")) {
+ if (Integer.parseInt(resultKeyVal[1]) > 0) {
+ failureFlg = true;
+ }
+ }
+ }
+ if (!successFlg || failureFlg) {
+ return false;
+ }
+ // ObjectMapper mapper = new ObjectMapper();
+ // FirebaseResultInfo resultInfo = mapper.readValue(buffer,
+ // FirebaseResultInfo.class);
+ /***
+ * JSONArray jsonArray = new JSONArray(buffer); for (int i = 0; i <
+ * jsonArray.length(); i++) { JSONObject jsonObject =
+ * jsonArray.getJSONObject(i); java.lang.System.out.println(
+ * "HTTP REQ" + jsonObject.getString("name")); }
+ ***/
+ } catch (MalformedURLException e) {
+ // e.printStackTrace();
+ logger.info(e.getMessage());
+ } catch (IOException e) {
+ // e.printStackTrace();
+ logger.info(e.getMessage());
+ }
+
+ return true;
+ }
+
+ /**
+ * 最終通知発信日時登録/更新.
+ *
+ * @param pushItem
+ * Push通知種別Enum
+ * @param userId
+ * ユーザID
+ * @return 登録/更新結果判定
+ */
+ public Boolean upsertUserAlertRecord(PushNotificationEnum pushItem, String userId) {
+
+ UserAlertRecordEntity rec = new UserAlertRecordEntity();
+
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+
+ switch (pushItem) {
+ case SOS:
+ rec.setLastsosalertdate(nowTimestamp);
+ break;
+ case BATTERY:
+ rec.setLastbatteryalertdate(nowTimestamp);
+ break;
+ case DISCONNECT:
+ rec.setLastdisconnectionalertdate(nowTimestamp);
+ break;
+ case RECONNECT:
+ rec.setLastreconnectionalertdate(nowTimestamp);
+ break;
+ default:
+ return false;
+ }
+
+ rec.setUserid(userId);
+ rec.setRegisteruserid(userId);
+ rec.setRegisterdate(nowTimestamp);
+ rec.setUpdateuserid(userId);
+ rec.setUpdatedate(nowTimestamp);
+ userAlertRecordMapper.upsert(rec);
+
+ return true;
+ }
+
+ /**
+ * 最終通知発信日時登録/更新.
+ *
+ * @param pushItem
+ * Push通知種別Enum
+ * @param userId
+ * ユーザID
+ * @param placeId
+ * 場所ID
+ * @return 登録/更新結果判定
+ */
+ public Boolean upsertPlaceAlertRecord(PushNotificationEnum pushItem, String userId, String placeId) {
+
+ PlaceAlertRecordEntity rec = new PlaceAlertRecordEntity();
+
+ Timestamp nowTimestamp = KdcCommonUtils.getNowTimestamp();
+
+ switch (pushItem) {
+ case PLACE_NORMAL_IN:
+ case PLACE_DANGER_IN:
+ rec.setLastplaceinalertdate(nowTimestamp);
+ break;
+ case PLACE_NORMAL_OUT:
+ case PLACE_DANGER_OUT:
+ rec.setLastplaceoutalertdate(nowTimestamp);
+ break;
+ default:
+ return false;
+ }
+
+ rec.setUserid(userId);
+ rec.setPlaceid(placeId);
+ rec.setRegisteruserid(userId);
+ rec.setRegisterdate(nowTimestamp);
+ rec.setUpdateuserid(userId);
+ rec.setUpdatedate(nowTimestamp);
+ placeAlertRecordMapper.upsert(rec);
+
+ return true;
+ }
+
+}
\ No newline at end of file
Index: kdc/src/main/java/com/kdc/common/util/UrlUtils.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/UrlUtils.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/UrlUtils.java (revision 2)
@@ -0,0 +1,74 @@
+package com.kdc.common.util;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+/**
+ * URL に係わるユーティリティクラス.
+ */
+@Component
+public class UrlUtils {
+
+ /**
+ * Spring MVC の View に対するリダイレクト指示の文字列を返す.
+ *
+ * @param path
+ * リダイレクト先のパス
+ * @return リダイレクト指示の文字列 ({@code not null})
+ */
+ public static String getRedirectString(String path) {
+ StringBuilder str = new StringBuilder();
+ str.append("redirect:").append(CommonConst.WEB_BASE_URL);
+ if (!path.startsWith("/")) {
+ str.append("/");
+ }
+ str.append(path);
+
+ return str.toString();
+ }
+
+ /**
+ * Spring MVC の View に対するフォワード指示の文字列を返す.
+ *
+ * @param path
+ * フォワード先のパス
+ * @return フォワード指示の文字列 ({@code not null})
+ */
+ public static String getForwardString(String path) {
+ StringBuilder str = new StringBuilder();
+ str.append("forward:/").append(CommonConst.WEB_BASE_URL);
+ if (!path.startsWith("/")) {
+ str.append("/");
+ }
+ str.append(path);
+
+ return str.toString();
+ }
+
+ /**
+ * Web 画面の URL 文字列を返す.
+ * <p>
+ * JavaScript や HTML などのリンクに使用する
+ * </p>
+ *
+ * @param path
+ * リンク先のパス
+ * @return URL文字列 ({@code not null})
+ */
+ public static String getWebLinkUrl(String path) {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes())
+ .getRequest();
+ StringBuilder str = new StringBuilder();
+ str.append(request.getContextPath());
+ if (!path.startsWith("/")) {
+ str.append("/");
+ }
+ str.append(path);
+
+ return str.toString();
+ }
+
+}
Index: kdc/src/main/java/com/kdc/common/util/UserColorSet.java
===================================================================
--- kdc/src/main/java/com/kdc/common/util/UserColorSet.java (nonexistent)
+++ kdc/src/main/java/com/kdc/common/util/UserColorSet.java (revision 2)
@@ -0,0 +1,183 @@
+package com.kdc.common.util;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * ユーザ表示色クラス.
+ */
+public class UserColorSet {
+
+ private String colorName;
+ private String lineColor;
+ private int markerColorId;
+
+ // private Color colorObj;
+
+ public UserColorSet(String colorName, String lineColor, int markerColorId) {
+ this.colorName = colorName;
+ this.lineColor = lineColor;
+ this.markerColorId = markerColorId;
+ // this.colorObj = new
+ // Color(Integer.parseInt(StringUtils.substring(lineColor, 2, 8), 16));
+ }
+
+ /**
+ * @return colorName
+ */
+ public String getColorName() {
+ return colorName;
+ }
+
+ /**
+ * @param colorName
+ * セットする colorName
+ */
+ public void setColorName(String colorName) {
+ this.colorName = colorName;
+ }
+
+ /**
+ * @return lineColor
+ */
+ public String getLineColor() {
+ return lineColor;
+ }
+
+ /**
+ * @param lineColor
+ * セットする lineColor
+ */
+ public void setLineColor(String lineColor) {
+ this.lineColor = lineColor;
+ }
+
+ /**
+ * @return markerColorId
+ */
+ public int getMarkerColorId() {
+ return markerColorId;
+ }
+
+ /**
+ * @param markerColorId
+ * セットする markerColorId
+ */
+ public void setMarkerColorId(int markerColorId) {
+ this.markerColorId = markerColorId;
+ }
+
+ /**
+ * @return ラインカラーのRGB領域
+ */
+ public String getLineColorRGBHex() {
+ return StringUtils.substring(this.lineColor, 2, 8);
+ }
+
+ /**
+ * @return ラインカラーのアルファ(透過)領域
+ */
+ public String getLineColorAlphaHex() {
+ return StringUtils.substring(this.lineColor, 0, 2);
+ }
+
+ /**
+ * @return ラインカラーの赤領域
+ */
+ public String getLineColorRedHex() {
+ return StringUtils.substring(this.lineColor, 2, 4);
+ }
+
+ /**
+ * @return ラインカラーの緑領域
+ */
+ public String getLineColorGreenHex() {
+ return StringUtils.substring(this.lineColor, 4, 6);
+ }
+
+ /**
+ * @return ラインカラーの青領域
+ */
+ public String getLineColorBlueHex() {
+ return StringUtils.substring(this.lineColor, 6, 8);
+ }
+
+ /**
+ * @return ラインカラーの透過領域
+ */
+ public double getLineColorAlpha() {
+ return ((int) Long.parseLong(this.getLineColorAlphaHex(), 16)) / (double) 255.0;
+ }
+
+ /**
+ * @return ラインカラー赤の16進数をLong型に変換
+ */
+ public int getLineColorRed() {
+ return (int) Long.parseLong(this.getLineColorRedHex(), 16);
+ }
+
+ /**
+ * @return ラインカラー緑の16進数をLong型に変換
+ */
+ public int getLineColorGreen() {
+ return (int) Long.parseLong(this.getLineColorGreenHex(), 16);
+ }
+
+ /**
+ * @return ラインカラー青の16進数をLong型に変換
+ */
+ public int getLineColorBlue() {
+ return (int) Long.parseLong(this.getLineColorBlueHex(), 16);
+ }
+
+ // /**
+ // * @return 赤のRGB値
+ // */
+ // public int getMarkerColorRed() {
+ // return this.colorObj.getRed();
+ // }
+ //
+ // /**
+ // * @return 緑のRGB値
+ // */
+ // public int getMarkerColorGreen() {
+ // return this.colorObj.getGreen();
+ // }
+ //
+ // /**
+ // * @return 青のRGB値
+ // */
+ // public int getMarkerColorBlue() {
+ // return this.colorObj.getBlue();
+ // }
+ //
+ // /**
+ // * @return マーカーカラーRGB16進数
+ // */
+ // public String getMarkerColorRGBHex() {
+ // return new
+ // StringBuilder().append(this.getMarkerColorRedHex()).append(this.getMarkerColorGreenHex())
+ // .append(this.getMarkerColorBlueHex()).toString();
+ // }
+ //
+ // /**
+ // * @return 16進数2桁の文字列に変換した赤のRGB値
+ // */
+ // public String getMarkerColorRedHex() {
+ // return String.format("%02x", this.getMarkerColorRed());
+ // }
+ //
+ // /**
+ // * @return 16進数2桁の文字列に変換した緑のRGB値
+ // */
+ // public String getMarkerColorGreenHex() {
+ // return String.format("%02x", this.getMarkerColorGreen());
+ // }
+ //
+ // /**
+ // * @return 16進数2桁の文字列に変換した青のRGB値
+ // */
+ // public String getMarkerColorBlueHex() {
+ // return String.format("%02x", this.getMarkerColorBlue());
+ // }
+
+}
Index: kdc/src/main/java/com/kdc/mybatis/domain/api/getlocations/UserInfoDomain.java
===================================================================
--- kdc/src/main/java/com/kdc/mybatis/domain/api/getlocations/UserInfoDomain.java (nonexistent)
+++ kdc/src/main/java/com/kdc/mybatis/domain/api/getlocations/UserInfoDomain.java (revision 2)
@@ -0,0 +1,342 @@
+package com.kdc.mybatis.domain.api.getlocations;
+
+import java.sql.Timestamp;
+
+public class UserInfoDomain {
+
+ // user_location ユーザ位置
+ private String latitude;
+ private String longitude;
+ private String movingdistance;
+ private String batterylevel;
+ private String receptionstatus;
+ private String connectionstatus;
+ private Timestamp lastlocationdate;
+
+ // user_master ユーザ情報
+ private String userid;
+ private String password;
+ private String username;
+ private String iconid;
+ private String groupid;
+ private String authlevel;
+ private String linecolor;
+ private String markercolor;
+
+ // user_notification ユーザ通知
+ private String locationdisplayflg;
+ private String movingdistancedisplayflg;
+ private String batteryleveldisplayflg;
+ private String accesstimedisplayflg;
+ private String receptionstatusdisplayflg;
+
+ // user_location_record ユーザ位置履歴
+ private String recordlatitude;
+ private String recordlongitude;
+ private String recordbatterylevel;
+ private String recordreceptionstatus;
+ private String recordreceivedate;
+
+ /**
+ * @return latitude
+ */
+ public String getLatitude() {
+ return latitude;
+ }
+ /**
+ * @param latitude セットする latitude
+ */
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
+ /**
+ * @return longitude
+ */
+ public String getLongitude() {
+ return longitude;
+ }
+ /**
+ * @param longitude セットする longitude
+ */
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
+ /**
+ * @return movingdistance
+ */
+ public String getMovingdistance() {
+ return movingdistance;
+ }
+ /**
+ * @param movingdistance セットする movingdistance
+ */
+ public void setMovingdistance(String movingdistance) {
+ this.movingdistance = movingdistance;
+ }
+ /**
+ * @return batterylevel
+ */
+ public String getBatterylevel() {
+ return batterylevel;
+ }
+ /**
+ * @param batterylevel セットする batterylevel
+ */
+ public void setBatterylevel(String batterylevel) {
+ this.batterylevel = batterylevel;
+ }
+ /**
+ * @return receptionstatus
+ */
+ public String getReceptionstatus() {
+ return receptionstatus;
+ }
+ /**
+ * @param receptionstatus セットする receptionstatus
+ */
+ public void setReceptionstatus(String receptionstatus) {
+ this.receptionstatus = receptionstatus;
+ }
+ /**
+ * @return connectionstatus
+ */
+ public String getConnectionstatus() {
+ return connectionstatus;
+ }
+ /**
+ * @param connectionstatus セットする connectionstatus
+ */
+ public void setConnectionstatus(String connectionstatus) {
+ this.connectionstatus = connectionstatus;
+ }
+ /**
+ * @return lastlocationdate
+ */
+ public Timestamp getLastlocationdate() {
+ return lastlocationdate;
+ }
+ /**
+ * @param lastlocationdate セットする lastlocationdate
+ */
+ public void setLastlocationdate(Timestamp lastlocationdate) {
+ this.lastlocationdate = lastlocationdate;
+ }
+ /**
+ * @return userid
+ */
+ public String getUserid() {
+ return userid;
+ }
+ /**
+ * @param userid セットする userid
+ */
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+ /**
+ * @return password
+ */
+ public String getPassword() {
+ return password;
+ }
+ /**
+ * @param password セットする password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+ /**
+ * @return username
+ */
+ public String getUsername() {
+ return username;
+ }
+ /**
+ * @param username セットする username
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+ /**
+ * @return iconid
+ */
+ public String getIconid() {
+ return iconid;
+ }
+ /**
+ * @param iconid セットする iconid
+ */
+ public void setIconid(String iconid) {
+ this.iconid = iconid;
+ }
+ /**
+ * @return groupid
+ */
+ public String getGroupid() {
+ return groupid;
+ }
+ /**
+ * @param groupid セットする groupid
+ */
+ public void setGroupid(String groupid) {
+ this.groupid = groupid;
+ }
+ /**
+ * @return authlevel
+ */
+ public String getAuthlevel() {
+ return authlevel;
+ }
+ /**
+ * @param authlevel セットする authlevel
+ */
+ public void setAuthlevel(String authlevel) {
+ this.authlevel = authlevel;
+ }
+ /**
+ * @return linecolor
+ */
+ public String getLinecolor() {
+ return linecolor;
+ }
+ /**
+ * @param linecolor セットする linecolor
+ */
+ public void setLinecolor(String linecolor) {
+ this.linecolor = linecolor;
+ }
+ /**
+ * @return markercolor
+ */
+ public String getMarkercolor() {
+ return markercolor;
+ }
+ /**
+ * @param markercolor セットする markercolor
+ */
+ public void setMarkercolor(String markercolor) {
+ this.markercolor = markercolor;
+ }
+ /**
+ * @return locationdisplayflg
+ */
+ public String getLocationdisplayflg() {
+ return locationdisplayflg;
+ }
+ /**
+ * @param locationdisplayflg セットする locationdisplayflg
+ */
+ public void setLocationdisplayflg(String locationdisplayflg) {
+ this.locationdisplayflg = locationdisplayflg;
+ }
+ /**
+ * @return movingdistancedisplayflg
+ */
+ public String getMovingdistancedisplayflg() {
+ return movingdistancedisplayflg;
+ }
+ /**
+ * @param movingdistancedisplayflg セットする movingdistancedisplayflg
+ */
+ public void setMovingdistancedisplayflg(String movingdistancedisplayflg) {
+ this.movingdistancedisplayflg = movingdistancedisplayflg;
+ }
+ /**
+ * @return batteryleveldisplayflg
+ */
+ public String getBatteryleveldisplayflg() {
+ return batteryleveldisplayflg;
+ }
+ /**
+ * @param batteryleveldisplayflg セットする batteryleveldisplayflg
+ */
+ public void setBatteryleveldisplayflg(String batteryleveldisplayflg) {
+ this.batteryleveldisplayflg = batteryleveldisplayflg;
+ }
+ /**
+ * @return accesstimedisplayflg
+ */
+ public String getAccesstimedisplayflg() {
+ return accesstimedisplayflg;
+ }
+ /**
+ * @param accesstimedisplayflg セットする accesstimedisplayflg
+ */
+ public void setAccesstimedisplayflg(String accesstimedisplayflg) {
+ this.accesstimedisplayflg = accesstimedisplayflg;
+ }
+ /**
+ * @return receptionstatusdisplayflg
+ */
+ public String getReceptionstatusdisplayflg() {
+ return receptionstatusdisplayflg;
+ }
+ /**
+ * @param receptionstatusdisplayflg セットする receptionstatusdisplayflg
+ */
+ public void setReceptionstatusdisplayflg(String receptionstatusdisplayflg) {
+ this.receptionstatusdisplayflg = receptionstatusdisplayflg;
+ }
+ /**
+ * @return recordlatitude
+ */
+ public String getRecordlatitude() {
+ return recordlatitude;
+ }
+ /**
+ * @param recordlatitude セットする recordlatitude
+ */
+ public void setRecordlatitude(String recordlatitude) {
+ this.recordlatitude = recordlatitude;
+ }
+ /**
+ * @return recordlongitude
+ */
+ public String getRecordlongitude() {
+ return recordlongitude;
+ }
+ /**
+ * @param recordlongitude セットする recordlongitude
+ */
+ public void setRecordlongitude(String recordlongitude) {
+ this.recordlongitude = recordlongitude;
+ }
+ /**
+ * @return recordbatterylevel
+ */
+ public String getRecordbatterylevel() {
+ return recordbatterylevel;
+ }
+ /**
+ * @param recordbatterylevel セットする recordbatterylevel
+ */
+ public void setRecordbatterylevel(String recordbatterylevel) {
+ this.recordbatterylevel = recordbatterylevel;
+ }
+ /**
+ * @return recordreceptionstatus
+ */
+ public String getRecordreceptionstatus() {
+ return recordreceptionstatus;
+ }
+ /**
+ * @param recordreceptionstatus セットする recordreceptionstatus
+ */
+ public void setRecordreceptionstatus(String recordreceptionstatus) {
+ this.recordreceptionstatus = recordreceptionstatus;
+ }
+ /**
+ * @return recordreceivedate
+ */
+ public String getRecordreceivedate() {
+ return recordreceivedate;
+ }
+ /**
+ * @param recordreceivedate セットする recordreceivedate
+ */
+ public void setRecordreceivedate(String recordreceivedate) {
+ this.recordreceivedate = recordreceivedate;
+ }
+
+}
+
Index: kdc/src/main/java/com/kdc/mybatis/domain/api/getplaces/PlaceInfoDomain.java
===================================================================
--- kdc/src/main/java/com/kdc/mybatis/domain/api/getplaces/PlaceInfoDomain.java (nonexistent)
+++ kdc/src/main/java/com/kdc/mybatis/domain/api/getplaces/PlaceInfoDomain.java (revision 2)
@@ -0,0 +1,25 @@
+package com.kdc.mybatis.domain.api.getplaces;
+
+import com.kdc.common.entity.db.PlaceMasterEntityWrapper;
+
+public class PlaceInfoDomain extends PlaceMasterEntityWrapper {
+
+ private String placedispflg;
+
+ /**
+ * @return placedispflg
+ */
+ public String getPlacedispflg() {
+ return placedispflg;
+ }
+
+ /**
+ * @param placedispflg セットする placedispflg
+ */
+ public void setPlacedispflg(String placedispflg) {
+ this.placedispflg = placedispflg;
+ }
+
+
+
+}
Index: kdc/src/main/java/com/kdc/mybatis/domain/web/webauthconfig/UserInfoDomain.java
===================================================================
--- kdc/src/main/java/com/kdc/mybatis/domain/web/webauthconfig/UserInfoDomain.java (nonexistent)
+++ kdc/src/main/java/com/kdc/mybatis/domain/web/webauthconfig/UserInfoDomain.java (revision 2)
@@ -0,0 +1,70 @@
+package com.kdc.mybatis.domain.web.webauthconfig;
+
+public class UserInfoDomain {
+
+ private String userid;
+ private String username;
+ private String authlevel;
+ private String telephonenumber;
+
+ /**
+ * @return userid
+ */
+ public String getUserid() {
+ return userid;
+ }
+
+ /**
+ * @param userid
+ * セットする userid
+ */
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+
+ /**
+ * @return username
+ */
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * @param username
+ * セットする username
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ /**
+ * @return authlevel
+ */
+ public String getAuthlevel() {
+ return authlevel;
+ }
+
+ /**
+ * @param authlevel
+ * セットする authlevel
+ */
+ public void setAuthlevel(String authlevel) {
+ this.authlevel = authlevel;
+ }
+
+ /**
+ * @return telephonenumber
+ */
+ public String getTelephonenumber() {
+ return telephonenumber;
+ }
+
+ /**
+ * @param telephonenumber
+ * セットする telephonenumber
+ */
+ public void setTelephonenumber(String telephonenumber) {
+ this.telephonenumber = telephonenumber;
+ }
+
+}
Index: kdc/src/main/java/com/kdc/mybatis/mapper/api/CheckInvitationCdMapper.java
===================================================================
--- kdc/src/main/java/com/kdc/mybatis/mapper/api/CheckInvitationCdMapper.java (nonexistent)
+++ kdc/src/main/java/com/kdc/mybatis/mapper/api/CheckInvitationCdMapper.java (revision 2)
@@ -0,0 +1,22 @@
+package com.kdc.mybatis.mapper.api;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import com.kdc.common.entity.db.InvitationManagementEntity;
+
+/**
+ * 招待コード認証API Mapperクラス
+ *
+ */
+@Mapper
+public interface CheckInvitationCdMapper {
+
+ /**
+ * 招待管理テーブル更新
+ * @param 招待管理テーブルクラス
+ * @return 更新件数
+ */
+ public int updateInvitationManagement(@Param("rec") InvitationManagementEntity rec);
+
+}
Index: kdc/src/main/java/com/kdc/mybatis/mapper/api/Ge