commit f8dfb4f52d4c1b22fa447b5262d99858dd66bc5a Author: GoblinsWang <806586736@qq.com> Date: Thu Mar 23 11:26:57 2023 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a0dceb --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** +.yml +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ +face-common/src/test/ +face-server/src/test/resources/ + +/.idea/workspace.xml +/.idea/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..1ef26ad --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# 不不不不v +``` +mvn install +``` + +#的点点滴滴 +``` +mvn clean +``` diff --git a/doc/face.PDM b/doc/face.PDM new file mode 100644 index 0000000..9ed3861 --- /dev/null +++ b/doc/face.PDM @@ -0,0 +1,9554 @@ + + + + + + + + + +90F6E7F8-C9CE-45FA-A6FC-EFEE42BCE6C6 +PhysicalDataModel_1 +PhysicalDataModel_1 +1573436673 +Mhb +1575889044 +Mhb +[FolderOptions] + +[FolderOptions\Physical Objects] +GenerationCheckModel=Yes +GenerationPath= +GenerationOptions= +GenerationTasks= +GenerationTargets= +GenerationSelections= +RevPkey=Yes +RevFkey=Yes +RevAkey=Yes +RevCheck=Yes +RevIndx=Yes +RevOpts=Yes +RevViewAsTabl=No +RevViewOpts=Yes +RevSystAsTabl=Yes +RevTablPerm=No +RevViewPerm=No +RevProcPerm=No +RevDbpkPerm=No +RevSqncPerm=No +RevAdtPerm=No +RevUserPriv=No +RevUserOpts=No +RevGrpePriv=No +RevRolePriv=No +RevDtbsOpts=Yes +RevDtbsPerm=No +RevViewIndx=Yes +RevJidxOpts=Yes +RevStats=No +RevTspcPerm=No +RevCaseSensitive=No +GenTrgrStdMsg=Yes +GenTrgrMsgTab= +GenTrgrMsgNo= +GenTrgrMsgTxt= +TrgrPreserve=No +TrgrIns=Yes +TrgrUpd=Yes +TrgrDel=Yes +TrgrC2Ins=Yes +TrgrC2Upd=Yes +TrgrC3=Yes +TrgrC4=Yes +TrgrC5=Yes +TrgrC6=Yes +TrgrC7=Yes +TrgrC8=Yes +TrgrC9=Yes +TrgrC10=Yes +TrgrC11=Yes +TrgrC1=Yes +TrgrC12Ins=Yes +TrgrC12Upd=Yes +TrgrC13=Yes +UpdateTableStatistics=Yes +UpdateColumnStatistics=Yes + +[FolderOptions\Physical Objects\Database Generation] +GenScriptName=face.sql +GenScriptName0= +GenScriptName1= +GenScriptName2= +GenScriptName3= +GenScriptName4= +GenScriptName5= +GenScriptName6= +GenScriptName7= +GenScriptName8= +GenScriptName9= +GenPathName=C:\Users\Mhb\Desktop\face\ +GenSingleFile=Yes +GenODBC=No +GenCheckModel=Yes +GenScriptPrev=Yes +GenArchiveModel=No +GenUseSync=No +GenSyncChoice=0 +GenSyncArch= +GenSyncRmg=0 + +[FolderOptions\Physical Objects\Database Generation\Format] +GenScriptTitle=No +GenScriptNamLabl=No +GenScriptQDtbs=No +GenScriptQOwnr=No +GenScriptCase=0 +GenScriptEncoding=UTF8 +GenScriptNAcct=No +IdentifierDelimiter=" + +[FolderOptions\Physical Objects\Database Generation\Database] +Create=Yes +Open=Yes +Close=Yes +Drop=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Database\Create] +Physical Options=Yes +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\Tablespace] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Tablespace\Create] +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\Storage] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\User] +Create=Yes +Drop=Yes +Comment=Yes +Privilege=No + +[FolderOptions\Physical Objects\Database Generation\User\Create] +Physical Options=No + +[FolderOptions\Physical Objects\Database Generation\Group] +Create=Yes +Drop=Yes +Comment=Yes +Privilege=No + +[FolderOptions\Physical Objects\Database Generation\Role] +Create=Yes +Drop=Yes +Privilege=No + +[FolderOptions\Physical Objects\Database Generation\UserDefinedDataType] +Create=Yes +Comment=Yes +Drop=Yes + +[FolderOptions\Physical Objects\Database Generation\UserDefinedDataType\Create] +Default value=Yes +Check=Yes + +[FolderOptions\Physical Objects\Database Generation\AbstractDataType] +Create=Yes +Header=Yes +Footer=Yes +Drop=Yes +Comment=Yes +Install JAVA class=Yes +Remove JAVA class=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Rule] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Default] +Create=Yes +Comment=Yes +Drop=Yes + +[FolderOptions\Physical Objects\Database Generation\Sequence] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Table&&Column] + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Table] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Table\Create] +Check=Yes +Physical Options=Yes +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Table\Create\Check] +Constraint declaration=No + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Column] +User datatype=No +Default value=Yes +Check=Yes +Physical Options=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Column\Check] +Constraint declaration=No + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key] + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Primary key] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Primary key\Create] +Constraint declaration=No +Physical Options=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Alternate key] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Alternate key\Create] +Constraint declaration=No +Physical Options=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Foreign key] +Create=No +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Foreign key\Create] +Constraint declaration=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Index] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Index\Create] +Constraint declaration=Yes +Physical Options=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Index\Filter] +Primary key=No +Foreign key=No +Alternate key=No +Cluster=Yes +Other=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Trigger] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Trigger\Filter] +For insert=Yes +For update=Yes +For delete=Yes +For other=Yes + +[FolderOptions\Physical Objects\Database Generation\View] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\View\Create] +Force Column list=No +Physical Options=Yes +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\View\ViewColumn] +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\View\ViewIndex] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\View\ViewIndex\Create] +Physical Options=Yes + +[FolderOptions\Physical Objects\Database Generation\View\ViewIndex\Filter] +Cluster=Yes +Other=Yes + +[FolderOptions\Physical Objects\Database Generation\View\Trigger] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\View\Trigger\Filter] +For insert=Yes +For update=Yes +For delete=Yes +For other=Yes + +[FolderOptions\Physical Objects\Database Generation\DBMSTrigger] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Synonym] +Create=Yes +Drop=Yes + +[FolderOptions\Physical Objects\Database Generation\Synonym\Filter] +Table=Yes +View=Yes +Proc=Yes +Synonym=Yes +Database Package=Yes +Sequence=Yes + +[FolderOptions\Physical Objects\Database Generation\JoinIndex] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\JoinIndex\Create] +Physical Options=Yes +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\Procedure] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Procedure\Create] +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\DatabasePackage] +Create=Yes +Drop=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\WebService] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Dimension] +Create=Yes +Drop=Yes + +[FolderOptions\Physical Objects\Database Generation\Synchronization] +GenBackupTabl=1 +GenKeepBackTabl=1 +GenTmpTablDrop=No +GenKeepTablOpts=No + +[FolderOptions\Physical Objects\Test Data] +GenDataPathName= +GenDataSinglefile=Yes +GenDataScriptName=testdata +GenDataScriptName0= +GenDataScriptName1= +GenDataScriptName2= +GenDataScriptName3= +GenDataScriptName4= +GenDataScriptName5= +GenDataScriptName6= +GenDataScriptName7= +GenDataScriptName8= +GenDataScriptName9= +GenDataOdbc=0 +GenDataDelOld=No +GenDataTitle=Yes +GenDataDefNumRows=20 +GenDataCommit=0 +GenDataPacket=0 +GenDataOwner=Yes +GenDataProfNumb= +GenDataProfChar= +GenDataProfDate= +GenDataCSVSeparator=, +GenDataFileFormat=CSV +GenDataUseWizard=No + +[FolderOptions\Pdm] +IndxIQName=%COLUMN%_%INDEXTYPE% +IndxPK=Yes +IndxFK=Yes +IndxAK=Yes +IndxPKName=%TABLE%_PK +IndxFKName=%REFR%_FK +IndxAKName=%AKEY%_AK +IndxPreserve=No +IndxThreshold=0 +IndxStats=No +RefrPreserve=No +JidxPreserve=No +RbldMultiFact=Yes +RbldMultiDim=Yes +RbldMultiJidx=Yes +CubePreserve=No +TablStProcPreserve=No +ProcDepPreserve=Yes +TrgrDepPreserve=Yes +CubeScriptPath= +CubeScriptCase=0 +CubeScriptEncoding=ANSI +CubeScriptNacct=No +CubeScriptHeader=No +CubeScriptExt=csv +CubeScriptExt0=txt +CubeScriptExt1= +CubeScriptExt2= +CubeScriptSep=, +CubeScriptDeli=" +EstimationYears=0 +DfltDomnName=D_%.U:VALUE% +DfltColnName=D_%.U:VALUE% +DfltReuse=Yes +DfltDrop=Yes + +[FolderOptions\CheckModel] + +[FolderOptions\CheckModel\Package] + +[FolderOptions\CheckModel\Package\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CheckPackageMissTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\DefaultCheckPackageMissTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CircularReference] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\ConstraintName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CnstMaxLen] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CircularDependency] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\ShortcutUniqCode] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Table] + +[FolderOptions\CheckModel\Table\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\UniqIndex] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\MaxLen - NAME] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyColl - COLNCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyColl - INDXCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyColl - KEYCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\SerialColumnNumber] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyCollYesYes] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\TableIndexes] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\Mapping] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\MappingSFMap] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyColl - PERMCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Table\CheckTablePartitionKey] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableStartDate] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableRefNoLifecycle] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableSourceMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTablePartialColumnMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableKeyColumnMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableNotOnLifecycleTablespace] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\MYSQL50_Table_Table_storage_type] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column] + +[FolderOptions\CheckModel\Table.Column\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\DomainDivergence] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\ColumnMandatory] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckNumParam] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckPrecSupLng] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckUndefDttp] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\FkeyDttpDivergence] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\FkeyCheckDivergence] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\ColnSqncNoKey] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\ColnSqncDttp] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\SerialColumnFK] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\ColumnCompExpr] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckColumnOneToOneMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckColumnDataTypeMapping] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckColumnNoMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckDttpIncompatibleFormat] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\MYSQL50_Column_Auto_increment_key] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\MYSQL50_Column_Datatype_attributes] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index] + +[FolderOptions\CheckModel\Table.Index\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\EmptyColl - CIDXCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\UndefIndexType] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\IndexColumnCount] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\IQIndxHNGUniq] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\CheckIncludeColl - Tabl] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\MYSQL50_Index_Fulltext_indexes_validity] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key] + +[FolderOptions\CheckModel\Table.Key\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\EmptyColl - COLNCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\CheckIncludeColl - Tabl] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\MultiKeySqnc] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger] + +[FolderOptions\CheckModel\Table.Trigger\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index] + +[FolderOptions\CheckModel\Join Index\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View] + +[FolderOptions\CheckModel\View\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\EmptyColl - PERMCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\View.View Index] + +[FolderOptions\CheckModel\View.View Index\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\EmptyColl - CIDXCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\IndexColumnCount] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\CheckIncludeColl - Tabl] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference] + +[FolderOptions\CheckModel\Reference\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\Reflexive] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\EmptyColl - RFJNCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\IncompleteJoin] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\JoinOrder] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference] + +[FolderOptions\CheckModel\View Reference\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\EmptyColl - VRFJNCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain] + +[FolderOptions\CheckModel\Domain\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckNumParam] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckPrecSupLng] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckUndefDttp] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckDttpIncompatibleFormat] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default] + +[FolderOptions\CheckModel\Default\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\DfltValeEmpty] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\DfltSameVale] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User] + +[FolderOptions\CheckModel\User\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\UniquePassword] +CheckSeverity=No +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Group] + +[FolderOptions\CheckModel\Group\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\EmptyColl - USERCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\UniquePassword] +CheckSeverity=No +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Role] + +[FolderOptions\CheckModel\Role\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\EmptyColl - USERCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure] + +[FolderOptions\CheckModel\Procedure\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\ProcBodyEmpty] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\EmptyColl - PERMCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\DBMS Trigger] + +[FolderOptions\CheckModel\DBMS Trigger\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\DbmsTriggerEvent] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source] + +[FolderOptions\CheckModel\Data Source\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\EmptyColl - MODLSRC] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\DtscTargets] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\CheckDataSourceModels] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Horizontal Partitioning] + +[FolderOptions\CheckModel\Horizontal Partitioning\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Horizontal Partitioning\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Horizontal Partitioning\EmptyColl - PARTCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Horizontal Partitioning\TargetTables] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Vertical Partitioning] + +[FolderOptions\CheckModel\Vertical Partitioning\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Vertical Partitioning\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Vertical Partitioning\EmptyColl - PARTCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Vertical Partitioning\TargetTables] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table Collapsing] + +[FolderOptions\CheckModel\Table Collapsing\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table Collapsing\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table Collapsing\EmptyColl - TargetTable] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table Collapsing\TargetTables] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact] + +[FolderOptions\CheckModel\Fact\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\EmptyColl - MEASCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\Mapping] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\MappingSFMap] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\EmptyColl - ALLOLINKCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\CubeDupAssociation] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension] + +[FolderOptions\CheckModel\Dimension\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\EmptyColl - DATTRCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\EmptyColl - HIERCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\DimnDupHierarchy] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\DimnDefHierarchy] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\Mapping] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\MappingSFMap] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\SerialColumnNumber] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association] + +[FolderOptions\CheckModel\Association\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\EmptyColl - Hierarchy] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute] + +[FolderOptions\CheckModel\Dimension.Attribute\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure] + +[FolderOptions\CheckModel\Fact.Measure\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy] + +[FolderOptions\CheckModel\Dimension.Hierarchy\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\EmptyColl - DATTRCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym] + +[FolderOptions\CheckModel\Synonym\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\MaxLen - NAME] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\EmptyColl - BASEOBJ] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type] + +[FolderOptions\CheckModel\Abstract Data Type\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\AdtInstantiable] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\AdtAbstractUsed] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure] + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\AdtProcUniqName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\UniqueDefinition] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\ReturnDataType] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package] + +[FolderOptions\CheckModel\Database Package\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\MaxLen - NAME] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\EmptyColl - PROCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\EmptyColl - CURCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package\EmptyColl - VARCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package\EmptyColl - TYPCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package\EmptyColl - EXCCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package.Database Package Procedure] + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\UniqueDefinition] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\EmptyColl - PARM] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\ReturnDataType] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence] + +[FolderOptions\CheckModel\Sequence\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor] + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\UniqueDefinition] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\ReturnDataType] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\EmptyColl - PARM] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package.Database Package Variable] + +[FolderOptions\CheckModel\Database Package.Database Package Variable\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\CheckUndefDttp] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type] + +[FolderOptions\CheckModel\Database Package.Database Package Type\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\UniqueDefinition] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception] + +[FolderOptions\CheckModel\Database Package.Database Package Exception\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace] + +[FolderOptions\CheckModel\Tablespace\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\IsObjectUsed] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage] + +[FolderOptions\CheckModel\Storage\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\IsObjectUsed] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database] + +[FolderOptions\CheckModel\Database\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\IsObjectUsed] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service] + +[FolderOptions\CheckModel\Web Service\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation] + +[FolderOptions\CheckModel\Web Service.Web Operation\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle] + +[FolderOptions\CheckModel\Lifecycle\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\CheckLifecyclePhase] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\CheckLifecycleRetention] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\CheckPartitionRange] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase] + +[FolderOptions\CheckModel\Lifecycle.Phase\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseTbspace] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseIQTbspace] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseDuplicateTbspace] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseTbspaceCurrency] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseRetention] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseIdlePeriod] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseDataSource] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseExternalOnFirst] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Replication] + +[FolderOptions\CheckModel\Replication\PartialReplication] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule] + +[FolderOptions\CheckModel\Business Rule\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\EmptyColl - OBJCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object] + +[FolderOptions\CheckModel\Extended Object\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link] + +[FolderOptions\CheckModel\Extended Link\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File] + +[FolderOptions\CheckModel\File\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\CheckPathExists] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format] + +[FolderOptions\CheckModel\Data Format\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\CheckDataFormatNullExpression] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes +[ModelOptions] + +[ModelOptions\Physical Objects] +CaseSensitive=No +DisplayName=Yes +EnableTrans=No +UseTerm=No +EnableRequirements=No +EnableFullShortcut=Yes +DefaultDttp= +IgnoreOwner=No +RebuildTrigger=Yes +RefrUnique=No +RefrAutoMigrate=Yes +RefrMigrateReuse=Yes +RefrMigrateDomain=Yes +RefrMigrateCheck=Yes +RefrMigrateRule=Yes +RefrMigrateExtd=No +RefrMigrDefaultLink=No +RefrDfltImpl=D +RefrPrgtColn=No +RefrMigrateToEnd=No +RebuildTriggerDep=No +ColnFKName=%.3:PARENT%_%COLUMN% +ColnFKNameUse=No +DomnCopyDttp=Yes +DomnCopyChck=No +DomnCopyRule=No +DomnCopyMand=No +DomnCopyExtd=No +DomnCopyProf=No +Notation=0 +DomnDefaultMandatory=No +ColnDefaultMandatory=No +TablDefaultOwner= +ViewDefaultOwner= +TrgrDefaultOwnerTabl= +TrgrDefaultOwnerView= +IdxDefaultOwnerTabl= +IdxDefaultOwnerView= +JdxDefaultOwner= +DBPackDefaultOwner= +SeqDefaultOwner= +ProcDefaultOwner= +DBMSTrgrDefaultOwner= +Currency=USD +RefrDeleteConstraint=1 +RefrUpdateConstraint=1 +RefrParentMandatory=No +RefrParentChangeAllow=Yes +RefrCheckOnCommit=No + +[ModelOptions\Physical Objects\NamingOptionsTemplates] + +[ModelOptions\Physical Objects\ClssNamingOptions] + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMPCKG] + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMPCKG\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMPCKG\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMDOMN] + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMDOMN\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMDOMN\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\TABL] + +[ModelOptions\Physical Objects\ClssNamingOptions\TABL\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\TABL\Code] +Template= +MaxLen=64 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\COLN] + +[ModelOptions\Physical Objects\ClssNamingOptions\COLN\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\COLN\Code] +Template= +MaxLen=64 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\INDX] + +[ModelOptions\Physical Objects\ClssNamingOptions\INDX\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\INDX\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\REFR] + +[ModelOptions\Physical Objects\ClssNamingOptions\REFR\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\REFR\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VREF] + +[ModelOptions\Physical Objects\ClssNamingOptions\VREF\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VREF\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEW] + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEW\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEW\Code] +Template= +MaxLen=64 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEWC] + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEWC\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEWC\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBSERV] + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBSERV\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBSERV\Code] +Template= +MaxLen=254 +Case=M +ValidChar='a'-'z','A'-'Z','0'-'9',"/-_.!~*'()" +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBOP] + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBOP\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBOP\Code] +Template= +MaxLen=254 +Case=M +ValidChar='a'-'z','A'-'Z','0'-'9',"/-_.!~*'()" +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WPARAM] + +[ModelOptions\Physical Objects\ClssNamingOptions\WPARAM\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WPARAM\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FACT] + +[ModelOptions\Physical Objects\ClssNamingOptions\FACT\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FACT\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DIMN] + +[ModelOptions\Physical Objects\ClssNamingOptions\DIMN\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DIMN\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\MEAS] + +[ModelOptions\Physical Objects\ClssNamingOptions\MEAS\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\MEAS\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DATTR] + +[ModelOptions\Physical Objects\ClssNamingOptions\DATTR\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DATTR\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FILO] + +[ModelOptions\Physical Objects\ClssNamingOptions\FILO\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FILO\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMEOBJ] + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMEOBJ\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMEOBJ\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMELNK] + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMELNK\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMELNK\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DefaultClass] + +[ModelOptions\Physical Objects\ClssNamingOptions\DefaultClass\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DefaultClass\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Connection] + +[ModelOptions\Pdm] + +[ModelOptions\Generate] + +[ModelOptions\Generate\Xsm] +GenRootElement=Yes +GenComplexType=No +GenAttribute=Yes +CheckModel=Yes +SaveLinks=Yes +ORMapping=No +NameToCode=No + +[ModelOptions\Generate\Pdm] +RRMapping=No + +[ModelOptions\Generate\Cdm] +CheckModel=Yes +SaveLinks=Yes +NameToCode=No +Notation=2 + +[ModelOptions\Generate\Oom] +CheckModel=Yes +SaveLinks=Yes +ORMapping=No +NameToCode=Yes +ClassPrefix= + +[ModelOptions\Generate\Ldm] +CheckModel=Yes +SaveLinks=Yes +NameToCode=No + +[ModelOptions\Default Opts] + +[ModelOptions\Default Opts\TABL] +PhysOpts= + +[ModelOptions\Default Opts\COLN] +PhysOpts= + +[ModelOptions\Default Opts\INDX] +PhysOpts= + +[ModelOptions\Default Opts\AKEY] +PhysOpts= + +[ModelOptions\Default Opts\PKEY] +PhysOpts= + +[ModelOptions\Default Opts\STOR] +PhysOpts= + +[ModelOptions\Default Opts\TSPC] +PhysOpts= + +[ModelOptions\Default Opts\SQNC] +PhysOpts= + +[ModelOptions\Default Opts\DTBS] +PhysOpts= + +[ModelOptions\Default Opts\USER] +PhysOpts= + +[ModelOptions\Default Opts\JIDX] +PhysOpts= + + +9E1F518A-7D51-4939-BAD2-58F09FDE6A85 +MySQL 5.0 +MYSQL50 +1573436673 +Mhb +1573436673 +Mhb + +F4F16ECD-F2F1-4006-AF6F-638D5C65F35E +4BA9F647-DAB1-11D1-9944-006097355D9B + + + + +AC53207B-2EBA-4AC0-96E5-909C17A10072 +PhysicalDiagram_1 +PhysicalDiagram_1 +1573436673 +Mhb +1575889044 +Mhb +[DisplayPreferences] + +[DisplayPreferences\PDM] + +[DisplayPreferences\General] +Adjust to text=Yes +Snap Grid=No +Constrain Labels=Yes +Display Grid=No +Show Page Delimiter=Yes +Show Links intersections=Yes +Activate automatic link routing=Yes +Grid size=0 +Graphic unit=2 +Window color=255, 255, 255 +Background image= +Background mode=8 +Watermark image= +Watermark mode=8 +Show watermark on screen=No +Gradient mode=0 +Gradient end color=255, 255, 255 +Show Swimlane=No +SwimlaneVert=Yes +TreeVert=No +CompDark=0 + +[DisplayPreferences\Object] +Show Icon=No +Mode=2 +Trunc Length=40 +Word Length=40 +Word Text=!"#$%&')*+,-./:;=>?@\]^_`|}~ +Shortcut IntIcon=Yes +Shortcut IntLoct=Yes +Shortcut IntFullPath=No +Shortcut IntLastPackage=Yes +Shortcut ExtIcon=Yes +Shortcut ExtLoct=No +Shortcut ExtFullPath=No +Shortcut ExtLastPackage=Yes +Shortcut ExtIncludeModl=Yes +EObjShowStrn=Yes +ExtendedObject.Comment=No +ExtendedObject.IconPicture=No +ExtendedObject.TextStyle=No +ExtendedObject_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Object Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <Separator Name="Separator" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +ELnkShowStrn=Yes +ELnkShowName=Yes +ExtendedLink_SymbolLayout=<Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Source" >[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] </Form>[CRLF]</Form> +FileObject.Stereotype=No +FileObject.DisplayName=Yes +FileObject.LocationOrName=No +FileObject.IconPicture=No +FileObject.TextStyle=No +FileObject.IconMode=Yes +FileObject_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Location" Attribute="LocationOrName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +Package.Stereotype=Yes +Package.Comment=No +Package.IconPicture=No +Package.TextStyle=No +Package_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <Separator Name="Separator" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +Display Model Version=Yes +Table.Stereotype=Yes +Table.DisplayName=Yes +Table.OwnerDisplayName=No +Table.Columns=Yes +Table.Columns._Filter="All Columns" PDMCOLNALL +Table.Columns._Columns=Stereotype DataType KeyIndicator +Table.Columns._Limit=-5 +Table.Keys=No +Table.Keys._Columns=Stereotype Indicator +Table.Indexes=No +Table.Indexes._Columns=Stereotype +Table.Triggers=No +Table.Triggers._Columns=Stereotype +Table.Comment=No +Table.IconPicture=No +Table.TextStyle=No +Table_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Owner and Name" Attribute="OwnerDisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <Separator Name="Separator" />[CRLF] <StandardCollection Name="Columns" Collection="Columns" Columns="Stereotype No\r\nDisplayName Yes\r\nDataType No\r\nSymbolDataType No &quot;Domain or Data type&quot;\r\nDomain No\r\nKeyIndicator No\r\nIndexIndicator No\r\nNullStatus No" Filters="&quot;All Columns&quot; PDMCOLNALL &quot;&quot;\r\n&quot;PK Columns&quot; PDMCOLNPK &quot;\&quot;PRIM \&quot;TRUE\&quot; TRUE\&quot;&quot;\r\n&quot;Key Columns&quot; PDMCOLNKEY &quot;\&quot;KEYS \&quot;TRUE\&quot; TRUE\&quot;&quot;" HasLimit="Yes" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Keys" Collection="Keys" Columns="Stereotype No\r\nDisplayName Yes\r\nIndicator No" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Indexes" Collection="Indexes" Columns="Stereotype No\r\nDisplayName Yes\r\nIndicator No" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Triggers" Collection="Triggers" Columns="Stereotype No\r\nDisplayName Yes" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +View.Stereotype=Yes +View.DisplayName=Yes +View.OwnerDisplayName=No +View.Columns=Yes +View.Columns._Columns=DisplayName +View.Columns._Limit=-5 +View.TemporaryVTables=Yes +View.Indexes=No +View.Comment=No +View.IconPicture=No +View.TextStyle=No +View_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Owner and Name" Attribute="OwnerDisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <Separator Name="Separator" />[CRLF] <StandardCollection Name="Columns" Collection="Columns" Columns="DisplayName No\r\nExpression No\r\nDataType No\r\nSymbolDataType No &quot;Domain or Data type&quot;\r\nIndexIndicator No" HasLimit="Yes" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Tables" Collection="TemporaryVTables" Columns="Name Yes" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Indexes" Collection="Indexes" Columns="DisplayName Yes" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +Procedure.Stereotype=No +Procedure.DisplayName=Yes +Procedure.OwnerDisplayName=No +Procedure.Comment=No +Procedure.IconPicture=No +Procedure.TextStyle=No +Procedure_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Owner and Name" Attribute="OwnerDisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <Separator Name="Separator" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +Reference.Cardinality=No +Reference.ImplementationType=No +Reference.ChildRole=Yes +Reference.Stereotype=Yes +Reference.DisplayName=No +Reference.ForeignKeyConstraintName=No +Reference.JoinExpression=No +Reference.Integrity=No +Reference.ParentRole=Yes +Reference_SymbolLayout=<Form>[CRLF] <Form Name="Source" >[CRLF] <StandardAttribute Name="Cardinality" Attribute="Cardinality" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Implementation" Attribute="ImplementationType" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Child Role" Attribute="ChildRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="No" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Cons&amp;traint Name" Attribute="ForeignKeyConstraintName" Prefix="" Suffix="" Caption="Cons&amp;traint Name" Mandatory="No" />[CRLF] <StandardAttribute Name="Join" Attribute="JoinExpression" Prefix="" Suffix="" Caption="Join" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <StandardAttribute Name="Referential integrity" Attribute="Integrity" Prefix="" Suffix="" Caption="Referential integrity" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] <StandardAttribute Name="Parent Role" Attribute="ParentRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF]</Form> +ViewReference.ChildRole=Yes +ViewReference.Stereotype=Yes +ViewReference.DisplayName=No +ViewReference.JoinExpression=No +ViewReference.ParentRole=Yes +ViewReference_SymbolLayout=<Form>[CRLF] <Form Name="Source" >[CRLF] <StandardAttribute Name="Child Role" Attribute="ChildRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="No" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Join Expression" Attribute="JoinExpression" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] <StandardAttribute Name="Parent Role" Attribute="ParentRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF]</Form> + +[DisplayPreferences\Symbol] + +[DisplayPreferences\Symbol\FRMEOBJ] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=6000 +Height=2000 +Brush color=255 255 255 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=64 +Brush gradient color=192 192 192 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 255 128 128 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\FRMELNK] +CENTERFont=新宋体,8,N +CENTERFont color=0, 0, 0 +Line style=1 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 128 128 255 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\FILO] +OBJSTRNFont=新宋体,8,N +OBJSTRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +LCNMFont=新宋体,8,N +LCNMFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4800 +Height=3600 +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 0 0 255 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\PDMPCKG] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4800 +Height=4000 +Brush color=255 255 192 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=65 +Brush gradient color=255 255 255 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 178 178 178 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\TABL] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +OWNRDISPNAMEFont=新宋体,8,N +OWNRDISPNAMEFont color=0, 0, 0 +ColumnsFont=新宋体,8,N +ColumnsFont color=0, 0, 0 +TablePkColumnsFont=新宋体,8,U +TablePkColumnsFont color=0, 0, 0 +TableFkColumnsFont=新宋体,8,N +TableFkColumnsFont color=0, 0, 0 +KeysFont=新宋体,8,N +KeysFont color=0, 0, 0 +IndexesFont=新宋体,8,N +IndexesFont color=0, 0, 0 +TriggersFont=新宋体,8,N +TriggersFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4800 +Height=4000 +Brush color=178 214 252 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=65 +Brush gradient color=255 255 255 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 0 128 192 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\VIEW] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +OWNRDISPNAMEFont=新宋体,8,N +OWNRDISPNAMEFont color=0, 0, 0 +ColumnsFont=新宋体,8,N +ColumnsFont color=0, 0, 0 +TablePkColumnsFont=新宋体,8,U +TablePkColumnsFont color=0, 0, 0 +TableFkColumnsFont=新宋体,8,N +TableFkColumnsFont color=0, 0, 0 +TemporaryVTablesFont=新宋体,8,N +TemporaryVTablesFont color=0, 0, 0 +IndexesFont=新宋体,8,N +IndexesFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4800 +Height=4000 +Brush color=208 208 255 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=65 +Brush gradient color=255 255 255 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 128 128 192 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\PROC] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +OWNRDISPNAMEFont=新宋体,8,N +OWNRDISPNAMEFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4000 +Height=1000 +Brush color=255 255 192 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=65 +Brush gradient color=255 255 255 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 128 108 0 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\REFR] +SOURCEFont=新宋体,8,N +SOURCEFont color=0, 0, 0 +CENTERFont=新宋体,8,N +CENTERFont color=0, 0, 0 +DESTINATIONFont=新宋体,8,N +DESTINATIONFont color=0, 0, 0 +Line style=1 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 0 128 192 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\VREF] +SOURCEFont=新宋体,8,N +SOURCEFont color=0, 0, 0 +CENTERFont=新宋体,8,N +CENTERFont color=0, 0, 0 +DESTINATIONFont=新宋体,8,N +DESTINATIONFont color=0, 0, 0 +Line style=1 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 128 128 192 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\USRDEPD] +OBJXSTRFont=新宋体,8,N +OBJXSTRFont color=0, 0, 0 +Line style=1 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=2 0 128 128 255 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\Free Symbol] +Free TextFont=新宋体,8,N +Free TextFont color=0, 0, 0 +Line style=0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 0 0 255 +Shadow color=192 192 192 +Shadow=0 +(8268, 11693) +((315,354), (433,354)) +1 +15 + + +1573443498 +1578289481 +((-21587,-55647), (-14146,-33693)) +((-21187,-55247),(-14771,-55247),(-14771,-34093)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N +4 + + + + + + + + + + + +1575624441 +1575855293 +((7952,-65177), (9202,-37779)) +((8577,-64777),(8577,-38179)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N + + + + + + + + + + + +1575624473 +1575855293 +((-42707,-69189), (1113,-48816)) +((713,-68789),(-42082,-68789),(-42082,-49216)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N + + + + + + + + + + + +1575624521 +1575855289 +((663,-51761), (8002,-37779)) +((1063,-51361),(7377,-51361),(7377,-38179)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N + + + + + + + + + + + +1575624526 +1575855289 +((-12582,-47749), (-11332,-33693)) +((-11957,-47349),(-11957,-34093)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N + + + + + + + + + + + +1573436700 +1575889010 +-1 +((-45485,-49216), (-25299,-21394)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1573436823 +1575889010 +-1 +((-20969,-34093), (-8507,-25245)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1573439850 +1575889010 +-1 +((5372,-38179), (20150,-22731)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1573442367 +1575889010 +-1 +((24745,-63550), (40683,-50578)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1573442751 +1578289481 +-1 +((-34421,-66256), (-21187,-51634)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575624135 +1575889010 +-1 +((-12557,-55373), (1063,-47349)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575624135 +1575889010 +-1 +((713,-72801), (14333,-64777)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-27388,1549), (-14927,10396)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((2370,-7000), (15603,-1452)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((1597,14221), (14830,23068)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((3144,2373), (15991,10395)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-27774,28543), (-14541,39864)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,13395), (-31162,23067)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,-9474), (-31162,-1452)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-11541,29367), (920,39864)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((441,-17196), (12514,-12473)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,1549), (-30388,10396)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-28162,13395), (-16089,23067)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-28162,-9474), (-16089,-1452)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-13859,-18022), (-2557,-12474)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,-18022), (-31547,-12474)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-28547,-18022), (-16859,-12474)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-13089,13395), (-1401,23067)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,26067), (-30774,39863)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-13089,-7824), (-628,-1452)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889030 +-1 +((-13023,996), (-176,10668)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889107 +-1 +((2682,31182), (14755,40029)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + + + + + + + + +E4E8B02A-08FE-4D41-AF69-E356B1ADF6B2 +face_camera +face_camera +1573436700 +Mhb +1578554809 +Mhb +摄像头表 + + + +1A74B7DC-03CD-46A8-9D38-526940D52CD8 +id_face_camera +id_face_camera +1573437457 +Mhb +1575861037 +Mhb +id +bigint(32) +32 +1 + + +384744B7-F06F-40CB-A217-BCD81E187B4D +camera_name +camera_name +1573437457 +Mhb +1576823629 +Mhb +摄像头名称 +varchar(255) +255 + + +D398DC39-3975-4E5C-AFCB-B4870E6867BD +camera_region_firstlevel +camera_region_firstlevel +1573437457 +Mhb +1576056977 +Mhb +摄像头层级区域-码值 +varchar(255) +255 + + +8265813D-F22C-4B2A-8668-EC46030D361D +camera_region_firstlevel_back_up +camera_region_firstlevel_back_up +1576138474 +Mhb +1576138611 +Mhb +摄像头层级区域冗余字段 +varchar(255) +255 + + +CBF48334-B876-4E7B-B5B7-4922E38A0BB0 +camera_region +camera_region +1576056922 +Mhb +1576056958 +Mhb +摄像头区域码值 +varchar(255) +255 + + +66813EBD-4D00-4948-96A8-AD6F18182008 +camera_region_back_up +camera_region_back_up +1576138474 +Mhb +1576138611 +Mhb +摄像头区域冗余字段 +varchar(255) +255 + + +6D7BAD6F-A7C7-46CE-AF9E-A1A2300C4FB9 +camera_address +camera_address +1573437457 +Mhb +1575623722 +Mhb +摄像头详细地址 +varchar(255) +255 + + +1C9BD8BB-D20F-4EDD-AF7D-AA524E4AA53D +version +version +1576057036 +Mhb +1576057072 +Mhb +摄像头型号 +varchar(255) +255 + + +989C9D47-6682-4B62-B172-9475E9C0B6C4 +id_brand +id_brand +1578289236 +Administrator +1578554809 +Mhb +品牌码值 +varchar(32) +32 + + +91ABA7B4-8D6E-43F3-A440-7966180127DE +camerat_longitude +camerat_longitude +1573437457 +Mhb +1575623722 +Mhb +摄像头经度 +varchar(100) +100 + + +45726891-DFB9-4C33-802C-31C7E4C372C1 +camera_latitude +camera_latitude +1573437457 +Mhb +1575623722 +Mhb +摄像头纬度 +varchar(100) +100 + + +03444A9A-5758-4AA6-8C02-AA113BF10DD9 +camerat_locationtype_id +camerat_locationtype_id +1573437457 +Mhb +1576221873 +Mhb +位置类型-码值 +varchar(255) +255 + + +A6D640CB-2885-4D12-9FC5-236C63BB3CC1 +camerat_locationtype_id_back_up +camerat_locationtype_id_back_up +1576138474 +Mhb +1576138611 +Mhb +位置类型冗余字段 +varchar(255) +255 + + +4E38BE4F-977D-4D5B-8FEE-16E641F97C19 +public_security_code +public_security_code +1573437457 +Mhb +1573526258 +Mhb +公安机关代码 +varchar(100) +100 + + +C5934BE0-2B22-4488-9410-FCE8423A6E20 +public_security_name +public_security_name +1573437457 +Mhb +1573438883 +Mhb +公安机关名称 +varchar(255) +255 + + +7094AFAC-2FA0-4783-A862-99DDB5B624A0 +construction_unit +construction_unit +1573437457 +Mhb +1573438883 +Mhb +建设单位 +varchar(255) +255 + + +C7947C59-4EFB-4528-BBB6-214C88FB5309 +management_unit +management_unit +1573437457 +Mhb +1573438883 +Mhb +管理单位 +varchar(255) +255 + + +69B2FAEE-4476-455F-BF07-89C2BED473F9 +management_personnel +management_personnel +1573437457 +Mhb +1573438883 +Mhb +管理人员 +varchar(50) +50 + + +8819B1EE-0F95-45F4-8591-7685675B1D44 +contact_number +contact_number +1573437457 +Mhb +1573438883 +Mhb +联系电话 +varchar(11) +11 + + +F367BFD2-DCCE-4242-88B5-4B1910E407D4 +ip +ip +1575623219 +Mhb +1575623722 +Mhb +IP +varchar(255) +255 + + +1A671B8A-EB99-4E1B-839E-8675BE7BFCC1 +port +port +1578554711 +Mhb +1578554809 +Mhb +端口 +varchar(32) +32 + + +83CF2C7D-0013-42AC-A67C-B5D2F2C3BB49 +user_name +user_name +1575623219 +Mhb +1575623722 +Mhb +用户名 +varchar(255) +255 + + +595009F9-3B8F-481C-BF37-70DB18595BB3 +passwd +passwd +1575623219 +Mhb +1575623722 +Mhb +密码 +varchar(32) +32 + + +39AC6D85-2A82-457B-973B-833C5A1F0EC9 +brand +brand +1575623219 +Mhb +1575623722 +Mhb +品牌 +varchar(50) +50 + + +4E4CD6FD-D3F2-4592-B5AC-C01FFE56CFAB +rtsp_url +rtsp_url +1575623219 +Mhb +1575623722 +Mhb +rtsp地址 +varchar(255) +255 + + +EB1C71EB-1038-4A3C-B14D-40A723A36408 +remarks +remarks +1573439050 +Mhb +1573439206 +Mhb +备注信息 +text + + +D3FB0AE4-6D5D-4412-848F-3AFE58312B7C +status +status +1573439050 +Mhb +1573439206 +Mhb +是否运行 Y启动 N未启动 +varchar(1) +1 + + +C38B226A-DFA0-439D-A188-04AC3905CFD5 +is_valid +is_valid +1573437457 +Mhb +1573438883 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +0082D9B3-EC08-4C51-83F2-B99379EBB7C9 +create_time +create_time +1573437457 +Mhb +1573438883 +Mhb +创建时间 +datetime + + +8F5CCA05-CAA0-48B9-A8C2-5765F3B9BB5D +update_time +update_time +1573437457 +Mhb +1573438883 +Mhb +更新时间 +datetime + + +6A8C4EC6-8859-4E65-830E-8B9B2F4E6FC8 +create_by +create_by +1573437457 +Mhb +1573438883 +Mhb +创建人 +varchar(32) +32 + + +7705E005-354A-44C3-9C45-A9811253A948 +update_by +update_by +1573437457 +Mhb +1573438883 +Mhb +更新人 +varchar(32) +32 + + + + +762D34E1-D0BB-43E1-A3AA-B29DC3FB0816 +Key_1 +Key_1 +1573437457 +Mhb +1573438883 +Mhb + + + + + + + + + + +2C890490-554A-40C9-9E52-B764B6D77A67 +face_library +face_library +1573436823 +Mhb +1575624380 +Mhb +库表 + + + +E50A7606-639A-41C9-A8C7-D813FD9CC77C +id_factory +id_factory +1573439238 +Mhb +1575861050 +Mhb +id +bigint(32) +32 +1 + + +3672C199-FB8A-4E09-946A-23EE9ECACDB2 +factory_name +factory_name +1573439238 +Mhb +1573439727 +Mhb +库名称 +varchar(255) +255 + + +E562845F-7E6A-46B1-92AC-747E1E4394B5 +factory_type +factory_type +1573439238 +Mhb +1573439727 +Mhb +库类型-码值 +varchar(2) +2 + + +0502AE24-8A23-46D8-A92D-83ECC1579FD3 +remarks +remarks +1573439739 +Mhb +1573439777 +Mhb +备注信息 +varchar(255) +255 + + +0FE75B86-45F9-478D-82A7-3FAC77CAF204 +is_valid +is_valid +1573439238 +Mhb +1573439727 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +DC672B5F-F72F-4110-AFC4-D2D973FBB219 +create_time +create_time +1573439238 +Mhb +1573443221 +Mhb +创建时间 +datetime + + +97EEED5B-7EC2-4739-A85A-537C38104297 +create_by +create_by +1573439238 +Mhb +1573439727 +Mhb +创建人 +varchar(32) +32 + + +73909D78-E9F6-47DF-B26D-19B65FF40D25 +update_time +update_time +1573439238 +Mhb +1573439727 +Mhb +更新时间 +datetime + + +162BC533-0B3F-4229-A8FB-445CADC70BD2 +update_by +update_by +1573439238 +Mhb +1573439727 +Mhb +更新人 +varchar(32) +32 + + + + +2F8CA6A0-DB4A-4939-B94D-3DA2D510FEA6 +Key_1 +Key_1 +1573439777 +Mhb +1573439781 +Mhb + + + + + + + + + + +046778F8-B0CE-4309-B625-34BC7C78EB20 +control_task +control_task +1573439850 +Mhb +1573442319 +Mhb +布控任务 + + + +0DED6519-44BC-492F-88FE-7549FE6274FA +id_control_task +id_control_task +1573439850 +Mhb +1575861062 +Mhb +id +bigint(32) +32 +1 + + +09DF71A8-0F01-4C8B-9BEB-282DBE292E4D +task_name +task_name +1573439923 +Mhb +1573441288 +Mhb +任务名称 +varchar(255) +255 + + +4267CDB1-57BF-4047-8FF4-4A253E88D42F +control_object +control_object +1573439923 +Mhb +1573441288 +Mhb +布控对象(id 人像库id 或者上传图片id) +varchar(32) +32 + + +AAD04542-7F80-4602-A5C4-91583100AD93 +disposal_type +disposal_type +1573439923 +Mhb +1575869626 +Mhb +处置类型-码值 +varchar(3) +3 + + +E5016236-E62E-4B22-8EA4-C171BAF146AC +control_type +control_type +1573439923 +Mhb +1573441288 +Mhb +布控类型-码值 +varchar(1) +1 + + +2D7F6B74-2424-4DA1-9370-CD058112378B +control_start_time +control_start_time +1573439923 +Mhb +1573441288 +Mhb +布控开始时间 +datetime + + +7939CB58-6F61-4D70-B891-AEDD57BDC26A +control_end_time +control_end_time +1573439923 +Mhb +1573441288 +Mhb +布控结束时间 +datetime + + +9E6E0F90-0714-4293-8EA8-435775748148 +control_region +control_region +1573439923 +Mhb +1573441288 +Mhb +布控区域 +varchar(255) +255 + + +B327871B-E72C-4096-9D98-5C24D4623304 +control_threshold +control_threshold +1573439923 +Mhb +1573441288 +Mhb +布控阈值 +double + + +534C211F-0A48-413B-B80D-FA3866D5B1A3 +control_status +control_status +1573442211 +Mhb +1573442319 +Mhb +布控状态-码值 +varchar(1) +1 + + +EB469329-2721-4847-A969-DD7DE9797B33 +receive +receive +1573439923 +Mhb +1573441288 +Mhb +接收人员(人员id逗号隔开) +text + + +C5AC5EB0-57B0-44B3-8B8A-9EB82FDC184B +remarks +remarks +1573439923 +Mhb +1573441288 +Mhb +备注信息 +text + + +4537FE59-BD10-484A-B134-D13FCC05FF7E +is_valid +is_valid +1573439923 +Mhb +1573441288 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +6573FCC6-D476-485A-836B-AF3F0422F496 +create_time +create_time +1573439923 +Mhb +1573441288 +Mhb +创建时间 +datetime + + +02537A17-3D66-43BB-ACB7-5ECA206DCEBF +update_time +update_time +1573439923 +Mhb +1573441288 +Mhb +更新时间 +datetime + + +13C83835-9669-4A2D-990E-5B52BF8292DA +create_by +create_by +1573439923 +Mhb +1573441288 +Mhb +创建人 +varchar(32) +32 + + +1355E161-2F24-40AA-BA97-F8D0F31487D7 +update_by +update_by +1573439923 +Mhb +1573441288 +Mhb +更新人 +varchar(32) +32 + + + + +AF085F36-0775-4494-9850-05B5E0CA9613 +Key_1 +Key_1 +1573441293 +Mhb +1573441306 +Mhb + + + + + + + + + + +AA9FB273-75E3-4361-B7B4-C0ABE3C749B1 +warning_information +warning_information +1573442367 +Mhb +1573520775 +Mhb +预警信息 + + + +7D229B27-8F0D-47C7-987D-E3A25E771027 +id_warning_information +id_warning_information +1573442367 +Mhb +1573451149 +Mhb +id +varchar(32) +32 +1 + + +A02A7C65-D407-48ED-85BB-480DD3C996C3 +receive_json +receive_json +1573442367 +Mhb +1573451149 +Mhb +接收参数 +text + + +BC7C9C5D-4899-4B5A-B1D9-DE65F4DDCFD2 +id_control_task +id_control_task +1573450400 +Mhb +1573451149 +Mhb +布控任务id +varchar(32) +32 + + +E72CEEE7-3FB8-442C-945D-D1F0CD137744 +id_portrait +id_portrait +1573450400 +Mhb +1573451149 +Mhb +人像id/图片id +varchar(32) +32 + + +634A26AF-66D0-4672-B9E7-C077A27162B8 +type +type +1573451188 +Mhb +1573451339 +Mhb +预警类型-码值 +varchar(2) +2 + + +52184851-1D99-4EF5-A7BB-82588F3C6C3D +id_face_bayonet +id_face_bayonet +1573451188 +Mhb +1573451339 +Mhb +卡口id +varchar(32) +32 + + +394727A5-BAD4-4426-AEA4-26591CD012C1 +score +score +1573451373 +Mhb +1573451549 +Mhb +比对分数 +double + + +8EC3BB7B-DC88-4DC0-BA90-7AF08ABF5268 +process_result_type +process_result_type +1573468005 +Mhb +1573520775 +Mhb +处理结果类型(1盘查 2抓捕) +varchar(1) +1 + + +61F63A0F-1EFD-4C52-A385-0A267F9477D4 +process_result +process_result +1573520652 +Mhb +1573520775 +Mhb +处理结果 +text + + +949990AF-72E6-4261-ABCB-A04CFD66D1E8 +is_valid +is_valid +1573450400 +Mhb +1573451149 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +B23168D4-E0F1-4FCE-ADDA-CD54A3DCCF70 +create_time +create_time +1573450400 +Mhb +1573451149 +Mhb +创建时间 +datetime + + +66E8BF37-727F-43CE-8900-4D261F0C3F7F +create_by +create_by +1573450400 +Mhb +1573451149 +Mhb +创建人 +varchar(32) +32 + + +74E4673F-D850-4EB1-955D-AF904D020BA5 +update_time +update_time +1573450400 +Mhb +1573451149 +Mhb +更新时间 +datetime + + +F5F2FB5C-01F8-4873-8270-5ED3BE93481B +update_by +update_by +1573450400 +Mhb +1573451149 +Mhb +更新人 +varchar(32) +32 + + + + +5A10E169-5FF8-42EC-95B4-42FE6B61CB1A +Key_1 +Key_1 +1573450400 +Mhb +1573451149 +Mhb + + + + + + + + + + +8382D296-44E4-4718-9E54-9500D18479C9 +portrait +portrait +1573442751 +Mhb +1575623995 +Mhb +人像表 + + + +6E5F59AA-78E7-4CD0-9436-D81385D49C8F +id_portrait +id_portrait +1573442751 +Mhb +1575861079 +Mhb +人像id +bigint(32) +32 +1 + + +D6A0563F-E2B6-4199-B5EC-87789059C286 +id_factory +id_factory +1573442751 +Mhb +1575861079 +Mhb +库id +bigint(32) +32 + + +246D0D42-0BCE-4EEB-B7DC-DDC75B9E63A8 +url +url +1573442751 +Mhb +1573443337 +Mhb +图片url +text + + +00BB5BFB-C463-416C-A47C-11EFFA6CB12B +background_url +background_url +1573442751 +Mhb +1573443337 +Mhb +背景图url +text + + +8B57855B-52F5-4FA1-A99C-B219A1D6F806 +name +name +1573442751 +Mhb +1573443337 +Mhb +姓名 +varchar(100) +100 + + +2CD02889-7317-4B2A-8D25-3F46FD21D29F +sex +sex +1573442751 +Mhb +1573443337 +Mhb +性别 +varchar(10) +10 + + +00BFA5BD-13B9-49C0-A743-CB839016ACA2 +birth_date +birth_date +1573442751 +Mhb +1573443337 +Mhb +出生日期 +datetime + + +80B1951F-A3A5-473E-95AA-313E0A520757 +id_card +id_card +1573442751 +Mhb +1573443337 +Mhb +身份证 +varchar(18) +18 + + +E04FA0CB-5D37-4756-89C6-30CE730BD24E +face_rect +face_rect +1575623921 +Mhb +1575623995 +Mhb +人脸坐标位置 +varchar(255) +255 + + +FD26970C-19B7-4CC3-BA7D-8EBAC463094F +faceIds +faceIds +1573466044 +Mhb +1573466138 +Mhb +人脸入库id +varchar(32) +32 + + +8C74B033-4170-4642-902C-C1DB5DFEA24B +featId +featId +1573466044 +Mhb +1573466138 +Mhb +人脸特征id +varchar(32) +32 + + +19D66449-97F7-4CFE-985B-77EE5ED73732 +is_valid +is_valid +1573442751 +Mhb +1573443337 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +C9245E6B-7A77-4D87-BEF5-59611569D824 +create_time +create_time +1573442751 +Mhb +1573443337 +Mhb +创建时间 +datetime + + +3E0B9B58-0075-492D-B898-48DF118D925F +create_by +create_by +1573442751 +Mhb +1573443337 +Mhb +创建人 +varchar(32) +32 + + +289075BD-55C6-4503-B805-6F9465A6A4CA +update_time +update_time +1573442751 +Mhb +1573443337 +Mhb +更新时间 +datetime + + +85D672D5-A474-4F91-AC38-85E43C5BF950 +update_by +update_by +1573442751 +Mhb +1573443337 +Mhb +更新人 +varchar(32) +32 + + + + +1B2E506C-1CE2-4D22-A491-70460B046196 +Key_1 +Key_1 +1573442751 +Mhb +1573443337 +Mhb + + + + + + + + + + +FA56C67F-89DF-4FDB-AD24-0C0F36CAAFD9 +control_library_mid +control_library_mid +1574155051 +Mhb +1575624573 +Mhb +布控和库中间表 + + + +1EC6F044-24DB-4F69-9E7B-F30E69CF08D3 +id +id +1574155051 +Mhb +1575861095 +Mhb +id +bigint(32) +32 +1 + + +910BBD12-1A6C-4AA3-9FC3-F277F3136D46 +id_control_task +id_control_task +1575624521 +Mhb +1575861095 +Mhb +布控id +bigint(32) +32 + + +BD86C361-D857-4CC1-8745-0B13C8AC9F94 +id_factory +id_factory +1575624526 +Mhb +1575861095 +Mhb +库id +bigint(32) +32 + + +B9640E36-69D5-4A37-8512-46DE02EDDBCB +is_valid +is_valid +1574155051 +Mhb +1575624135 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +94F3622A-81D2-4B70-8220-9C1D1672986D +create_time +create_time +1574155051 +Mhb +1575624135 +Mhb +创建时间 +datetime + + +DF4654D3-08FE-4235-9BF4-B02F5966DC09 +update_time +update_time +1574155051 +Mhb +1575624135 +Mhb +更新时间 +datetime + + +3B2469E3-1D56-421A-A89B-34F021D019FF +update_by +update_by +1574233842 +Mhb +1575624135 +Mhb +更新人 +varchar(32) +32 + + +4A4FF023-FB25-49A4-A7F8-AD2D94656D07 +create_by +create_by +1574233842 +Mhb +1575624135 +Mhb +创建人 +varchar(32) +32 + + + + +55ACAA83-F906-4C3A-A16A-4D013F1C2AE1 +Key_1 +Key_1 +1574218130 +Mhb +1575624135 +Mhb + + + + + + + + + + +9F049A00-E53A-4773-8A56-5E2168F92FE8 +sys_dept +sys_dept +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门管理' ROW_FORMAT = Dynamic + + + +99E4E099-4E6F-4B2C-B760-B6255751F6DE +id +id +1575627715 +Mhb +1575860857 +Mhb +id +bigint(32) +32 +1 + + +4BE52A70-17B3-4C49-A3FF-7C2190407AF2 +pid +pid +1575627715 +Mhb +1575860857 +Mhb +上级ID +NULL +bigint(32) +32 + + +48505E3B-44DF-4C1A-8CB0-EDDFD785F2B0 +pids +pids +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +E557AB7A-B66B-4B92-9017-61A076CA99D1 +name +name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +2E751D61-1EAF-4399-9E0B-A76AB0CFA95D +sort +sort +1575627715 +Mhb +1575627719 +Mhb +排序 +NULL +int(10) +10 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +F79AEE39-9FAA-42AE-9CD5-9770F8EB80B6 +creator +creator +1575627715 +Mhb +1575860857 +Mhb +创建者 +NULL +bigint(32) +32 + + +F3AECF63-6325-4851-AC87-7D810369A7E4 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +61EED6A4-E252-438B-8702-F6F0F35186F5 +updater +updater +1575627715 +Mhb +1575860857 +Mhb +更新者 +NULL +bigint(32) +32 + + +87D7DA60-8C6C-44CE-9A81-4EFAA9DDB090 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +096A16B9-7840-44A8-A450-F127ED1354C7 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +6D2EA011-6633-4D84-8E55-F854B11B33A8 +idx_pid +idx_pid +1575627715 +Mhb +1575627719 +Mhb +idx_pid + + + + + +D5AD0430-B8A3-4098-911C-C5853ADF4EAB +idx_sort +idx_sort +1575627715 +Mhb +1575627719 +Mhb +idx_sort + + + + + + + + + + +6C21474D-6E31-43C8-B630-FF1841F63FB2 +sys_dict_data +sys_dict_data +1575888977 +Mhb +1575888983 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典数据' ROW_FORMAT = Dynamic + + + +3F58B53B-D90D-4EAC-8885-98F92D97393E +id +id +1575888977 +Mhb +1575889099 +Mhb +id +bigint(32) +32 +1 + + +93F777B3-FB31-46E2-8C86-6514649A432A +dict_type_id +dict_type_id +1575888977 +Mhb +1575889099 +Mhb +字典类型ID +bigint(32) +32 +1 + + +3151FD0B-26AD-4B8C-BFDE-13150FD6E023 +dict_label +dict_label +1575888977 +Mhb +1575888983 +Mhb +varchar(255) +255 + + +E4A7FC9F-ED7F-4186-8CC7-F7496BD0DD77 +dict_value +dict_value +1575888977 +Mhb +1575888983 +Mhb +varchar(255) +255 + + +5DB469B0-7D4C-430A-A53C-DA82C022FFEC +remark +remark +1575888977 +Mhb +1575888983 +Mhb +varchar(255) +255 + + +2D38FDAB-0E2C-4D4C-AFB3-F84D2E934A6C +sort +sort +1575888977 +Mhb +1575888983 +Mhb +排序 +NULL +int(10) +10 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +DF1449A4-FC37-4DE1-BC58-F4646FC8BB5D +creator +creator +1575888977 +Mhb +1575889099 +Mhb +创建者 +NULL +bigint(32) +32 + + +8B787594-FB81-4C1B-B99D-08DCDB73483F +create_date +create_date +1575888977 +Mhb +1575888983 +Mhb +datetime + + +EF9F74EB-2F54-4000-8731-6FD54AF49EF8 +updater +updater +1575888977 +Mhb +1575889099 +Mhb +更新者 +NULL +bigint(32) +32 + + +930A19BC-C7DE-4CF0-9F7E-FB94A3D89FA8 +update_date +update_date +1575888977 +Mhb +1575888983 +Mhb +datetime + + + + +5D39F44E-C97C-4EDD-BE40-4A4D7CB68122 +Key_1 +Key_1 +1575888977 +Mhb +1575888983 +Mhb + + + + + +90898574-3825-42BD-99F4-01E40443531C +uk_dict_type_value +uk_dict_type_value +1575888977 +Mhb +1575888983 +Mhb +uk_dict_type_value +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + + +9CB71773-7DE1-468F-9994-C6506B2B92C0 +idx_sort +idx_sort +1575888977 +Mhb +1575888983 +Mhb +idx_sort + + + + + + + + + + +1B482A57-1B23-4C5B-B955-1F982B1CEE49 +sys_dict_type +sys_dict_type +1575889007 +Mhb +1575889009 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典类型' ROW_FORMAT = Dynamic + + + +03B9DD8A-7F6D-47AE-88CD-719B3AFCD594 +id +id +1575889007 +Mhb +1575889066 +Mhb +id +bigint(32) +32 +1 + + +2C10EEC8-6DCC-4FE6-9C23-6572618DBE9E +dict_type +dict_type +1575889007 +Mhb +1575889009 +Mhb +varchar(100) +100 + + +B66550FC-E390-4D36-B904-3859D3F5AAF3 +dict_name +dict_name +1575889007 +Mhb +1575889009 +Mhb +varchar(255) +255 + + +73083542-E05D-4318-9777-E598401547E7 +remark +remark +1575889007 +Mhb +1575889009 +Mhb +varchar(255) +255 + + +9ABD4C19-01FE-4127-928A-3BE7B235293F +sort +sort +1575889007 +Mhb +1575889009 +Mhb +排序 +NULL +int(10) +10 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +6DAB2997-81D1-4DC7-97F4-57466F24CBB5 +creator +creator +1575889007 +Mhb +1575889066 +Mhb +创建者 +NULL +bigint(32) +32 + + +D840C92A-3AF7-4CC3-B7CA-AE9F92D8A4E1 +create_date +create_date +1575889007 +Mhb +1575889009 +Mhb +datetime + + +D0B20B56-B091-446D-AA83-9684CDEF6813 +updater +updater +1575889007 +Mhb +1575889066 +Mhb +更新者 +NULL +bigint(32) +32 + + +E78BE102-69B2-402F-AB56-910A2441C163 +update_date +update_date +1575889007 +Mhb +1575889009 +Mhb +datetime + + + + +80F0AA09-704F-451E-8243-04BF2B5733C7 +Key_1 +Key_1 +1575889007 +Mhb +1575889009 +Mhb + + + + + +B58F7149-042A-4F02-9A69-2604E62EADC9 +dict_type +dict_type +1575889007 +Mhb +1575889009 +Mhb +dict_type +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + + + + + + +2F2FC176-0502-4464-9A63-2165384CE8F5 +sys_language +sys_language +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '国际化' ROW_FORMAT = Dynamic + + + +78DDD97F-01BC-4D07-8CE0-E295DC43D77B +table_name +table_name +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 +1 + + +D96A0DF7-ABA7-4FB6-AD40-59B28C71CC05 +table_id +table_id +1575627715 +Mhb +1575862019 +Mhb +表主键 +bigint(32) +32 +1 + + +D0B719E8-3DDB-42A8-B636-AB6EA90854B4 +field_name +field_name +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 +1 + + +6C611C25-9B68-4151-B3EA-14E5C6EF6BBD +field_value +field_value +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +9956297C-35B9-4975-912F-BBAB29C6F9F7 +language +language +1575627715 +Mhb +1575627719 +Mhb +varchar(10) +10 +1 + + + + +5E3CB867-43BC-49D0-B831-BF008A66B898 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + + + + +66CEE822-E213-45DC-9CC8-861DA9D6683A +idx_table_id +idx_table_id +1575627715 +Mhb +1575627719 +Mhb +idx_table_id + + + + + + + + + + +26AF1720-5B40-4B53-A9B3-190C99952181 +sys_log_error +sys_log_error +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '异常日志' ROW_FORMAT = Dynamic + + + +427B735A-94B7-4144-92C2-378A5F21AD49 +id +id +1575627715 +Mhb +1575860814 +Mhb +id +bigint(32) +32 +1 + + +2ABCD2A4-A863-4F1C-B4ED-B3C7EE7FBFA2 +request_uri +request_uri +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +10F4427C-4911-4ADC-9C5A-710B71FE3266 +request_method +request_method +1575627715 +Mhb +1575627719 +Mhb +varchar(20) +20 + + +AB3897EC-DC22-409A-A868-96C77CFF050D +request_params +request_params +1575627715 +Mhb +1575627719 +Mhb +text + + +76F89572-6BFB-4E3A-8522-12C1F53021EF +user_agent +user_agent +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +99D318E1-F035-4B93-90B1-BB54F2E2D882 +ip +ip +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 + + +1B032144-9B70-4081-8CE3-9C8731992202 +error_info +error_info +1575627715 +Mhb +1575627719 +Mhb +text + + +A55433CF-E4B0-41DC-B4B5-DACE31429871 +creator +creator +1575627715 +Mhb +1575860814 +Mhb +创建者 +NULL +bigint(32) +32 + + +5EF35C60-4A2E-41D4-AFCF-7DFBB2C1317E +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +D9768FFE-44A1-444B-B960-7016280070C8 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +D940DBD9-88FC-4583-B353-90A58DE455A4 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +2380061C-D4F6-42E6-ADED-E19B797BD5DA +sys_log_login +sys_log_login +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '登录日志' ROW_FORMAT = Dynamic + + + +EA11F126-1895-4FB7-BD1D-F44A5B6DEE84 +id +id +1575627715 +Mhb +1575860871 +Mhb +id +bigint(32) +32 +1 + + +C9E783D8-C255-40CA-B614-9BCE7D35723A +operation +operation +1575627715 +Mhb +1575627719 +Mhb +用户操作 0:用户登录 1:用户退出 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +C75D2E3C-21DC-481F-8402-1663098427DB +status +status +1575627715 +Mhb +1575627719 +Mhb +状态 0:失败 1:成功 2:账号已锁定 +tinyint(3) +3 +1 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +09ABAA4F-775A-4F0D-A149-C7AEE703E52E +user_agent +user_agent +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +084B3DB4-F6AF-446E-A110-C93489BBD3A2 +ip +ip +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 + + +1AE4EFD0-4C2B-49CE-B308-32DF99EB5F8B +creator_name +creator_name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +19AD544E-4425-4A9A-99CB-3530E09707E0 +creator +creator +1575627715 +Mhb +1575860871 +Mhb +创建者 +NULL +bigint(32) +32 + + +3D94AB21-5C3B-49E9-A686-CB195FC3D48B +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +70F8B6B9-567B-431D-BF46-AF2EEFF96D50 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +D5414B25-50A6-484B-A165-1E7C61D91724 +idx_status +idx_status +1575627715 +Mhb +1575627719 +Mhb +idx_status + + + + + +C9A69DDE-0FE3-4896-8CD1-456C003F7339 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +93F1EDF9-F27B-4EDC-B9B4-FB91DA648BE9 +sys_log_operation +sys_log_operation +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作日志' ROW_FORMAT = Dynamic + + + +57BE3274-2F38-424A-AE05-401BD923AF4E +id +id +1575627715 +Mhb +1575860286 +Mhb +id +bigint(32) +32 +1 + + +F9439ED2-128A-4A62-A4C6-1CD9E8A1F778 +operation +operation +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +4AE3E94D-E164-4817-84C6-53B2C887CCBA +request_uri +request_uri +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +C063592C-2467-4956-BA4C-A01FE1EF63AB +request_method +request_method +1575627715 +Mhb +1575627719 +Mhb +varchar(20) +20 + + +D46DDBBC-37D4-4054-B9E2-E8CFCCF63628 +request_params +request_params +1575627715 +Mhb +1575627719 +Mhb +text + + +0BB4AF57-D74F-4E52-A7B8-8B6FFE56FF22 +request_time +request_time +1575627715 +Mhb +1575627719 +Mhb +请求时长(毫秒) +int(10) +10 +1 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +762654F5-C9CA-4088-B406-3E779C72F13F +user_agent +user_agent +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +9599B8EF-AA8D-4912-9170-6C438594D234 +ip +ip +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 + + +1ABE28F8-9CE4-4931-8BC8-C0754FCE22A5 +status +status +1575627715 +Mhb +1575627719 +Mhb +状态 0:失败 1:成功 +tinyint(3) +3 +1 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +B33D74E0-A229-4BD2-8D7F-EF986D931F5A +creator_name +creator_name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +5EB6EAD6-8DE2-4403-BB8C-EBE24D46423A +creator +creator +1575627715 +Mhb +1575861976 +Mhb +创建者 +NULL +bigint(32) +32 + + +E6846B72-224B-4F7C-8066-094332A29A7E +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +DAE48F36-6C99-431C-B1A5-AAB1AAE20946 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +29FACFD7-CFC0-4770-AAC6-4FCFC8B70788 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +D611436E-27EF-46E2-B787-A289354824D7 +sys_mail_log +sys_mail_log +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '邮件发送记录' ROW_FORMAT = Dynamic + + + +ABE063DC-EE35-4992-8602-0729AA5A4EE4 +id +id +1575627715 +Mhb +1575860698 +Mhb +id +bigint(32) +32 +1 + + +95A5DDA5-6531-411D-9B28-41E282A1EEAA +template_id +template_id +1575627715 +Mhb +1575860698 +Mhb +邮件模板ID +bigint(32) +32 +1 + + +328CAE6E-C72C-488D-BB2B-B18460B7365E +mail_from +mail_from +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +67C576A8-49C6-486E-83B6-91800959B07B +mail_to +mail_to +1575627715 +Mhb +1575627719 +Mhb +varchar(400) +400 + + +60897F65-122D-47B7-B300-503E7750ECE7 +mail_cc +mail_cc +1575627715 +Mhb +1575627719 +Mhb +varchar(400) +400 + + +43D64500-A658-49C5-8CB8-8E964866B6D9 +subject +subject +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +464AC206-FFB7-4710-84CF-D5D38FAE4013 +content +content +1575627715 +Mhb +1575627719 +Mhb +text + + +EECFB0B6-0CEC-46E7-910B-906B8C115627 +status +status +1575627715 +Mhb +1575627719 +Mhb +发送状态 0:失败 1:成功 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +E0C60476-7866-486F-B1FB-35A7AE051AE1 +creator +creator +1575627715 +Mhb +1575860698 +Mhb +创建者 +NULL +bigint(32) +32 + + +AB589EBD-BFDE-4677-961B-AD4A2A3976C1 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +31286D33-2B76-4256-9731-9957E37CB6B1 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +EBA018CA-2321-4052-9706-2728E609E3B2 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +41C79146-5F02-4466-8EAE-6545338C0E42 +sys_mail_template +sys_mail_template +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '邮件模板' ROW_FORMAT = Dynamic + + + +4AC1F548-A110-4CF9-A19C-FF297749E235 +id +id +1575627715 +Mhb +1575860890 +Mhb +id +bigint(32) +32 +1 + + +55839EA1-7458-4D99-93FB-FAFF0D650906 +name +name +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +CEC616F2-411E-4012-9C5B-2179DA0FA6A6 +subject +subject +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +D3A5CCEC-D582-459C-9190-56878BA2DD8E +content +content +1575627715 +Mhb +1575627719 +Mhb +text + + +6E388731-7056-4E8A-A08E-F00D4B7F47AD +creator +creator +1575627715 +Mhb +1575860890 +Mhb +创建者 +NULL +bigint(32) +32 + + +0F59C1ED-BEEF-4611-85E1-D2B734C5583F +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +F2E738E9-9BBE-45D9-ACB7-E7A3AE56F5FD +updater +updater +1575627715 +Mhb +1575860890 +Mhb +更新者 +NULL +bigint(32) +32 + + +E4BFD487-5EC6-4F23-8885-9934F2A00EC9 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +8100DA95-F266-4AF5-B531-71AD03A90E5A +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +2255D6F0-6E19-4583-B0C3-BD34751BA401 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +3E050872-07DB-4891-8B01-C645FFF85D21 +sys_menu +sys_menu +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单管理' ROW_FORMAT = Dynamic + + + +AC622DFC-3480-4008-AA3B-ED26881CAA93 +id +id +1575627715 +Mhb +1575860304 +Mhb +id +bigint(32) +32 +1 + + +121D5699-F67F-44C2-B491-56E17DED4FC0 +pid +pid +1575627715 +Mhb +1575860304 +Mhb +上级ID,一级菜单为0 +NULL +bigint(32) +32 + + +E59D2DA4-07CC-41B9-B33D-FF16AD57CACE +url +url +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +A4C9A30E-D00C-4A80-96EA-2CF74AAF5B0D +permissions +permissions +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +32789A89-C7ED-4623-85BC-537ACDE4DF2B +type +type +1575627715 +Mhb +1575627719 +Mhb +类型 0:菜单 1:按钮 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +E6E567C8-B599-4841-A620-77026A9B4827 +icon +icon +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +68A5D78C-F9BD-404A-940F-BA09BE1CFE3F +sort +sort +1575627715 +Mhb +1575627719 +Mhb +排序 +NULL +int(11) +11 + + +226EFB13-B697-4DDF-887C-56F752A85710 +creator +creator +1575627715 +Mhb +1575861967 +Mhb +创建者 +NULL +bigint(32) +32 + + +329E62AF-DDC4-4E21-A3B3-6E969F96AB8F +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +6BBD80F0-3679-4D2A-A9ED-6A2D2F988207 +updater +updater +1575627715 +Mhb +1575861967 +Mhb +更新者 +NULL +bigint(32) +32 + + +0FAAA683-7E5B-44C3-8EF1-363648D2C9F0 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +72DE01D1-7B49-4B02-96BA-AC3D77A12A0F +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +58671D8B-FD69-476C-91FE-1B8F88832F5B +idx_pid +idx_pid +1575627715 +Mhb +1575627719 +Mhb +idx_pid + + + + + +A2834894-2D59-49BA-9A6F-CEE0FDEC17D9 +idx_sort +idx_sort +1575627715 +Mhb +1575627719 +Mhb +idx_sort + + + + + + + + + + +2D3D9596-404B-4E5F-BD8C-B9898F1DE56E +sys_oss +sys_oss +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文件上传' ROW_FORMAT = Dynamic + + + +55F388A8-4FFE-4B7D-B6A3-A0AFF8CE2118 +id +id +1575627715 +Mhb +1575860953 +Mhb +id +bigint(32) +32 +1 + + +3F7EF8E5-628C-497D-BC3D-048448E34C5D +url +url +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +621C8AAC-7EB0-4384-9A7D-6287812F4596 +creator +creator +1575627715 +Mhb +1575860953 +Mhb +创建者 +NULL +bigint(32) +32 + + +FBEE4055-4887-423A-9063-F8160125EAAF +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +27A68632-900D-4778-95C5-26407BDF357C +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +61BC7698-640F-4D46-88CE-F4B3923A9C3C +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +247AB0AE-CAAB-48E3-B2D3-B45E68C4ED75 +sys_params +sys_params +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '参数管理' ROW_FORMAT = Dynamic + + + +4B7C9891-5565-4E89-8418-0FE0F1CE220B +id +id +1575627715 +Mhb +1575860834 +Mhb +id +bigint(32) +32 +1 + + +15BA8EA1-CBC2-4EF2-AC5C-1939E8F09AC4 +param_code +param_code +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 + + +945860B6-D134-485F-BBC7-8EA4C5888909 +param_value +param_value +1575627715 +Mhb +1575627719 +Mhb +varchar(2000) +2000 + + +43A17513-08B0-49F5-9958-33ACC001CCD9 +param_type +param_type +1575627715 +Mhb +1575627719 +Mhb +类型 0:系统参数 1:非系统参数 +1 +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +EADAF023-9C8F-4D8F-B023-21CB79E2DF5C +remark +remark +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +F476E89E-24F5-4E79-9199-CB942188B8EE +creator +creator +1575627715 +Mhb +1575860834 +Mhb +创建者 +NULL +bigint(32) +32 + + +CC0B4F24-1E2F-4E43-9F25-3EB2F12D3006 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +700805FD-B6CE-48C7-BD7D-E078FD1B07D9 +updater +updater +1575627715 +Mhb +1575860834 +Mhb +更新者 +NULL +bigint(32) +32 + + +3A416029-C771-4755-BA16-8C12B9F49104 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +036A6EAF-1D71-4181-825A-661F31502F2C +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +CFC7D93C-A23D-44EE-A0D9-D927FB3B81E9 +uk_param_code +uk_param_code +1575627715 +Mhb +1575627719 +Mhb +uk_param_code +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + +DA4BEFAB-FA06-4EC5-AB46-01EA8D270A71 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +C6F2E10E-0E90-40BA-8D4D-E8A536A47F96 +sys_region +sys_region +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '行政区域' ROW_FORMAT = Dynamic + + + +59C04A52-F0C9-4D2D-A15C-3BE998F23827 +id +id +1575627715 +Mhb +1575860771 +Mhb +id +bigint(32) +32 +1 + + +CB875F9A-9177-4C90-9DBE-A1A968A99112 +pid +pid +1575627715 +Mhb +1575860771 +Mhb +上级ID,一级为0 +NULL +bigint(32) +32 + + +0BD08184-57DC-4FFC-9804-AA6E0E98DAAC +name +name +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +CEC11AB1-EFAF-49C6-B078-634636169DC7 +tree_level +tree_level +1575627715 +Mhb +1575627719 +Mhb +层级 +NULL +tinyint(4) +4 + + +A85210C8-E455-4543-A02C-8BED32173C54 +leaf +leaf +1575627715 +Mhb +1575627719 +Mhb +是否叶子节点 0:否 1:是 +NULL +tinyint(4) +4 + + +C1659EAD-78EF-4A41-B341-70CB2788736A +sort +sort +1575627715 +Mhb +1575860771 +Mhb +排序 +NULL +bigint(32) +32 + + +BF8751E2-188C-43ED-AB7E-1D5C74ADD389 +creator +creator +1575627715 +Mhb +1575860771 +Mhb +创建者 +NULL +bigint(32) +32 + + +46641AC0-B8B5-4456-8E8F-CCFE754B4FCA +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +C6502EC0-3C01-4136-A21C-3117586F66F6 +updater +updater +1575627715 +Mhb +1575860771 +Mhb +更新者 +NULL +bigint(32) +32 + + +1C6A4C0E-8256-4589-85ED-FB3733D2CAA6 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +42CB078D-2C48-4779-B869-95C7F69625B8 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + + + + + + +40CDA285-E748-4E22-8242-BCA72ABFAA08 +sys_role +sys_role +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色管理' ROW_FORMAT = Dynamic + + + +217A7AFC-2DF7-4CD4-B670-DEB6EC6717AC +id +id +1575627715 +Mhb +1575860914 +Mhb +id +bigint(32) +32 +1 + + +49464548-E018-4B1D-8F56-E27574445729 +name +name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +FF95C973-C099-4353-8E51-A2C5416FDF5C +remark +remark +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +D1B90730-E941-4704-85A0-66299AF57221 +dept_id +dept_id +1575627715 +Mhb +1575860914 +Mhb +部门ID +NULL +bigint(32) +32 + + +D5D89783-B6F3-4A31-A668-C71B74B77792 +creator +creator +1575627715 +Mhb +1575860914 +Mhb +创建者 +NULL +bigint(32) +32 + + +CCA11AB6-8EDD-4CCF-9B5E-CDE87157A613 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +794E5CC5-2A01-40F6-8F62-78960848E8AB +updater +updater +1575627715 +Mhb +1575860914 +Mhb +更新者 +NULL +bigint(32) +32 + + +F56062C6-409C-4BE3-8B95-6E0187F17462 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +A2D679AB-19B6-41BC-B4F6-00EE9110FA05 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +9F1A53FB-7A5D-4C6B-A4C4-6847631E1868 +idx_dept_id +idx_dept_id +1575627715 +Mhb +1575627719 +Mhb +idx_dept_id + + + + + + + + + + +EE744184-1867-4539-A0CA-5B9647487C4C +sys_role_data_scope +sys_role_data_scope +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色数据权限' ROW_FORMAT = Dynamic + + + +F612EA36-9962-4961-8B1F-D6E7AFB1FE7D +id +id +1575627715 +Mhb +1575860976 +Mhb +id +bigint(32) +32 +1 + + +B0FE92E4-8688-44AE-8728-658DAE7B477D +role_id +role_id +1575627715 +Mhb +1575860976 +Mhb +角色ID +NULL +bigint(32) +32 + + +68D23DAA-CDB2-4212-BF57-4BA2FF021529 +dept_id +dept_id +1575627715 +Mhb +1575860976 +Mhb +部门ID +NULL +bigint(32) +32 + + +366667E3-52D2-4823-8230-11D143D6C883 +creator +creator +1575627715 +Mhb +1575860976 +Mhb +创建者 +NULL +bigint(32) +32 + + +8005ADE8-FA90-4633-AB9A-CFC21D91EAE8 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +BEA5FBF9-456B-4437-BDE3-3CFD7FB3954B +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +FD62465C-9456-4A6F-AAB2-C29B169C3344 +idx_role_id +idx_role_id +1575627715 +Mhb +1575627719 +Mhb +idx_role_id + + + + + + + + + + +3164016F-45D2-412C-A8D1-DB0AC2CB04D1 +sys_role_menu +sys_role_menu +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色菜单关系' ROW_FORMAT = Dynamic + + + +0D7BBAAD-CB81-4B93-A98A-B94C035C66ED +id +id +1575627715 +Mhb +1575861025 +Mhb +id +bigint(32) +32 +1 + + +81CB727A-67E0-4023-A0C2-41EB54321B42 +role_id +role_id +1575627715 +Mhb +1575861025 +Mhb +角色ID +NULL +bigint(32) +32 + + +A62A0E48-4B28-422E-BF48-8206EA8D53BA +menu_id +menu_id +1575627715 +Mhb +1575861025 +Mhb +菜单ID +NULL +bigint(32) +32 + + +DD8F097F-BAD8-46EF-A728-88CA938AA639 +creator +creator +1575627715 +Mhb +1575861025 +Mhb +创建者 +NULL +bigint(32) +32 + + +20920ECA-25EC-4AB6-819A-25BBD630EE33 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +C981CFC7-2EA0-485D-8042-CEC356DEFDC6 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +D617E5AB-0AE8-4CF7-AC2C-99CCA00411B7 +idx_role_id +idx_role_id +1575627715 +Mhb +1575627719 +Mhb +idx_role_id + + + + + +CAF344D3-D95F-4A84-9A74-80CFFE2EFF59 +idx_menu_id +idx_menu_id +1575627715 +Mhb +1575627719 +Mhb +idx_menu_id + + + + + + + + + + +24E81675-4E7F-4319-B703-D9A562AEFDE0 +sys_role_user +sys_role_user +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色用户关系' ROW_FORMAT = Dynamic + + + +CE22484B-6B1C-43AA-9F30-0F4222DFE1AD +id +id +1575627715 +Mhb +1575861003 +Mhb +id +bigint(32) +32 +1 + + +03690EDB-90EC-43DE-BD43-30106141C83A +role_id +role_id +1575627715 +Mhb +1575861003 +Mhb +角色ID +NULL +bigint(32) +32 + + +33DAD906-AFEF-479D-9489-2037BF10FD9D +user_id +user_id +1575627715 +Mhb +1575861003 +Mhb +用户ID +NULL +bigint(32) +32 + + +C4173478-19A5-4AB4-8312-416FAA249B94 +creator +creator +1575627715 +Mhb +1575861003 +Mhb +创建者 +NULL +bigint(32) +32 + + +BACEFE68-8CD4-4272-970C-BE8E0AB3F7D4 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +4F317FA2-C006-4810-BF2F-F7B2B567781E +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +BFF9419B-032A-43F6-8018-939EB5213CED +idx_role_id +idx_role_id +1575627715 +Mhb +1575627719 +Mhb +idx_role_id + + + + + +C335C619-CA22-4755-AC44-D641CDEDD48E +idx_user_id +idx_user_id +1575627715 +Mhb +1575627719 +Mhb +idx_user_id + + + + + + + + + + +1AC9C4B2-5D19-4B26-897A-7C1BFFF63F7E +sys_sms +sys_sms +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '短信' ROW_FORMAT = Dynamic + + + +8A21AD7C-3E3A-4D72-8C33-A1897740B2DE +id +id +1575627715 +Mhb +1575860802 +Mhb +id +bigint(32) +32 +1 + + +F40FDC7D-594A-43DE-AA2B-6A6BBBFFF0FC +platform +platform +1575627715 +Mhb +1575627719 +Mhb +平台类型 +tinyint(3) +3 +1 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +CA8E0C8F-1007-4319-A741-9C0FD7222604 +mobile +mobile +1575627715 +Mhb +1575627719 +Mhb +varchar(20) +20 + + +EBD36F17-DF4D-4931-94B2-AA918BB9A02E +params_1 +params_1 +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +9AC68093-4163-44FB-90AE-87FF682A83E0 +params_2 +params_2 +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +2BC8A341-B440-405E-8E4C-F763DE32EB55 +params_3 +params_3 +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +0E652889-5821-49C6-8CEF-6AD64478A51F +params_4 +params_4 +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +FAD4C6E1-B25D-4CDF-8B05-ED34BC5DFCFB +status +status +1575627715 +Mhb +1575627719 +Mhb +发送状态 0:失败 1:成功 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +6FED6DC6-7149-4FF6-9A48-5B13393ABE01 +creator +creator +1575627715 +Mhb +1575860802 +Mhb +创建者 +NULL +bigint(32) +32 + + +F5F72AEA-3888-4C18-8C64-45B6A47E6837 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +95D56D87-1198-41B3-B9BC-F9681E991376 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +C3DE5639-6BC6-4873-9FD0-78564AB27A8A +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +A58A7698-071B-44D7-AF80-D6D8921DC48A +sys_user +sys_user +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统用户' ROW_FORMAT = Dynamic + + + +AC7A4615-459F-4A48-9E68-B2577EF93BC3 +id +id +1575627715 +Mhb +1575860277 +Mhb +id +bigint(32) +32 +1 + + +17B53829-6D56-4598-AEA9-C06EF2834D97 +username +username +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +D41C3FBE-0992-421B-9CC8-BE1BC090AFF0 +password +password +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +DEF24AE2-AB2E-4CC4-82C0-F587CDB86208 +real_name +real_name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +924123F1-3B59-4FAF-9741-9AD042E80606 +head_url +head_url +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +1043B155-5ACF-4001-A70A-E558AAB616A8 +gender +gender +1575627715 +Mhb +1575627719 +Mhb +性别 0:男 1:女 2:保密 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +A239B1A1-AE14-4A3B-86B2-9D2F7FF9CED4 +email +email +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +6888AE0F-E133-4488-A7B5-B6E03C50C19A +mobile +mobile +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +BC22BBFB-68A5-45BC-8261-B81E89C11205 +dept_id +dept_id +1575627715 +Mhb +1575861998 +Mhb +部门ID +NULL +bigint(32) +32 + + +F617DEF0-53F7-4C81-A0B1-4EEB84BDA889 +super_admin +super_admin +1575627715 +Mhb +1575627719 +Mhb +超级管理员 0:否 1:是 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +7F7E5A58-921F-4D62-A615-B8EC20A1874B +status +status +1575627715 +Mhb +1575627719 +Mhb +状态 0:停用 1:正常 +NULL +tinyint(4) +4 + + +DC4FD58A-5646-4686-976C-CB87E91E6E6A +creator +creator +1575627715 +Mhb +1575861998 +Mhb +创建者 +NULL +bigint(32) +32 + + +22BB5FCF-209F-4F41-8879-ACB787BC7C1C +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +D2B92E58-1E65-4EC0-806C-44C1C0C4A049 +updater +updater +1575627715 +Mhb +1575861998 +Mhb +更新者 +NULL +bigint(32) +32 + + +04970014-4F19-485C-BCE5-669B1E00AD21 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +00D374D0-EF55-46C9-9576-B3D9C36F8845 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +A897E52A-0D35-424C-AAD8-5C3DBC88A2F9 +uk_username +uk_username +1575627715 +Mhb +1575627719 +Mhb +uk_username +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + +5002034A-4E71-4BBA-8AD4-822583E53791 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +A8C9390D-ACFD-4884-A2BB-81FC7E963F06 +sys_user_token +sys_user_token +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统用户Token' ROW_FORMAT = Dynamic + + + +83E02F1F-1C82-48A6-82DA-CD4EFA9D14A4 +id +id +1575627715 +Mhb +1575860928 +Mhb +id +bigint(32) +32 +1 + + +E3AF756A-1C01-4B12-B129-7314509AEC9C +user_id +user_id +1575627715 +Mhb +1575860928 +Mhb +用户id +bigint(32) +32 +1 + + +92C51463-0DAD-4A4C-9884-671003A7C354 +token +token +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +A6EE45F6-AF53-4F3B-A4BC-2F316E1BC5DF +expire_date +expire_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +2B4C27F5-FE17-4EE6-86A4-31D4B5657C56 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +277CECC7-4653-4C4B-854C-9BAAC9A846A4 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +341ADA0F-3333-469F-B49B-56DDB0BBF8F7 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +789407F0-85D0-4339-9B16-6BF7AEDB7132 +user_id +user_id +1575627715 +Mhb +1575627719 +Mhb +user_id +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + +4F9F2EFA-373A-45C9-99C4-91005B5A0669 +token +token +1575627715 +Mhb +1575627719 +Mhb +token +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + + + + + + +34248566-81C1-440F-A2DC-310D27B597C2 +control_bayonet_mid +control_bayonet_mid +1574155394 +Mhb +1575624501 +Mhb +布控和摄像头中间表 + + + +BE8962A9-0BF5-4D70-B0B8-49386D8FA61D +id +id +1574155394 +Mhb +1575861116 +Mhb +id +bigint(32) +32 +1 + + +9A3EF00D-C9FE-4624-9DE9-24D52CCCA692 +id_control_task +id_control_task +1575624441 +Mhb +1575861116 +Mhb +id布控id +bigint(32) +32 + + +CBB59FA0-0E7A-485E-AA38-D2A266CA557F +id_face_camera +id_face_camera +1575624473 +Mhb +1575861116 +Mhb +摄像头id +bigint(32) +32 + + +BE8A507C-3BC6-4C32-9C51-8DA1BC1DCDB8 +is_valid +is_valid +1574155394 +Mhb +1575624135 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +C034A691-DA39-4D27-857F-E1F4322623B1 +create_time +create_time +1574155394 +Mhb +1575624135 +Mhb +创建时间 +datetime + + +7DECBF16-045C-476F-B97F-5691E8724BA0 +update_time +update_time +1574155394 +Mhb +1575624135 +Mhb +更新时间 +datetime + + +602EA424-77B9-436E-B861-D9D13DA52FE9 +create_by +create_by +1574233787 +Mhb +1575624135 +Mhb +创建人 +varchar(32) +32 + + +86FF23B8-EDCB-439F-8DAC-8494EEB4308D +update_by +update_by +1574233787 +Mhb +1575624135 +Mhb +更新人 +varchar(32) +32 + + + + +D831BF3F-A19F-498D-80DE-E27A5E90CDDA +Key_1 +Key_1 +1574218123 +Mhb +1575624135 +Mhb + + + + + + + + + + + + +CA640E14-FD6F-4E42-855B-0A8CC8CED08F +Reference_1 +Reference_1 +1573443498 +Mhb +1573443498 +Mhb +0..* +1 +1 + + + + + + + + + + + +B97457BA-0E2B-4AB8-BD73-C1B917CDBB52 +1573443498 +Mhb +1573443498 +Mhb + + + + + + + + + + +EAC66D9E-DEDF-48C7-938A-FC51012212AE +Reference_2 +Reference_2 +1575624441 +Mhb +1575624441 +Mhb +0..* +1 +1 + + + + + + + + + + + +C4454DC3-3B36-4F7B-8C84-9206DA6A8034 +1575624441 +Mhb +1575624441 +Mhb + + + + + + + + + + +776ACDFD-7BEC-44C7-B8E0-2CDCF4AA96D6 +Reference_3 +Reference_3 +1575624473 +Mhb +1575624473 +Mhb +0..* +1 +1 + + + + + + + + + + + +FC20B0EB-6A62-44D9-A605-55B0FDC144A8 +1575624473 +Mhb +1575624473 +Mhb + + + + + + + + + + +969DEED2-95A2-4879-953C-903E5078A5A5 +Reference_4 +Reference_4 +1575624521 +Mhb +1575624521 +Mhb +0..* +1 +1 + + + + + + + + + + + +296E410E-E215-4872-B62D-359A9E7406E5 +1575624521 +Mhb +1575624521 +Mhb + + + + + + + + + + +FD5A8738-CF6F-4899-820D-A34ED667AEB6 +Reference_5 +Reference_5 +1575624526 +Mhb +1575624526 +Mhb +0..* +1 +1 + + + + + + + + + + + +7D51A18B-4561-48AA-86E7-9C48C377C5A0 +1575624526 +Mhb +1575624526 +Mhb + + + + + + + + + + + + +232A460E-291D-4EE1-AAE3-1613C9E99263 +PUBLIC +PUBLIC +1573436672 +Mhb +1573436672 +Mhb + + + + +09B937B0-C216-4794-9D7E-4ECE097A3E2E +MySQL 5.0 +MYSQL50 +1573436673 +Mhb +1573436673 +Mhb +file:///%_DBMS%/mysql50.xdb +F4F16ECD-F2F1-4006-AF6F-638D5C65F35E +4BA9F647-DAB1-11D1-9944-006097355D9B +1276524678 + + + + + + + + + + \ No newline at end of file diff --git a/doc/face.pdb b/doc/face.pdb new file mode 100644 index 0000000..81b99e9 --- /dev/null +++ b/doc/face.pdb @@ -0,0 +1,9530 @@ + + + + + + + + + +90F6E7F8-C9CE-45FA-A6FC-EFEE42BCE6C6 +PhysicalDataModel_1 +PhysicalDataModel_1 +1573436673 +Mhb +1575889044 +Mhb +[FolderOptions] + +[FolderOptions\Physical Objects] +GenerationCheckModel=Yes +GenerationPath= +GenerationOptions= +GenerationTasks= +GenerationTargets= +GenerationSelections= +RevPkey=Yes +RevFkey=Yes +RevAkey=Yes +RevCheck=Yes +RevIndx=Yes +RevOpts=Yes +RevViewAsTabl=No +RevViewOpts=Yes +RevSystAsTabl=Yes +RevTablPerm=No +RevViewPerm=No +RevProcPerm=No +RevDbpkPerm=No +RevSqncPerm=No +RevAdtPerm=No +RevUserPriv=No +RevUserOpts=No +RevGrpePriv=No +RevRolePriv=No +RevDtbsOpts=Yes +RevDtbsPerm=No +RevViewIndx=Yes +RevJidxOpts=Yes +RevStats=No +RevTspcPerm=No +RevCaseSensitive=No +GenTrgrStdMsg=Yes +GenTrgrMsgTab= +GenTrgrMsgNo= +GenTrgrMsgTxt= +TrgrPreserve=No +TrgrIns=Yes +TrgrUpd=Yes +TrgrDel=Yes +TrgrC2Ins=Yes +TrgrC2Upd=Yes +TrgrC3=Yes +TrgrC4=Yes +TrgrC5=Yes +TrgrC6=Yes +TrgrC7=Yes +TrgrC8=Yes +TrgrC9=Yes +TrgrC10=Yes +TrgrC11=Yes +TrgrC1=Yes +TrgrC12Ins=Yes +TrgrC12Upd=Yes +TrgrC13=Yes +UpdateTableStatistics=Yes +UpdateColumnStatistics=Yes + +[FolderOptions\Physical Objects\Database Generation] +GenScriptName=face.sql +GenScriptName0= +GenScriptName1= +GenScriptName2= +GenScriptName3= +GenScriptName4= +GenScriptName5= +GenScriptName6= +GenScriptName7= +GenScriptName8= +GenScriptName9= +GenPathName=C:\Users\Mhb\Desktop\face\ +GenSingleFile=Yes +GenODBC=No +GenCheckModel=Yes +GenScriptPrev=Yes +GenArchiveModel=No +GenUseSync=No +GenSyncChoice=0 +GenSyncArch= +GenSyncRmg=0 + +[FolderOptions\Physical Objects\Database Generation\Format] +GenScriptTitle=No +GenScriptNamLabl=No +GenScriptQDtbs=No +GenScriptQOwnr=No +GenScriptCase=0 +GenScriptEncoding=UTF8 +GenScriptNAcct=No +IdentifierDelimiter=" + +[FolderOptions\Physical Objects\Database Generation\Database] +Create=Yes +Open=Yes +Close=Yes +Drop=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Database\Create] +Physical Options=Yes +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\Tablespace] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Tablespace\Create] +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\Storage] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\User] +Create=Yes +Drop=Yes +Comment=Yes +Privilege=No + +[FolderOptions\Physical Objects\Database Generation\User\Create] +Physical Options=No + +[FolderOptions\Physical Objects\Database Generation\Group] +Create=Yes +Drop=Yes +Comment=Yes +Privilege=No + +[FolderOptions\Physical Objects\Database Generation\Role] +Create=Yes +Drop=Yes +Privilege=No + +[FolderOptions\Physical Objects\Database Generation\UserDefinedDataType] +Create=Yes +Comment=Yes +Drop=Yes + +[FolderOptions\Physical Objects\Database Generation\UserDefinedDataType\Create] +Default value=Yes +Check=Yes + +[FolderOptions\Physical Objects\Database Generation\AbstractDataType] +Create=Yes +Header=Yes +Footer=Yes +Drop=Yes +Comment=Yes +Install JAVA class=Yes +Remove JAVA class=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Rule] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Default] +Create=Yes +Comment=Yes +Drop=Yes + +[FolderOptions\Physical Objects\Database Generation\Sequence] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Table&&Column] + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Table] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Table\Create] +Check=Yes +Physical Options=Yes +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Table\Create\Check] +Constraint declaration=No + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Column] +User datatype=No +Default value=Yes +Check=Yes +Physical Options=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Column\Check] +Constraint declaration=No + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key] + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Primary key] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Primary key\Create] +Constraint declaration=No +Physical Options=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Alternate key] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Alternate key\Create] +Constraint declaration=No +Physical Options=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Foreign key] +Create=No +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Foreign key\Create] +Constraint declaration=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Index] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Index\Create] +Constraint declaration=Yes +Physical Options=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Index\Filter] +Primary key=No +Foreign key=No +Alternate key=No +Cluster=Yes +Other=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Trigger] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Table&&Column\Trigger\Filter] +For insert=Yes +For update=Yes +For delete=Yes +For other=Yes + +[FolderOptions\Physical Objects\Database Generation\View] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\View\Create] +Force Column list=No +Physical Options=Yes +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\View\ViewColumn] +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\View\ViewIndex] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\View\ViewIndex\Create] +Physical Options=Yes + +[FolderOptions\Physical Objects\Database Generation\View\ViewIndex\Filter] +Cluster=Yes +Other=Yes + +[FolderOptions\Physical Objects\Database Generation\View\Trigger] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\View\Trigger\Filter] +For insert=Yes +For update=Yes +For delete=Yes +For other=Yes + +[FolderOptions\Physical Objects\Database Generation\DBMSTrigger] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Synonym] +Create=Yes +Drop=Yes + +[FolderOptions\Physical Objects\Database Generation\Synonym\Filter] +Table=Yes +View=Yes +Proc=Yes +Synonym=Yes +Database Package=Yes +Sequence=Yes + +[FolderOptions\Physical Objects\Database Generation\JoinIndex] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\JoinIndex\Create] +Physical Options=Yes +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\Procedure] +Create=Yes +Drop=Yes +Comment=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\Procedure\Create] +Header=Yes +Footer=Yes + +[FolderOptions\Physical Objects\Database Generation\DatabasePackage] +Create=Yes +Drop=Yes +Permission=No + +[FolderOptions\Physical Objects\Database Generation\WebService] +Create=Yes +Drop=Yes +Comment=Yes + +[FolderOptions\Physical Objects\Database Generation\Dimension] +Create=Yes +Drop=Yes + +[FolderOptions\Physical Objects\Database Generation\Synchronization] +GenBackupTabl=1 +GenKeepBackTabl=1 +GenTmpTablDrop=No +GenKeepTablOpts=No + +[FolderOptions\Physical Objects\Test Data] +GenDataPathName= +GenDataSinglefile=Yes +GenDataScriptName=testdata +GenDataScriptName0= +GenDataScriptName1= +GenDataScriptName2= +GenDataScriptName3= +GenDataScriptName4= +GenDataScriptName5= +GenDataScriptName6= +GenDataScriptName7= +GenDataScriptName8= +GenDataScriptName9= +GenDataOdbc=0 +GenDataDelOld=No +GenDataTitle=Yes +GenDataDefNumRows=20 +GenDataCommit=0 +GenDataPacket=0 +GenDataOwner=Yes +GenDataProfNumb= +GenDataProfChar= +GenDataProfDate= +GenDataCSVSeparator=, +GenDataFileFormat=CSV +GenDataUseWizard=No + +[FolderOptions\Pdm] +IndxIQName=%COLUMN%_%INDEXTYPE% +IndxPK=Yes +IndxFK=Yes +IndxAK=Yes +IndxPKName=%TABLE%_PK +IndxFKName=%REFR%_FK +IndxAKName=%AKEY%_AK +IndxPreserve=No +IndxThreshold=0 +IndxStats=No +RefrPreserve=No +JidxPreserve=No +RbldMultiFact=Yes +RbldMultiDim=Yes +RbldMultiJidx=Yes +CubePreserve=No +TablStProcPreserve=No +ProcDepPreserve=Yes +TrgrDepPreserve=Yes +CubeScriptPath= +CubeScriptCase=0 +CubeScriptEncoding=ANSI +CubeScriptNacct=No +CubeScriptHeader=No +CubeScriptExt=csv +CubeScriptExt0=txt +CubeScriptExt1= +CubeScriptExt2= +CubeScriptSep=, +CubeScriptDeli=" +EstimationYears=0 +DfltDomnName=D_%.U:VALUE% +DfltColnName=D_%.U:VALUE% +DfltReuse=Yes +DfltDrop=Yes + +[FolderOptions\CheckModel] + +[FolderOptions\CheckModel\Package] + +[FolderOptions\CheckModel\Package\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CheckPackageMissTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\DefaultCheckPackageMissTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CircularReference] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\ConstraintName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CnstMaxLen] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\CircularDependency] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Package\ShortcutUniqCode] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Table] + +[FolderOptions\CheckModel\Table\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\UniqIndex] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\MaxLen - NAME] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyColl - COLNCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyColl - INDXCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyColl - KEYCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\SerialColumnNumber] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyCollYesYes] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\TableIndexes] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\Mapping] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\MappingSFMap] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\EmptyColl - PERMCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Table\CheckTablePartitionKey] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableStartDate] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableRefNoLifecycle] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableSourceMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTablePartialColumnMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableKeyColumnMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\CheckTableNotOnLifecycleTablespace] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table\MYSQL50_Table_Table_storage_type] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column] + +[FolderOptions\CheckModel\Table.Column\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\DomainDivergence] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\ColumnMandatory] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckNumParam] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckPrecSupLng] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckUndefDttp] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\FkeyDttpDivergence] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\FkeyCheckDivergence] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\ColnSqncNoKey] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\ColnSqncDttp] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\SerialColumnFK] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\ColumnCompExpr] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckColumnOneToOneMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckColumnDataTypeMapping] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckColumnNoMapping] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\CheckDttpIncompatibleFormat] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\MYSQL50_Column_Auto_increment_key] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Column\MYSQL50_Column_Datatype_attributes] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index] + +[FolderOptions\CheckModel\Table.Index\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\EmptyColl - CIDXCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\UndefIndexType] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\IndexColumnCount] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\IQIndxHNGUniq] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\CheckIncludeColl - Tabl] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Index\MYSQL50_Index_Fulltext_indexes_validity] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key] + +[FolderOptions\CheckModel\Table.Key\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\EmptyColl - COLNCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\CheckIncludeColl - Tabl] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Key\MultiKeySqnc] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger] + +[FolderOptions\CheckModel\Table.Trigger\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table.Trigger\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index] + +[FolderOptions\CheckModel\Join Index\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Join Index\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View] + +[FolderOptions\CheckModel\View\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View\EmptyColl - PERMCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\View.View Index] + +[FolderOptions\CheckModel\View.View Index\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\EmptyColl - CIDXCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\IndexColumnCount] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View.View Index\CheckIncludeColl - Tabl] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference] + +[FolderOptions\CheckModel\Reference\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\Reflexive] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\EmptyColl - RFJNCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\IncompleteJoin] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Reference\JoinOrder] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference] + +[FolderOptions\CheckModel\View Reference\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\View Reference\EmptyColl - VRFJNCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain] + +[FolderOptions\CheckModel\Domain\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckNumParam] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckPrecSupLng] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckUndefDttp] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Domain\CheckDttpIncompatibleFormat] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default] + +[FolderOptions\CheckModel\Default\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\DfltValeEmpty] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Default\DfltSameVale] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User] + +[FolderOptions\CheckModel\User\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\User\UniquePassword] +CheckSeverity=No +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Group] + +[FolderOptions\CheckModel\Group\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\EmptyColl - USERCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Group\UniquePassword] +CheckSeverity=No +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Role] + +[FolderOptions\CheckModel\Role\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Role\EmptyColl - USERCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure] + +[FolderOptions\CheckModel\Procedure\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\ProcBodyEmpty] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Procedure\EmptyColl - PERMCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\DBMS Trigger] + +[FolderOptions\CheckModel\DBMS Trigger\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\DBMS Trigger\DbmsTriggerEvent] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source] + +[FolderOptions\CheckModel\Data Source\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\EmptyColl - MODLSRC] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\DtscTargets] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Source\CheckDataSourceModels] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Horizontal Partitioning] + +[FolderOptions\CheckModel\Horizontal Partitioning\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Horizontal Partitioning\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Horizontal Partitioning\EmptyColl - PARTCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Horizontal Partitioning\TargetTables] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Vertical Partitioning] + +[FolderOptions\CheckModel\Vertical Partitioning\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Vertical Partitioning\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Vertical Partitioning\EmptyColl - PARTCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Vertical Partitioning\TargetTables] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table Collapsing] + +[FolderOptions\CheckModel\Table Collapsing\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table Collapsing\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table Collapsing\EmptyColl - TargetTable] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Table Collapsing\TargetTables] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact] + +[FolderOptions\CheckModel\Fact\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\EmptyColl - MEASCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\Mapping] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\MappingSFMap] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\EmptyColl - ALLOLINKCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact\CubeDupAssociation] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension] + +[FolderOptions\CheckModel\Dimension\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\EmptyColl - DATTRCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\EmptyColl - HIERCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\DimnDupHierarchy] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\DimnDefHierarchy] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\Mapping] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\MappingSFMap] +CheckSeverity=No +FixRequested=Yes +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension\SerialColumnNumber] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association] + +[FolderOptions\CheckModel\Association\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Association\EmptyColl - Hierarchy] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute] + +[FolderOptions\CheckModel\Dimension.Attribute\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Attribute\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure] + +[FolderOptions\CheckModel\Fact.Measure\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Fact.Measure\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy] + +[FolderOptions\CheckModel\Dimension.Hierarchy\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Dimension.Hierarchy\EmptyColl - DATTRCOL] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym] + +[FolderOptions\CheckModel\Synonym\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\MaxLen - NAME] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Synonym\EmptyColl - BASEOBJ] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type] + +[FolderOptions\CheckModel\Abstract Data Type\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\AdtInstantiable] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type\AdtAbstractUsed] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure] + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\AdtProcUniqName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\UniqueDefinition] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Abstract Data Type.Abstract Data Type Procedure\ReturnDataType] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package] + +[FolderOptions\CheckModel\Database Package\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\MaxLen - NAME] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\EmptyColl - PROCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package\EmptyColl - CURCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package\EmptyColl - VARCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package\EmptyColl - TYPCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package\EmptyColl - EXCCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package.Database Package Procedure] + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\UniqueDefinition] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\EmptyColl - PARM] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package.Database Package Procedure\ReturnDataType] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence] + +[FolderOptions\CheckModel\Sequence\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Sequence\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor] + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\UniqueDefinition] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\ReturnDataType] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Cursor\EmptyColl - PARM] +CheckSeverity=Yes +FixRequested=No +CheckRequested=No + +[FolderOptions\CheckModel\Database Package.Database Package Variable] + +[FolderOptions\CheckModel\Database Package.Database Package Variable\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Variable\CheckUndefDttp] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type] + +[FolderOptions\CheckModel\Database Package.Database Package Type\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Type\UniqueDefinition] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception] + +[FolderOptions\CheckModel\Database Package.Database Package Exception\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database Package.Database Package Exception\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace] + +[FolderOptions\CheckModel\Tablespace\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Tablespace\IsObjectUsed] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage] + +[FolderOptions\CheckModel\Storage\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Storage\IsObjectUsed] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database] + +[FolderOptions\CheckModel\Database\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Database\IsObjectUsed] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service] + +[FolderOptions\CheckModel\Web Service\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation] + +[FolderOptions\CheckModel\Web Service.Web Operation\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Web Service.Web Operation\MaxLen - CODE] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle] + +[FolderOptions\CheckModel\Lifecycle\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\CheckLifecyclePhase] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\CheckLifecycleRetention] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle\CheckPartitionRange] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase] + +[FolderOptions\CheckModel\Lifecycle.Phase\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseTbspace] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseIQTbspace] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseDuplicateTbspace] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseTbspaceCurrency] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseRetention] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseIdlePeriod] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseDataSource] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Lifecycle.Phase\CheckPhaseExternalOnFirst] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Replication] + +[FolderOptions\CheckModel\Replication\PartialReplication] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule] + +[FolderOptions\CheckModel\Business Rule\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Business Rule\EmptyColl - OBJCOL] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object] + +[FolderOptions\CheckModel\Extended Object\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Object\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link] + +[FolderOptions\CheckModel\Extended Link\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Extended Link\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File] + +[FolderOptions\CheckModel\File\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\File\CheckPathExists] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format] + +[FolderOptions\CheckModel\Data Format\CheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\CheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\DefaultCheckUseOnlyTerms] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\DefaultCheckUseTermBySynonym] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\NotApprovedTerms] +CheckSeverity=Yes +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\UniqueName] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\UniqueCode] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes + +[FolderOptions\CheckModel\Data Format\CheckDataFormatNullExpression] +CheckSeverity=No +FixRequested=No +CheckRequested=Yes +[ModelOptions] + +[ModelOptions\Physical Objects] +CaseSensitive=No +DisplayName=Yes +EnableTrans=No +UseTerm=No +EnableRequirements=No +EnableFullShortcut=Yes +DefaultDttp= +IgnoreOwner=No +RebuildTrigger=Yes +RefrUnique=No +RefrAutoMigrate=Yes +RefrMigrateReuse=Yes +RefrMigrateDomain=Yes +RefrMigrateCheck=Yes +RefrMigrateRule=Yes +RefrMigrateExtd=No +RefrMigrDefaultLink=No +RefrDfltImpl=D +RefrPrgtColn=No +RefrMigrateToEnd=No +RebuildTriggerDep=No +ColnFKName=%.3:PARENT%_%COLUMN% +ColnFKNameUse=No +DomnCopyDttp=Yes +DomnCopyChck=No +DomnCopyRule=No +DomnCopyMand=No +DomnCopyExtd=No +DomnCopyProf=No +Notation=0 +DomnDefaultMandatory=No +ColnDefaultMandatory=No +TablDefaultOwner= +ViewDefaultOwner= +TrgrDefaultOwnerTabl= +TrgrDefaultOwnerView= +IdxDefaultOwnerTabl= +IdxDefaultOwnerView= +JdxDefaultOwner= +DBPackDefaultOwner= +SeqDefaultOwner= +ProcDefaultOwner= +DBMSTrgrDefaultOwner= +Currency=USD +RefrDeleteConstraint=1 +RefrUpdateConstraint=1 +RefrParentMandatory=No +RefrParentChangeAllow=Yes +RefrCheckOnCommit=No + +[ModelOptions\Physical Objects\NamingOptionsTemplates] + +[ModelOptions\Physical Objects\ClssNamingOptions] + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMPCKG] + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMPCKG\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMPCKG\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMDOMN] + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMDOMN\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\PDMDOMN\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\TABL] + +[ModelOptions\Physical Objects\ClssNamingOptions\TABL\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\TABL\Code] +Template= +MaxLen=64 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\COLN] + +[ModelOptions\Physical Objects\ClssNamingOptions\COLN\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\COLN\Code] +Template= +MaxLen=64 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\INDX] + +[ModelOptions\Physical Objects\ClssNamingOptions\INDX\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\INDX\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\REFR] + +[ModelOptions\Physical Objects\ClssNamingOptions\REFR\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\REFR\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VREF] + +[ModelOptions\Physical Objects\ClssNamingOptions\VREF\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VREF\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEW] + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEW\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEW\Code] +Template= +MaxLen=64 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEWC] + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEWC\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\VIEWC\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBSERV] + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBSERV\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBSERV\Code] +Template= +MaxLen=254 +Case=M +ValidChar='a'-'z','A'-'Z','0'-'9',"/-_.!~*'()" +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBOP] + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBOP\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WEBOP\Code] +Template= +MaxLen=254 +Case=M +ValidChar='a'-'z','A'-'Z','0'-'9',"/-_.!~*'()" +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WPARAM] + +[ModelOptions\Physical Objects\ClssNamingOptions\WPARAM\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\WPARAM\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FACT] + +[ModelOptions\Physical Objects\ClssNamingOptions\FACT\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FACT\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DIMN] + +[ModelOptions\Physical Objects\ClssNamingOptions\DIMN\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DIMN\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\MEAS] + +[ModelOptions\Physical Objects\ClssNamingOptions\MEAS\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\MEAS\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DATTR] + +[ModelOptions\Physical Objects\ClssNamingOptions\DATTR\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DATTR\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FILO] + +[ModelOptions\Physical Objects\ClssNamingOptions\FILO\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FILO\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMEOBJ] + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMEOBJ\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMEOBJ\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMELNK] + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMELNK\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\FRMELNK\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DefaultClass] + +[ModelOptions\Physical Objects\ClssNamingOptions\DefaultClass\Name] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Physical Objects\ClssNamingOptions\DefaultClass\Code] +Template= +MaxLen=254 +Case=M +ValidChar= +InvldChar= +AllValid=Yes +NoAccent=No +DefaultChar= +Script= +ConvTable= +ConvTablePath=%_HOME%\Resource Files\Conversion Tables + +[ModelOptions\Connection] + +[ModelOptions\Pdm] + +[ModelOptions\Generate] + +[ModelOptions\Generate\Xsm] +GenRootElement=Yes +GenComplexType=No +GenAttribute=Yes +CheckModel=Yes +SaveLinks=Yes +ORMapping=No +NameToCode=No + +[ModelOptions\Generate\Pdm] +RRMapping=No + +[ModelOptions\Generate\Cdm] +CheckModel=Yes +SaveLinks=Yes +NameToCode=No +Notation=2 + +[ModelOptions\Generate\Oom] +CheckModel=Yes +SaveLinks=Yes +ORMapping=No +NameToCode=Yes +ClassPrefix= + +[ModelOptions\Generate\Ldm] +CheckModel=Yes +SaveLinks=Yes +NameToCode=No + +[ModelOptions\Default Opts] + +[ModelOptions\Default Opts\TABL] +PhysOpts= + +[ModelOptions\Default Opts\COLN] +PhysOpts= + +[ModelOptions\Default Opts\INDX] +PhysOpts= + +[ModelOptions\Default Opts\AKEY] +PhysOpts= + +[ModelOptions\Default Opts\PKEY] +PhysOpts= + +[ModelOptions\Default Opts\STOR] +PhysOpts= + +[ModelOptions\Default Opts\TSPC] +PhysOpts= + +[ModelOptions\Default Opts\SQNC] +PhysOpts= + +[ModelOptions\Default Opts\DTBS] +PhysOpts= + +[ModelOptions\Default Opts\USER] +PhysOpts= + +[ModelOptions\Default Opts\JIDX] +PhysOpts= + + +9E1F518A-7D51-4939-BAD2-58F09FDE6A85 +MySQL 5.0 +MYSQL50 +1573436673 +Mhb +1573436673 +Mhb + +F4F16ECD-F2F1-4006-AF6F-638D5C65F35E +4BA9F647-DAB1-11D1-9944-006097355D9B + + + + +AC53207B-2EBA-4AC0-96E5-909C17A10072 +PhysicalDiagram_1 +PhysicalDiagram_1 +1573436673 +Mhb +1575889044 +Mhb +[DisplayPreferences] + +[DisplayPreferences\PDM] + +[DisplayPreferences\General] +Adjust to text=Yes +Snap Grid=No +Constrain Labels=Yes +Display Grid=No +Show Page Delimiter=Yes +Show Links intersections=Yes +Activate automatic link routing=Yes +Grid size=0 +Graphic unit=2 +Window color=255, 255, 255 +Background image= +Background mode=8 +Watermark image= +Watermark mode=8 +Show watermark on screen=No +Gradient mode=0 +Gradient end color=255, 255, 255 +Show Swimlane=No +SwimlaneVert=Yes +TreeVert=No +CompDark=0 + +[DisplayPreferences\Object] +Show Icon=No +Mode=2 +Trunc Length=40 +Word Length=40 +Word Text=!"#$%&')*+,-./:;=>?@\]^_`|}~ +Shortcut IntIcon=Yes +Shortcut IntLoct=Yes +Shortcut IntFullPath=No +Shortcut IntLastPackage=Yes +Shortcut ExtIcon=Yes +Shortcut ExtLoct=No +Shortcut ExtFullPath=No +Shortcut ExtLastPackage=Yes +Shortcut ExtIncludeModl=Yes +EObjShowStrn=Yes +ExtendedObject.Comment=No +ExtendedObject.IconPicture=No +ExtendedObject.TextStyle=No +ExtendedObject_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Object Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <Separator Name="Separator" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +ELnkShowStrn=Yes +ELnkShowName=Yes +ExtendedLink_SymbolLayout=<Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Source" >[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] </Form>[CRLF]</Form> +FileObject.Stereotype=No +FileObject.DisplayName=Yes +FileObject.LocationOrName=No +FileObject.IconPicture=No +FileObject.TextStyle=No +FileObject.IconMode=Yes +FileObject_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Location" Attribute="LocationOrName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +Package.Stereotype=Yes +Package.Comment=No +Package.IconPicture=No +Package.TextStyle=No +Package_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <Separator Name="Separator" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +Display Model Version=Yes +Table.Stereotype=Yes +Table.DisplayName=Yes +Table.OwnerDisplayName=No +Table.Columns=Yes +Table.Columns._Filter="All Columns" PDMCOLNALL +Table.Columns._Columns=Stereotype DataType KeyIndicator +Table.Columns._Limit=-5 +Table.Keys=No +Table.Keys._Columns=Stereotype Indicator +Table.Indexes=No +Table.Indexes._Columns=Stereotype +Table.Triggers=No +Table.Triggers._Columns=Stereotype +Table.Comment=No +Table.IconPicture=No +Table.TextStyle=No +Table_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Owner and Name" Attribute="OwnerDisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <Separator Name="Separator" />[CRLF] <StandardCollection Name="Columns" Collection="Columns" Columns="Stereotype No\r\nDisplayName Yes\r\nDataType No\r\nSymbolDataType No &quot;Domain or Data type&quot;\r\nDomain No\r\nKeyIndicator No\r\nIndexIndicator No\r\nNullStatus No" Filters="&quot;All Columns&quot; PDMCOLNALL &quot;&quot;\r\n&quot;PK Columns&quot; PDMCOLNPK &quot;\&quot;PRIM \&quot;TRUE\&quot; TRUE\&quot;&quot;\r\n&quot;Key Columns&quot; PDMCOLNKEY &quot;\&quot;KEYS \&quot;TRUE\&quot; TRUE\&quot;&quot;" HasLimit="Yes" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Keys" Collection="Keys" Columns="Stereotype No\r\nDisplayName Yes\r\nIndicator No" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Indexes" Collection="Indexes" Columns="Stereotype No\r\nDisplayName Yes\r\nIndicator No" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Triggers" Collection="Triggers" Columns="Stereotype No\r\nDisplayName Yes" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +View.Stereotype=Yes +View.DisplayName=Yes +View.OwnerDisplayName=No +View.Columns=Yes +View.Columns._Columns=DisplayName +View.Columns._Limit=-5 +View.TemporaryVTables=Yes +View.Indexes=No +View.Comment=No +View.IconPicture=No +View.TextStyle=No +View_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Owner and Name" Attribute="OwnerDisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <Separator Name="Separator" />[CRLF] <StandardCollection Name="Columns" Collection="Columns" Columns="DisplayName No\r\nExpression No\r\nDataType No\r\nSymbolDataType No &quot;Domain or Data type&quot;\r\nIndexIndicator No" HasLimit="Yes" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Tables" Collection="TemporaryVTables" Columns="Name Yes" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Indexes" Collection="Indexes" Columns="DisplayName Yes" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +Procedure.Stereotype=No +Procedure.DisplayName=Yes +Procedure.OwnerDisplayName=No +Procedure.Comment=No +Procedure.IconPicture=No +Procedure.TextStyle=No +Procedure_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Owner and Name" Attribute="OwnerDisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <Separator Name="Separator" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> +Reference.Cardinality=No +Reference.ImplementationType=No +Reference.ChildRole=Yes +Reference.Stereotype=Yes +Reference.DisplayName=No +Reference.ForeignKeyConstraintName=No +Reference.JoinExpression=No +Reference.Integrity=No +Reference.ParentRole=Yes +Reference_SymbolLayout=<Form>[CRLF] <Form Name="Source" >[CRLF] <StandardAttribute Name="Cardinality" Attribute="Cardinality" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Implementation" Attribute="ImplementationType" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Child Role" Attribute="ChildRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="No" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Cons&amp;traint Name" Attribute="ForeignKeyConstraintName" Prefix="" Suffix="" Caption="Cons&amp;traint Name" Mandatory="No" />[CRLF] <StandardAttribute Name="Join" Attribute="JoinExpression" Prefix="" Suffix="" Caption="Join" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <StandardAttribute Name="Referential integrity" Attribute="Integrity" Prefix="" Suffix="" Caption="Referential integrity" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] <StandardAttribute Name="Parent Role" Attribute="ParentRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF]</Form> +ViewReference.ChildRole=Yes +ViewReference.Stereotype=Yes +ViewReference.DisplayName=No +ViewReference.JoinExpression=No +ViewReference.ParentRole=Yes +ViewReference_SymbolLayout=<Form>[CRLF] <Form Name="Source" >[CRLF] <StandardAttribute Name="Child Role" Attribute="ChildRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="No" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Join Expression" Attribute="JoinExpression" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] <StandardAttribute Name="Parent Role" Attribute="ParentRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF]</Form> + +[DisplayPreferences\Symbol] + +[DisplayPreferences\Symbol\FRMEOBJ] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=6000 +Height=2000 +Brush color=255 255 255 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=64 +Brush gradient color=192 192 192 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 255 128 128 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\FRMELNK] +CENTERFont=新宋体,8,N +CENTERFont color=0, 0, 0 +Line style=1 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 128 128 255 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\FILO] +OBJSTRNFont=新宋体,8,N +OBJSTRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +LCNMFont=新宋体,8,N +LCNMFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4800 +Height=3600 +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 0 0 255 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\PDMPCKG] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4800 +Height=4000 +Brush color=255 255 192 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=65 +Brush gradient color=255 255 255 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 178 178 178 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\TABL] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +OWNRDISPNAMEFont=新宋体,8,N +OWNRDISPNAMEFont color=0, 0, 0 +ColumnsFont=新宋体,8,N +ColumnsFont color=0, 0, 0 +TablePkColumnsFont=新宋体,8,U +TablePkColumnsFont color=0, 0, 0 +TableFkColumnsFont=新宋体,8,N +TableFkColumnsFont color=0, 0, 0 +KeysFont=新宋体,8,N +KeysFont color=0, 0, 0 +IndexesFont=新宋体,8,N +IndexesFont color=0, 0, 0 +TriggersFont=新宋体,8,N +TriggersFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4800 +Height=4000 +Brush color=178 214 252 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=65 +Brush gradient color=255 255 255 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 0 128 192 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\VIEW] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +OWNRDISPNAMEFont=新宋体,8,N +OWNRDISPNAMEFont color=0, 0, 0 +ColumnsFont=新宋体,8,N +ColumnsFont color=0, 0, 0 +TablePkColumnsFont=新宋体,8,U +TablePkColumnsFont color=0, 0, 0 +TableFkColumnsFont=新宋体,8,N +TableFkColumnsFont color=0, 0, 0 +TemporaryVTablesFont=新宋体,8,N +TemporaryVTablesFont color=0, 0, 0 +IndexesFont=新宋体,8,N +IndexesFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4800 +Height=4000 +Brush color=208 208 255 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=65 +Brush gradient color=255 255 255 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 128 128 192 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\PROC] +STRNFont=新宋体,8,N +STRNFont color=0, 0, 0 +DISPNAMEFont=新宋体,8,N +DISPNAMEFont color=0, 0, 0 +OWNRDISPNAMEFont=新宋体,8,N +OWNRDISPNAMEFont color=0, 0, 0 +LABLFont=新宋体,8,N +LABLFont color=0, 0, 0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Width=4000 +Height=1000 +Brush color=255 255 192 +Fill Color=Yes +Brush style=6 +Brush bitmap mode=12 +Brush gradient mode=65 +Brush gradient color=255 255 255 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 128 108 0 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\REFR] +SOURCEFont=新宋体,8,N +SOURCEFont color=0, 0, 0 +CENTERFont=新宋体,8,N +CENTERFont color=0, 0, 0 +DESTINATIONFont=新宋体,8,N +DESTINATIONFont color=0, 0, 0 +Line style=1 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 0 128 192 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\VREF] +SOURCEFont=新宋体,8,N +SOURCEFont color=0, 0, 0 +CENTERFont=新宋体,8,N +CENTERFont color=0, 0, 0 +DESTINATIONFont=新宋体,8,N +DESTINATIONFont color=0, 0, 0 +Line style=1 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 128 128 192 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\USRDEPD] +OBJXSTRFont=新宋体,8,N +OBJXSTRFont color=0, 0, 0 +Line style=1 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=2 0 128 128 255 +Shadow color=192 192 192 +Shadow=0 + +[DisplayPreferences\Symbol\Free Symbol] +Free TextFont=新宋体,8,N +Free TextFont color=0, 0, 0 +Line style=0 +AutoAdjustToText=Yes +Keep aspect=No +Keep center=No +Keep size=No +Brush color=255 255 255 +Fill Color=Yes +Brush style=1 +Brush bitmap mode=12 +Brush gradient mode=0 +Brush gradient color=118 118 118 +Brush background image= +Custom shape= +Custom text mode=0 +Pen=1 0 0 0 255 +Shadow color=192 192 192 +Shadow=0 +(8268, 11693) +((315,354), (433,354)) +1 +15 + + +1573443498 +1575855296 +((-21737,-53172), (-14146,-33693)) +((-21337,-52772),(-14771,-52772),(-14771,-34093)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N +4 + + + + + + + + + + + +1575624441 +1575855293 +((7952,-65177), (9202,-37779)) +((8577,-64777),(8577,-38179)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N + + + + + + + + + + + +1575624473 +1575855293 +((-42707,-69189), (1113,-47991)) +((713,-68789),(-42082,-68789),(-42082,-48391)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N + + + + + + + + + + + +1575624521 +1575855289 +((663,-51761), (8002,-37779)) +((1063,-51361),(7377,-51361),(7377,-38179)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N + + + + + + + + + + + +1575624526 +1575855289 +((-12582,-47749), (-11332,-33693)) +((-11957,-47349),(-11957,-34093)) +1 +1 +12615680 +12632256 +CENTER 0 新宋体,8,N +SOURCE 0 新宋体,8,N +DESTINATION 0 新宋体,8,N + + + + + + + + + + + +1573436700 +1575889010 +-1 +((-45485,-48391), (-25299,-22219)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1573436823 +1575889010 +-1 +((-20969,-34093), (-8507,-25245)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1573439850 +1575889010 +-1 +((5372,-38179), (20150,-22731)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1573442367 +1575889010 +-1 +((24745,-63550), (40683,-50578)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1573442751 +1575889010 +-1 +((-34571,-63781), (-21337,-49159)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575624135 +1575889010 +-1 +((-12557,-55373), (1063,-47349)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575624135 +1575889010 +-1 +((713,-72801), (14333,-64777)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-27388,1549), (-14927,10396)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((2370,-7000), (15603,-1452)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((1597,14221), (14830,23068)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((3144,2373), (15991,10395)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-27774,28543), (-14541,39864)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,13395), (-31162,23067)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,-9474), (-31162,-1452)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-11541,29367), (920,39864)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((441,-17196), (12514,-12473)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,1549), (-30388,10396)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-28162,13395), (-16089,23067)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-28162,-9474), (-16089,-1452)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-13859,-18022), (-2557,-12474)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,-18022), (-31547,-12474)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-28547,-18022), (-16859,-12474)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-13089,13395), (-1401,23067)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-43235,26067), (-30774,39863)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889010 +-1 +((-13089,-7824), (-628,-1452)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889030 +-1 +((-13023,996), (-176,10668)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + +1575889107 +-1 +((2682,31182), (14755,40029)) +12615680 +16570034 +12632256 +STRN 0 新宋体,8,N +DISPNAME 0 新宋体,8,N +OWNRDISPNAME 0 新宋体,8,N +Columns 0 新宋体,8,N +TablePkColumns 0 新宋体,8,U +TableFkColumns 0 新宋体,8,N +Keys 0 新宋体,8,N +Indexes 0 新宋体,8,N +Triggers 0 新宋体,8,N +LABL 0 新宋体,8,N +6 +65 +16777215 + + + + + + + + + + + + +E4E8B02A-08FE-4D41-AF69-E356B1ADF6B2 +face_camera +face_camera +1573436700 +Mhb +1576138611 +Mhb +摄像头表 + + + +1A74B7DC-03CD-46A8-9D38-526940D52CD8 +id_face_camera +id_face_camera +1573437457 +Mhb +1575861037 +Mhb +id +bigint(32) +32 +1 + + +384744B7-F06F-40CB-A217-BCD81E187B4D +camera_name +camera_name +1573437457 +Mhb +1576823629 +Mhb +摄像头名称 +varchar(255) +255 + + +D398DC39-3975-4E5C-AFCB-B4870E6867BD +camera_region_firstlevel +camera_region_firstlevel +1573437457 +Mhb +1576056977 +Mhb +摄像头层级区域-码值 +varchar(255) +255 + + +8265813D-F22C-4B2A-8668-EC46030D361D +camera_region_firstlevel_back_up +camera_region_firstlevel_back_up +1576138474 +Mhb +1576138611 +Mhb +摄像头层级区域冗余字段 +varchar(255) +255 + + +CBF48334-B876-4E7B-B5B7-4922E38A0BB0 +camera_region +camera_region +1576056922 +Mhb +1576056958 +Mhb +摄像头区域码值 +varchar(255) +255 + + +66813EBD-4D00-4948-96A8-AD6F18182008 +camera_region_back_up +camera_region_back_up +1576138474 +Mhb +1576138611 +Mhb +摄像头区域冗余字段 +varchar(255) +255 + + +6D7BAD6F-A7C7-46CE-AF9E-A1A2300C4FB9 +camera_address +camera_address +1573437457 +Mhb +1575623722 +Mhb +摄像头详细地址 +varchar(255) +255 + + +1C9BD8BB-D20F-4EDD-AF7D-AA524E4AA53D +version +version +1576057036 +Mhb +1576057072 +Mhb +摄像头型号 +varchar(255) +255 + + +91ABA7B4-8D6E-43F3-A440-7966180127DE +camerat_longitude +camerat_longitude +1573437457 +Mhb +1575623722 +Mhb +摄像头经度 +varchar(100) +100 + + +45726891-DFB9-4C33-802C-31C7E4C372C1 +camera_latitude +camera_latitude +1573437457 +Mhb +1575623722 +Mhb +摄像头纬度 +varchar(100) +100 + + +03444A9A-5758-4AA6-8C02-AA113BF10DD9 +camerat_locationtype_id +camerat_locationtype_id +1573437457 +Mhb +1576221873 +Mhb +位置类型-码值 +varchar(255) +255 + + +A6D640CB-2885-4D12-9FC5-236C63BB3CC1 +camerat_locationtype_id_back_up +camerat_locationtype_id_back_up +1576138474 +Mhb +1576138611 +Mhb +位置类型冗余字段 +varchar(255) +255 + + +4E38BE4F-977D-4D5B-8FEE-16E641F97C19 +public_security_code +public_security_code +1573437457 +Mhb +1573526258 +Mhb +公安机关代码 +varchar(100) +100 + + +C5934BE0-2B22-4488-9410-FCE8423A6E20 +public_security_name +public_security_name +1573437457 +Mhb +1573438883 +Mhb +公安机关名称 +varchar(255) +255 + + +7094AFAC-2FA0-4783-A862-99DDB5B624A0 +construction_unit +construction_unit +1573437457 +Mhb +1573438883 +Mhb +建设单位 +varchar(255) +255 + + +C7947C59-4EFB-4528-BBB6-214C88FB5309 +management_unit +management_unit +1573437457 +Mhb +1573438883 +Mhb +管理单位 +varchar(255) +255 + + +69B2FAEE-4476-455F-BF07-89C2BED473F9 +management_personnel +management_personnel +1573437457 +Mhb +1573438883 +Mhb +管理人员 +varchar(50) +50 + + +8819B1EE-0F95-45F4-8591-7685675B1D44 +contact_number +contact_number +1573437457 +Mhb +1573438883 +Mhb +联系电话 +varchar(11) +11 + + +F367BFD2-DCCE-4242-88B5-4B1910E407D4 +ip +ip +1575623219 +Mhb +1575623722 +Mhb +IP +varchar(255) +255 + + +83CF2C7D-0013-42AC-A67C-B5D2F2C3BB49 +user_name +user_name +1575623219 +Mhb +1575623722 +Mhb +用户名 +varchar(255) +255 + + +595009F9-3B8F-481C-BF37-70DB18595BB3 +passwd +passwd +1575623219 +Mhb +1575623722 +Mhb +密码 +varchar(32) +32 + + +39AC6D85-2A82-457B-973B-833C5A1F0EC9 +brand +brand +1575623219 +Mhb +1575623722 +Mhb +品牌 +varchar(50) +50 + + +4E4CD6FD-D3F2-4592-B5AC-C01FFE56CFAB +rtsp_url +rtsp_url +1575623219 +Mhb +1575623722 +Mhb +rtsp地址 +varchar(255) +255 + + +EB1C71EB-1038-4A3C-B14D-40A723A36408 +remarks +remarks +1573439050 +Mhb +1573439206 +Mhb +备注信息 +text + + +D3FB0AE4-6D5D-4412-848F-3AFE58312B7C +status +status +1573439050 +Mhb +1573439206 +Mhb +是否运行 Y启动 N未启动 +varchar(1) +1 + + +C38B226A-DFA0-439D-A188-04AC3905CFD5 +is_valid +is_valid +1573437457 +Mhb +1573438883 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +0082D9B3-EC08-4C51-83F2-B99379EBB7C9 +create_time +create_time +1573437457 +Mhb +1573438883 +Mhb +创建时间 +datetime + + +8F5CCA05-CAA0-48B9-A8C2-5765F3B9BB5D +update_time +update_time +1573437457 +Mhb +1573438883 +Mhb +更新时间 +datetime + + +6A8C4EC6-8859-4E65-830E-8B9B2F4E6FC8 +create_by +create_by +1573437457 +Mhb +1573438883 +Mhb +创建人 +varchar(32) +32 + + +7705E005-354A-44C3-9C45-A9811253A948 +update_by +update_by +1573437457 +Mhb +1573438883 +Mhb +更新人 +varchar(32) +32 + + + + +762D34E1-D0BB-43E1-A3AA-B29DC3FB0816 +Key_1 +Key_1 +1573437457 +Mhb +1573438883 +Mhb + + + + + + + + + + +2C890490-554A-40C9-9E52-B764B6D77A67 +face_library +face_library +1573436823 +Mhb +1575624380 +Mhb +库表 + + + +E50A7606-639A-41C9-A8C7-D813FD9CC77C +id_factory +id_factory +1573439238 +Mhb +1575861050 +Mhb +id +bigint(32) +32 +1 + + +3672C199-FB8A-4E09-946A-23EE9ECACDB2 +factory_name +factory_name +1573439238 +Mhb +1573439727 +Mhb +库名称 +varchar(255) +255 + + +E562845F-7E6A-46B1-92AC-747E1E4394B5 +factory_type +factory_type +1573439238 +Mhb +1573439727 +Mhb +库类型-码值 +varchar(2) +2 + + +0502AE24-8A23-46D8-A92D-83ECC1579FD3 +remarks +remarks +1573439739 +Mhb +1573439777 +Mhb +备注信息 +varchar(255) +255 + + +0FE75B86-45F9-478D-82A7-3FAC77CAF204 +is_valid +is_valid +1573439238 +Mhb +1573439727 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +DC672B5F-F72F-4110-AFC4-D2D973FBB219 +create_time +create_time +1573439238 +Mhb +1573443221 +Mhb +创建时间 +datetime + + +97EEED5B-7EC2-4739-A85A-537C38104297 +create_by +create_by +1573439238 +Mhb +1573439727 +Mhb +创建人 +varchar(32) +32 + + +73909D78-E9F6-47DF-B26D-19B65FF40D25 +update_time +update_time +1573439238 +Mhb +1573439727 +Mhb +更新时间 +datetime + + +162BC533-0B3F-4229-A8FB-445CADC70BD2 +update_by +update_by +1573439238 +Mhb +1573439727 +Mhb +更新人 +varchar(32) +32 + + + + +2F8CA6A0-DB4A-4939-B94D-3DA2D510FEA6 +Key_1 +Key_1 +1573439777 +Mhb +1573439781 +Mhb + + + + + + + + + + +046778F8-B0CE-4309-B625-34BC7C78EB20 +control_task +control_task +1573439850 +Mhb +1573442319 +Mhb +布控任务 + + + +0DED6519-44BC-492F-88FE-7549FE6274FA +id_control_task +id_control_task +1573439850 +Mhb +1575861062 +Mhb +id +bigint(32) +32 +1 + + +09DF71A8-0F01-4C8B-9BEB-282DBE292E4D +task_name +task_name +1573439923 +Mhb +1573441288 +Mhb +任务名称 +varchar(255) +255 + + +4267CDB1-57BF-4047-8FF4-4A253E88D42F +control_object +control_object +1573439923 +Mhb +1573441288 +Mhb +布控对象(id 人像库id 或者上传图片id) +varchar(32) +32 + + +AAD04542-7F80-4602-A5C4-91583100AD93 +disposal_type +disposal_type +1573439923 +Mhb +1575869626 +Mhb +处置类型-码值 +varchar(3) +3 + + +E5016236-E62E-4B22-8EA4-C171BAF146AC +control_type +control_type +1573439923 +Mhb +1573441288 +Mhb +布控类型-码值 +varchar(1) +1 + + +2D7F6B74-2424-4DA1-9370-CD058112378B +control_start_time +control_start_time +1573439923 +Mhb +1573441288 +Mhb +布控开始时间 +datetime + + +7939CB58-6F61-4D70-B891-AEDD57BDC26A +control_end_time +control_end_time +1573439923 +Mhb +1573441288 +Mhb +布控结束时间 +datetime + + +9E6E0F90-0714-4293-8EA8-435775748148 +control_region +control_region +1573439923 +Mhb +1573441288 +Mhb +布控区域 +varchar(255) +255 + + +B327871B-E72C-4096-9D98-5C24D4623304 +control_threshold +control_threshold +1573439923 +Mhb +1573441288 +Mhb +布控阈值 +double + + +534C211F-0A48-413B-B80D-FA3866D5B1A3 +control_status +control_status +1573442211 +Mhb +1573442319 +Mhb +布控状态-码值 +varchar(1) +1 + + +EB469329-2721-4847-A969-DD7DE9797B33 +receive +receive +1573439923 +Mhb +1573441288 +Mhb +接收人员(人员id逗号隔开) +text + + +C5AC5EB0-57B0-44B3-8B8A-9EB82FDC184B +remarks +remarks +1573439923 +Mhb +1573441288 +Mhb +备注信息 +text + + +4537FE59-BD10-484A-B134-D13FCC05FF7E +is_valid +is_valid +1573439923 +Mhb +1573441288 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +6573FCC6-D476-485A-836B-AF3F0422F496 +create_time +create_time +1573439923 +Mhb +1573441288 +Mhb +创建时间 +datetime + + +02537A17-3D66-43BB-ACB7-5ECA206DCEBF +update_time +update_time +1573439923 +Mhb +1573441288 +Mhb +更新时间 +datetime + + +13C83835-9669-4A2D-990E-5B52BF8292DA +create_by +create_by +1573439923 +Mhb +1573441288 +Mhb +创建人 +varchar(32) +32 + + +1355E161-2F24-40AA-BA97-F8D0F31487D7 +update_by +update_by +1573439923 +Mhb +1573441288 +Mhb +更新人 +varchar(32) +32 + + + + +AF085F36-0775-4494-9850-05B5E0CA9613 +Key_1 +Key_1 +1573441293 +Mhb +1573441306 +Mhb + + + + + + + + + + +AA9FB273-75E3-4361-B7B4-C0ABE3C749B1 +warning_information +warning_information +1573442367 +Mhb +1573520775 +Mhb +预警信息 + + + +7D229B27-8F0D-47C7-987D-E3A25E771027 +id_warning_information +id_warning_information +1573442367 +Mhb +1573451149 +Mhb +id +varchar(32) +32 +1 + + +A02A7C65-D407-48ED-85BB-480DD3C996C3 +receive_json +receive_json +1573442367 +Mhb +1573451149 +Mhb +接收参数 +text + + +BC7C9C5D-4899-4B5A-B1D9-DE65F4DDCFD2 +id_control_task +id_control_task +1573450400 +Mhb +1573451149 +Mhb +布控任务id +varchar(32) +32 + + +E72CEEE7-3FB8-442C-945D-D1F0CD137744 +id_portrait +id_portrait +1573450400 +Mhb +1573451149 +Mhb +人像id/图片id +varchar(32) +32 + + +634A26AF-66D0-4672-B9E7-C077A27162B8 +type +type +1573451188 +Mhb +1573451339 +Mhb +预警类型-码值 +varchar(2) +2 + + +52184851-1D99-4EF5-A7BB-82588F3C6C3D +id_face_bayonet +id_face_bayonet +1573451188 +Mhb +1573451339 +Mhb +卡口id +varchar(32) +32 + + +394727A5-BAD4-4426-AEA4-26591CD012C1 +score +score +1573451373 +Mhb +1573451549 +Mhb +比对分数 +double + + +8EC3BB7B-DC88-4DC0-BA90-7AF08ABF5268 +process_result_type +process_result_type +1573468005 +Mhb +1573520775 +Mhb +处理结果类型(1盘查 2抓捕) +varchar(1) +1 + + +61F63A0F-1EFD-4C52-A385-0A267F9477D4 +process_result +process_result +1573520652 +Mhb +1573520775 +Mhb +处理结果 +text + + +949990AF-72E6-4261-ABCB-A04CFD66D1E8 +is_valid +is_valid +1573450400 +Mhb +1573451149 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +B23168D4-E0F1-4FCE-ADDA-CD54A3DCCF70 +create_time +create_time +1573450400 +Mhb +1573451149 +Mhb +创建时间 +datetime + + +66E8BF37-727F-43CE-8900-4D261F0C3F7F +create_by +create_by +1573450400 +Mhb +1573451149 +Mhb +创建人 +varchar(32) +32 + + +74E4673F-D850-4EB1-955D-AF904D020BA5 +update_time +update_time +1573450400 +Mhb +1573451149 +Mhb +更新时间 +datetime + + +F5F2FB5C-01F8-4873-8270-5ED3BE93481B +update_by +update_by +1573450400 +Mhb +1573451149 +Mhb +更新人 +varchar(32) +32 + + + + +5A10E169-5FF8-42EC-95B4-42FE6B61CB1A +Key_1 +Key_1 +1573450400 +Mhb +1573451149 +Mhb + + + + + + + + + + +8382D296-44E4-4718-9E54-9500D18479C9 +portrait +portrait +1573442751 +Mhb +1575623995 +Mhb +人像表 + + + +6E5F59AA-78E7-4CD0-9436-D81385D49C8F +id_portrait +id_portrait +1573442751 +Mhb +1575861079 +Mhb +人像id +bigint(32) +32 +1 + + +D6A0563F-E2B6-4199-B5EC-87789059C286 +id_factory +id_factory +1573442751 +Mhb +1575861079 +Mhb +库id +bigint(32) +32 + + +246D0D42-0BCE-4EEB-B7DC-DDC75B9E63A8 +url +url +1573442751 +Mhb +1573443337 +Mhb +图片url +text + + +00BB5BFB-C463-416C-A47C-11EFFA6CB12B +background_url +background_url +1573442751 +Mhb +1573443337 +Mhb +背景图url +text + + +8B57855B-52F5-4FA1-A99C-B219A1D6F806 +name +name +1573442751 +Mhb +1573443337 +Mhb +姓名 +varchar(100) +100 + + +2CD02889-7317-4B2A-8D25-3F46FD21D29F +sex +sex +1573442751 +Mhb +1573443337 +Mhb +性别 +varchar(10) +10 + + +00BFA5BD-13B9-49C0-A743-CB839016ACA2 +birth_date +birth_date +1573442751 +Mhb +1573443337 +Mhb +出生日期 +datetime + + +80B1951F-A3A5-473E-95AA-313E0A520757 +id_card +id_card +1573442751 +Mhb +1573443337 +Mhb +身份证 +varchar(18) +18 + + +E04FA0CB-5D37-4756-89C6-30CE730BD24E +face_rect +face_rect +1575623921 +Mhb +1575623995 +Mhb +人脸坐标位置 +varchar(255) +255 + + +FD26970C-19B7-4CC3-BA7D-8EBAC463094F +faceIds +faceIds +1573466044 +Mhb +1573466138 +Mhb +人脸入库id +varchar(32) +32 + + +8C74B033-4170-4642-902C-C1DB5DFEA24B +featId +featId +1573466044 +Mhb +1573466138 +Mhb +人脸特征id +varchar(32) +32 + + +19D66449-97F7-4CFE-985B-77EE5ED73732 +is_valid +is_valid +1573442751 +Mhb +1573443337 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +C9245E6B-7A77-4D87-BEF5-59611569D824 +create_time +create_time +1573442751 +Mhb +1573443337 +Mhb +创建时间 +datetime + + +3E0B9B58-0075-492D-B898-48DF118D925F +create_by +create_by +1573442751 +Mhb +1573443337 +Mhb +创建人 +varchar(32) +32 + + +289075BD-55C6-4503-B805-6F9465A6A4CA +update_time +update_time +1573442751 +Mhb +1573443337 +Mhb +更新时间 +datetime + + +85D672D5-A474-4F91-AC38-85E43C5BF950 +update_by +update_by +1573442751 +Mhb +1573443337 +Mhb +更新人 +varchar(32) +32 + + + + +1B2E506C-1CE2-4D22-A491-70460B046196 +Key_1 +Key_1 +1573442751 +Mhb +1573443337 +Mhb + + + + + + + + + + +FA56C67F-89DF-4FDB-AD24-0C0F36CAAFD9 +control_library_mid +control_library_mid +1574155051 +Mhb +1575624573 +Mhb +布控和库中间表 + + + +1EC6F044-24DB-4F69-9E7B-F30E69CF08D3 +id +id +1574155051 +Mhb +1575861095 +Mhb +id +bigint(32) +32 +1 + + +910BBD12-1A6C-4AA3-9FC3-F277F3136D46 +id_control_task +id_control_task +1575624521 +Mhb +1575861095 +Mhb +布控id +bigint(32) +32 + + +BD86C361-D857-4CC1-8745-0B13C8AC9F94 +id_factory +id_factory +1575624526 +Mhb +1575861095 +Mhb +库id +bigint(32) +32 + + +B9640E36-69D5-4A37-8512-46DE02EDDBCB +is_valid +is_valid +1574155051 +Mhb +1575624135 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +94F3622A-81D2-4B70-8220-9C1D1672986D +create_time +create_time +1574155051 +Mhb +1575624135 +Mhb +创建时间 +datetime + + +DF4654D3-08FE-4235-9BF4-B02F5966DC09 +update_time +update_time +1574155051 +Mhb +1575624135 +Mhb +更新时间 +datetime + + +3B2469E3-1D56-421A-A89B-34F021D019FF +update_by +update_by +1574233842 +Mhb +1575624135 +Mhb +更新人 +varchar(32) +32 + + +4A4FF023-FB25-49A4-A7F8-AD2D94656D07 +create_by +create_by +1574233842 +Mhb +1575624135 +Mhb +创建人 +varchar(32) +32 + + + + +55ACAA83-F906-4C3A-A16A-4D013F1C2AE1 +Key_1 +Key_1 +1574218130 +Mhb +1575624135 +Mhb + + + + + + + + + + +9F049A00-E53A-4773-8A56-5E2168F92FE8 +sys_dept +sys_dept +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门管理' ROW_FORMAT = Dynamic + + + +99E4E099-4E6F-4B2C-B760-B6255751F6DE +id +id +1575627715 +Mhb +1575860857 +Mhb +id +bigint(32) +32 +1 + + +4BE52A70-17B3-4C49-A3FF-7C2190407AF2 +pid +pid +1575627715 +Mhb +1575860857 +Mhb +上级ID +NULL +bigint(32) +32 + + +48505E3B-44DF-4C1A-8CB0-EDDFD785F2B0 +pids +pids +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +E557AB7A-B66B-4B92-9017-61A076CA99D1 +name +name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +2E751D61-1EAF-4399-9E0B-A76AB0CFA95D +sort +sort +1575627715 +Mhb +1575627719 +Mhb +排序 +NULL +int(10) +10 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +F79AEE39-9FAA-42AE-9CD5-9770F8EB80B6 +creator +creator +1575627715 +Mhb +1575860857 +Mhb +创建者 +NULL +bigint(32) +32 + + +F3AECF63-6325-4851-AC87-7D810369A7E4 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +61EED6A4-E252-438B-8702-F6F0F35186F5 +updater +updater +1575627715 +Mhb +1575860857 +Mhb +更新者 +NULL +bigint(32) +32 + + +87D7DA60-8C6C-44CE-9A81-4EFAA9DDB090 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +096A16B9-7840-44A8-A450-F127ED1354C7 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +6D2EA011-6633-4D84-8E55-F854B11B33A8 +idx_pid +idx_pid +1575627715 +Mhb +1575627719 +Mhb +idx_pid + + + + + +D5AD0430-B8A3-4098-911C-C5853ADF4EAB +idx_sort +idx_sort +1575627715 +Mhb +1575627719 +Mhb +idx_sort + + + + + + + + + + +6C21474D-6E31-43C8-B630-FF1841F63FB2 +sys_dict_data +sys_dict_data +1575888977 +Mhb +1575888983 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典数据' ROW_FORMAT = Dynamic + + + +3F58B53B-D90D-4EAC-8885-98F92D97393E +id +id +1575888977 +Mhb +1575889099 +Mhb +id +bigint(32) +32 +1 + + +93F777B3-FB31-46E2-8C86-6514649A432A +dict_type_id +dict_type_id +1575888977 +Mhb +1575889099 +Mhb +字典类型ID +bigint(32) +32 +1 + + +3151FD0B-26AD-4B8C-BFDE-13150FD6E023 +dict_label +dict_label +1575888977 +Mhb +1575888983 +Mhb +varchar(255) +255 + + +E4A7FC9F-ED7F-4186-8CC7-F7496BD0DD77 +dict_value +dict_value +1575888977 +Mhb +1575888983 +Mhb +varchar(255) +255 + + +5DB469B0-7D4C-430A-A53C-DA82C022FFEC +remark +remark +1575888977 +Mhb +1575888983 +Mhb +varchar(255) +255 + + +2D38FDAB-0E2C-4D4C-AFB3-F84D2E934A6C +sort +sort +1575888977 +Mhb +1575888983 +Mhb +排序 +NULL +int(10) +10 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +DF1449A4-FC37-4DE1-BC58-F4646FC8BB5D +creator +creator +1575888977 +Mhb +1575889099 +Mhb +创建者 +NULL +bigint(32) +32 + + +8B787594-FB81-4C1B-B99D-08DCDB73483F +create_date +create_date +1575888977 +Mhb +1575888983 +Mhb +datetime + + +EF9F74EB-2F54-4000-8731-6FD54AF49EF8 +updater +updater +1575888977 +Mhb +1575889099 +Mhb +更新者 +NULL +bigint(32) +32 + + +930A19BC-C7DE-4CF0-9F7E-FB94A3D89FA8 +update_date +update_date +1575888977 +Mhb +1575888983 +Mhb +datetime + + + + +5D39F44E-C97C-4EDD-BE40-4A4D7CB68122 +Key_1 +Key_1 +1575888977 +Mhb +1575888983 +Mhb + + + + + +90898574-3825-42BD-99F4-01E40443531C +uk_dict_type_value +uk_dict_type_value +1575888977 +Mhb +1575888983 +Mhb +uk_dict_type_value +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + + +9CB71773-7DE1-468F-9994-C6506B2B92C0 +idx_sort +idx_sort +1575888977 +Mhb +1575888983 +Mhb +idx_sort + + + + + + + + + + +1B482A57-1B23-4C5B-B955-1F982B1CEE49 +sys_dict_type +sys_dict_type +1575889007 +Mhb +1575889009 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典类型' ROW_FORMAT = Dynamic + + + +03B9DD8A-7F6D-47AE-88CD-719B3AFCD594 +id +id +1575889007 +Mhb +1575889066 +Mhb +id +bigint(32) +32 +1 + + +2C10EEC8-6DCC-4FE6-9C23-6572618DBE9E +dict_type +dict_type +1575889007 +Mhb +1575889009 +Mhb +varchar(100) +100 + + +B66550FC-E390-4D36-B904-3859D3F5AAF3 +dict_name +dict_name +1575889007 +Mhb +1575889009 +Mhb +varchar(255) +255 + + +73083542-E05D-4318-9777-E598401547E7 +remark +remark +1575889007 +Mhb +1575889009 +Mhb +varchar(255) +255 + + +9ABD4C19-01FE-4127-928A-3BE7B235293F +sort +sort +1575889007 +Mhb +1575889009 +Mhb +排序 +NULL +int(10) +10 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +6DAB2997-81D1-4DC7-97F4-57466F24CBB5 +creator +creator +1575889007 +Mhb +1575889066 +Mhb +创建者 +NULL +bigint(32) +32 + + +D840C92A-3AF7-4CC3-B7CA-AE9F92D8A4E1 +create_date +create_date +1575889007 +Mhb +1575889009 +Mhb +datetime + + +D0B20B56-B091-446D-AA83-9684CDEF6813 +updater +updater +1575889007 +Mhb +1575889066 +Mhb +更新者 +NULL +bigint(32) +32 + + +E78BE102-69B2-402F-AB56-910A2441C163 +update_date +update_date +1575889007 +Mhb +1575889009 +Mhb +datetime + + + + +80F0AA09-704F-451E-8243-04BF2B5733C7 +Key_1 +Key_1 +1575889007 +Mhb +1575889009 +Mhb + + + + + +B58F7149-042A-4F02-9A69-2604E62EADC9 +dict_type +dict_type +1575889007 +Mhb +1575889009 +Mhb +dict_type +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + + + + + + +2F2FC176-0502-4464-9A63-2165384CE8F5 +sys_language +sys_language +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '国际化' ROW_FORMAT = Dynamic + + + +78DDD97F-01BC-4D07-8CE0-E295DC43D77B +table_name +table_name +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 +1 + + +D96A0DF7-ABA7-4FB6-AD40-59B28C71CC05 +table_id +table_id +1575627715 +Mhb +1575862019 +Mhb +表主键 +bigint(32) +32 +1 + + +D0B719E8-3DDB-42A8-B636-AB6EA90854B4 +field_name +field_name +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 +1 + + +6C611C25-9B68-4151-B3EA-14E5C6EF6BBD +field_value +field_value +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +9956297C-35B9-4975-912F-BBAB29C6F9F7 +language +language +1575627715 +Mhb +1575627719 +Mhb +varchar(10) +10 +1 + + + + +5E3CB867-43BC-49D0-B831-BF008A66B898 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + + + + +66CEE822-E213-45DC-9CC8-861DA9D6683A +idx_table_id +idx_table_id +1575627715 +Mhb +1575627719 +Mhb +idx_table_id + + + + + + + + + + +26AF1720-5B40-4B53-A9B3-190C99952181 +sys_log_error +sys_log_error +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '异常日志' ROW_FORMAT = Dynamic + + + +427B735A-94B7-4144-92C2-378A5F21AD49 +id +id +1575627715 +Mhb +1575860814 +Mhb +id +bigint(32) +32 +1 + + +2ABCD2A4-A863-4F1C-B4ED-B3C7EE7FBFA2 +request_uri +request_uri +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +10F4427C-4911-4ADC-9C5A-710B71FE3266 +request_method +request_method +1575627715 +Mhb +1575627719 +Mhb +varchar(20) +20 + + +AB3897EC-DC22-409A-A868-96C77CFF050D +request_params +request_params +1575627715 +Mhb +1575627719 +Mhb +text + + +76F89572-6BFB-4E3A-8522-12C1F53021EF +user_agent +user_agent +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +99D318E1-F035-4B93-90B1-BB54F2E2D882 +ip +ip +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 + + +1B032144-9B70-4081-8CE3-9C8731992202 +error_info +error_info +1575627715 +Mhb +1575627719 +Mhb +text + + +A55433CF-E4B0-41DC-B4B5-DACE31429871 +creator +creator +1575627715 +Mhb +1575860814 +Mhb +创建者 +NULL +bigint(32) +32 + + +5EF35C60-4A2E-41D4-AFCF-7DFBB2C1317E +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +D9768FFE-44A1-444B-B960-7016280070C8 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +D940DBD9-88FC-4583-B353-90A58DE455A4 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +2380061C-D4F6-42E6-ADED-E19B797BD5DA +sys_log_login +sys_log_login +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '登录日志' ROW_FORMAT = Dynamic + + + +EA11F126-1895-4FB7-BD1D-F44A5B6DEE84 +id +id +1575627715 +Mhb +1575860871 +Mhb +id +bigint(32) +32 +1 + + +C9E783D8-C255-40CA-B614-9BCE7D35723A +operation +operation +1575627715 +Mhb +1575627719 +Mhb +用户操作 0:用户登录 1:用户退出 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +C75D2E3C-21DC-481F-8402-1663098427DB +status +status +1575627715 +Mhb +1575627719 +Mhb +状态 0:失败 1:成功 2:账号已锁定 +tinyint(3) +3 +1 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +09ABAA4F-775A-4F0D-A149-C7AEE703E52E +user_agent +user_agent +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +084B3DB4-F6AF-446E-A110-C93489BBD3A2 +ip +ip +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 + + +1AE4EFD0-4C2B-49CE-B308-32DF99EB5F8B +creator_name +creator_name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +19AD544E-4425-4A9A-99CB-3530E09707E0 +creator +creator +1575627715 +Mhb +1575860871 +Mhb +创建者 +NULL +bigint(32) +32 + + +3D94AB21-5C3B-49E9-A686-CB195FC3D48B +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +70F8B6B9-567B-431D-BF46-AF2EEFF96D50 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +D5414B25-50A6-484B-A165-1E7C61D91724 +idx_status +idx_status +1575627715 +Mhb +1575627719 +Mhb +idx_status + + + + + +C9A69DDE-0FE3-4896-8CD1-456C003F7339 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +93F1EDF9-F27B-4EDC-B9B4-FB91DA648BE9 +sys_log_operation +sys_log_operation +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作日志' ROW_FORMAT = Dynamic + + + +57BE3274-2F38-424A-AE05-401BD923AF4E +id +id +1575627715 +Mhb +1575860286 +Mhb +id +bigint(32) +32 +1 + + +F9439ED2-128A-4A62-A4C6-1CD9E8A1F778 +operation +operation +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +4AE3E94D-E164-4817-84C6-53B2C887CCBA +request_uri +request_uri +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +C063592C-2467-4956-BA4C-A01FE1EF63AB +request_method +request_method +1575627715 +Mhb +1575627719 +Mhb +varchar(20) +20 + + +D46DDBBC-37D4-4054-B9E2-E8CFCCF63628 +request_params +request_params +1575627715 +Mhb +1575627719 +Mhb +text + + +0BB4AF57-D74F-4E52-A7B8-8B6FFE56FF22 +request_time +request_time +1575627715 +Mhb +1575627719 +Mhb +请求时长(毫秒) +int(10) +10 +1 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +762654F5-C9CA-4088-B406-3E779C72F13F +user_agent +user_agent +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +9599B8EF-AA8D-4912-9170-6C438594D234 +ip +ip +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 + + +1ABE28F8-9CE4-4931-8BC8-C0754FCE22A5 +status +status +1575627715 +Mhb +1575627719 +Mhb +状态 0:失败 1:成功 +tinyint(3) +3 +1 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +B33D74E0-A229-4BD2-8D7F-EF986D931F5A +creator_name +creator_name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +5EB6EAD6-8DE2-4403-BB8C-EBE24D46423A +creator +creator +1575627715 +Mhb +1575861976 +Mhb +创建者 +NULL +bigint(32) +32 + + +E6846B72-224B-4F7C-8066-094332A29A7E +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +DAE48F36-6C99-431C-B1A5-AAB1AAE20946 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +29FACFD7-CFC0-4770-AAC6-4FCFC8B70788 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +D611436E-27EF-46E2-B787-A289354824D7 +sys_mail_log +sys_mail_log +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '邮件发送记录' ROW_FORMAT = Dynamic + + + +ABE063DC-EE35-4992-8602-0729AA5A4EE4 +id +id +1575627715 +Mhb +1575860698 +Mhb +id +bigint(32) +32 +1 + + +95A5DDA5-6531-411D-9B28-41E282A1EEAA +template_id +template_id +1575627715 +Mhb +1575860698 +Mhb +邮件模板ID +bigint(32) +32 +1 + + +328CAE6E-C72C-488D-BB2B-B18460B7365E +mail_from +mail_from +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +67C576A8-49C6-486E-83B6-91800959B07B +mail_to +mail_to +1575627715 +Mhb +1575627719 +Mhb +varchar(400) +400 + + +60897F65-122D-47B7-B300-503E7750ECE7 +mail_cc +mail_cc +1575627715 +Mhb +1575627719 +Mhb +varchar(400) +400 + + +43D64500-A658-49C5-8CB8-8E964866B6D9 +subject +subject +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +464AC206-FFB7-4710-84CF-D5D38FAE4013 +content +content +1575627715 +Mhb +1575627719 +Mhb +text + + +EECFB0B6-0CEC-46E7-910B-906B8C115627 +status +status +1575627715 +Mhb +1575627719 +Mhb +发送状态 0:失败 1:成功 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +E0C60476-7866-486F-B1FB-35A7AE051AE1 +creator +creator +1575627715 +Mhb +1575860698 +Mhb +创建者 +NULL +bigint(32) +32 + + +AB589EBD-BFDE-4677-961B-AD4A2A3976C1 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +31286D33-2B76-4256-9731-9957E37CB6B1 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +EBA018CA-2321-4052-9706-2728E609E3B2 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +41C79146-5F02-4466-8EAE-6545338C0E42 +sys_mail_template +sys_mail_template +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '邮件模板' ROW_FORMAT = Dynamic + + + +4AC1F548-A110-4CF9-A19C-FF297749E235 +id +id +1575627715 +Mhb +1575860890 +Mhb +id +bigint(32) +32 +1 + + +55839EA1-7458-4D99-93FB-FAFF0D650906 +name +name +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +CEC616F2-411E-4012-9C5B-2179DA0FA6A6 +subject +subject +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +D3A5CCEC-D582-459C-9190-56878BA2DD8E +content +content +1575627715 +Mhb +1575627719 +Mhb +text + + +6E388731-7056-4E8A-A08E-F00D4B7F47AD +creator +creator +1575627715 +Mhb +1575860890 +Mhb +创建者 +NULL +bigint(32) +32 + + +0F59C1ED-BEEF-4611-85E1-D2B734C5583F +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +F2E738E9-9BBE-45D9-ACB7-E7A3AE56F5FD +updater +updater +1575627715 +Mhb +1575860890 +Mhb +更新者 +NULL +bigint(32) +32 + + +E4BFD487-5EC6-4F23-8885-9934F2A00EC9 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +8100DA95-F266-4AF5-B531-71AD03A90E5A +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +2255D6F0-6E19-4583-B0C3-BD34751BA401 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +3E050872-07DB-4891-8B01-C645FFF85D21 +sys_menu +sys_menu +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单管理' ROW_FORMAT = Dynamic + + + +AC622DFC-3480-4008-AA3B-ED26881CAA93 +id +id +1575627715 +Mhb +1575860304 +Mhb +id +bigint(32) +32 +1 + + +121D5699-F67F-44C2-B491-56E17DED4FC0 +pid +pid +1575627715 +Mhb +1575860304 +Mhb +上级ID,一级菜单为0 +NULL +bigint(32) +32 + + +E59D2DA4-07CC-41B9-B33D-FF16AD57CACE +url +url +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +A4C9A30E-D00C-4A80-96EA-2CF74AAF5B0D +permissions +permissions +1575627715 +Mhb +1575627719 +Mhb +varchar(500) +500 + + +32789A89-C7ED-4623-85BC-537ACDE4DF2B +type +type +1575627715 +Mhb +1575627719 +Mhb +类型 0:菜单 1:按钮 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +E6E567C8-B599-4841-A620-77026A9B4827 +icon +icon +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +68A5D78C-F9BD-404A-940F-BA09BE1CFE3F +sort +sort +1575627715 +Mhb +1575627719 +Mhb +排序 +NULL +int(11) +11 + + +226EFB13-B697-4DDF-887C-56F752A85710 +creator +creator +1575627715 +Mhb +1575861967 +Mhb +创建者 +NULL +bigint(32) +32 + + +329E62AF-DDC4-4E21-A3B3-6E969F96AB8F +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +6BBD80F0-3679-4D2A-A9ED-6A2D2F988207 +updater +updater +1575627715 +Mhb +1575861967 +Mhb +更新者 +NULL +bigint(32) +32 + + +0FAAA683-7E5B-44C3-8EF1-363648D2C9F0 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +72DE01D1-7B49-4B02-96BA-AC3D77A12A0F +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +58671D8B-FD69-476C-91FE-1B8F88832F5B +idx_pid +idx_pid +1575627715 +Mhb +1575627719 +Mhb +idx_pid + + + + + +A2834894-2D59-49BA-9A6F-CEE0FDEC17D9 +idx_sort +idx_sort +1575627715 +Mhb +1575627719 +Mhb +idx_sort + + + + + + + + + + +2D3D9596-404B-4E5F-BD8C-B9898F1DE56E +sys_oss +sys_oss +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文件上传' ROW_FORMAT = Dynamic + + + +55F388A8-4FFE-4B7D-B6A3-A0AFF8CE2118 +id +id +1575627715 +Mhb +1575860953 +Mhb +id +bigint(32) +32 +1 + + +3F7EF8E5-628C-497D-BC3D-048448E34C5D +url +url +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +621C8AAC-7EB0-4384-9A7D-6287812F4596 +creator +creator +1575627715 +Mhb +1575860953 +Mhb +创建者 +NULL +bigint(32) +32 + + +FBEE4055-4887-423A-9063-F8160125EAAF +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +27A68632-900D-4778-95C5-26407BDF357C +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +61BC7698-640F-4D46-88CE-F4B3923A9C3C +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +247AB0AE-CAAB-48E3-B2D3-B45E68C4ED75 +sys_params +sys_params +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '参数管理' ROW_FORMAT = Dynamic + + + +4B7C9891-5565-4E89-8418-0FE0F1CE220B +id +id +1575627715 +Mhb +1575860834 +Mhb +id +bigint(32) +32 +1 + + +15BA8EA1-CBC2-4EF2-AC5C-1939E8F09AC4 +param_code +param_code +1575627715 +Mhb +1575627719 +Mhb +varchar(32) +32 + + +945860B6-D134-485F-BBC7-8EA4C5888909 +param_value +param_value +1575627715 +Mhb +1575627719 +Mhb +varchar(2000) +2000 + + +43A17513-08B0-49F5-9958-33ACC001CCD9 +param_type +param_type +1575627715 +Mhb +1575627719 +Mhb +类型 0:系统参数 1:非系统参数 +1 +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +EADAF023-9C8F-4D8F-B023-21CB79E2DF5C +remark +remark +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +F476E89E-24F5-4E79-9199-CB942188B8EE +creator +creator +1575627715 +Mhb +1575860834 +Mhb +创建者 +NULL +bigint(32) +32 + + +CC0B4F24-1E2F-4E43-9F25-3EB2F12D3006 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +700805FD-B6CE-48C7-BD7D-E078FD1B07D9 +updater +updater +1575627715 +Mhb +1575860834 +Mhb +更新者 +NULL +bigint(32) +32 + + +3A416029-C771-4755-BA16-8C12B9F49104 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +036A6EAF-1D71-4181-825A-661F31502F2C +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +CFC7D93C-A23D-44EE-A0D9-D927FB3B81E9 +uk_param_code +uk_param_code +1575627715 +Mhb +1575627719 +Mhb +uk_param_code +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + +DA4BEFAB-FA06-4EC5-AB46-01EA8D270A71 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +C6F2E10E-0E90-40BA-8D4D-E8A536A47F96 +sys_region +sys_region +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '行政区域' ROW_FORMAT = Dynamic + + + +59C04A52-F0C9-4D2D-A15C-3BE998F23827 +id +id +1575627715 +Mhb +1575860771 +Mhb +id +bigint(32) +32 +1 + + +CB875F9A-9177-4C90-9DBE-A1A968A99112 +pid +pid +1575627715 +Mhb +1575860771 +Mhb +上级ID,一级为0 +NULL +bigint(32) +32 + + +0BD08184-57DC-4FFC-9804-AA6E0E98DAAC +name +name +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +CEC11AB1-EFAF-49C6-B078-634636169DC7 +tree_level +tree_level +1575627715 +Mhb +1575627719 +Mhb +层级 +NULL +tinyint(4) +4 + + +A85210C8-E455-4543-A02C-8BED32173C54 +leaf +leaf +1575627715 +Mhb +1575627719 +Mhb +是否叶子节点 0:否 1:是 +NULL +tinyint(4) +4 + + +C1659EAD-78EF-4A41-B341-70CB2788736A +sort +sort +1575627715 +Mhb +1575860771 +Mhb +排序 +NULL +bigint(32) +32 + + +BF8751E2-188C-43ED-AB7E-1D5C74ADD389 +creator +creator +1575627715 +Mhb +1575860771 +Mhb +创建者 +NULL +bigint(32) +32 + + +46641AC0-B8B5-4456-8E8F-CCFE754B4FCA +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +C6502EC0-3C01-4136-A21C-3117586F66F6 +updater +updater +1575627715 +Mhb +1575860771 +Mhb +更新者 +NULL +bigint(32) +32 + + +1C6A4C0E-8256-4589-85ED-FB3733D2CAA6 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +42CB078D-2C48-4779-B869-95C7F69625B8 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + + + + + + +40CDA285-E748-4E22-8242-BCA72ABFAA08 +sys_role +sys_role +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色管理' ROW_FORMAT = Dynamic + + + +217A7AFC-2DF7-4CD4-B670-DEB6EC6717AC +id +id +1575627715 +Mhb +1575860914 +Mhb +id +bigint(32) +32 +1 + + +49464548-E018-4B1D-8F56-E27574445729 +name +name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +FF95C973-C099-4353-8E51-A2C5416FDF5C +remark +remark +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +D1B90730-E941-4704-85A0-66299AF57221 +dept_id +dept_id +1575627715 +Mhb +1575860914 +Mhb +部门ID +NULL +bigint(32) +32 + + +D5D89783-B6F3-4A31-A668-C71B74B77792 +creator +creator +1575627715 +Mhb +1575860914 +Mhb +创建者 +NULL +bigint(32) +32 + + +CCA11AB6-8EDD-4CCF-9B5E-CDE87157A613 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +794E5CC5-2A01-40F6-8F62-78960848E8AB +updater +updater +1575627715 +Mhb +1575860914 +Mhb +更新者 +NULL +bigint(32) +32 + + +F56062C6-409C-4BE3-8B95-6E0187F17462 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +A2D679AB-19B6-41BC-B4F6-00EE9110FA05 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +9F1A53FB-7A5D-4C6B-A4C4-6847631E1868 +idx_dept_id +idx_dept_id +1575627715 +Mhb +1575627719 +Mhb +idx_dept_id + + + + + + + + + + +EE744184-1867-4539-A0CA-5B9647487C4C +sys_role_data_scope +sys_role_data_scope +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色数据权限' ROW_FORMAT = Dynamic + + + +F612EA36-9962-4961-8B1F-D6E7AFB1FE7D +id +id +1575627715 +Mhb +1575860976 +Mhb +id +bigint(32) +32 +1 + + +B0FE92E4-8688-44AE-8728-658DAE7B477D +role_id +role_id +1575627715 +Mhb +1575860976 +Mhb +角色ID +NULL +bigint(32) +32 + + +68D23DAA-CDB2-4212-BF57-4BA2FF021529 +dept_id +dept_id +1575627715 +Mhb +1575860976 +Mhb +部门ID +NULL +bigint(32) +32 + + +366667E3-52D2-4823-8230-11D143D6C883 +creator +creator +1575627715 +Mhb +1575860976 +Mhb +创建者 +NULL +bigint(32) +32 + + +8005ADE8-FA90-4633-AB9A-CFC21D91EAE8 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +BEA5FBF9-456B-4437-BDE3-3CFD7FB3954B +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +FD62465C-9456-4A6F-AAB2-C29B169C3344 +idx_role_id +idx_role_id +1575627715 +Mhb +1575627719 +Mhb +idx_role_id + + + + + + + + + + +3164016F-45D2-412C-A8D1-DB0AC2CB04D1 +sys_role_menu +sys_role_menu +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色菜单关系' ROW_FORMAT = Dynamic + + + +0D7BBAAD-CB81-4B93-A98A-B94C035C66ED +id +id +1575627715 +Mhb +1575861025 +Mhb +id +bigint(32) +32 +1 + + +81CB727A-67E0-4023-A0C2-41EB54321B42 +role_id +role_id +1575627715 +Mhb +1575861025 +Mhb +角色ID +NULL +bigint(32) +32 + + +A62A0E48-4B28-422E-BF48-8206EA8D53BA +menu_id +menu_id +1575627715 +Mhb +1575861025 +Mhb +菜单ID +NULL +bigint(32) +32 + + +DD8F097F-BAD8-46EF-A728-88CA938AA639 +creator +creator +1575627715 +Mhb +1575861025 +Mhb +创建者 +NULL +bigint(32) +32 + + +20920ECA-25EC-4AB6-819A-25BBD630EE33 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +C981CFC7-2EA0-485D-8042-CEC356DEFDC6 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +D617E5AB-0AE8-4CF7-AC2C-99CCA00411B7 +idx_role_id +idx_role_id +1575627715 +Mhb +1575627719 +Mhb +idx_role_id + + + + + +CAF344D3-D95F-4A84-9A74-80CFFE2EFF59 +idx_menu_id +idx_menu_id +1575627715 +Mhb +1575627719 +Mhb +idx_menu_id + + + + + + + + + + +24E81675-4E7F-4319-B703-D9A562AEFDE0 +sys_role_user +sys_role_user +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色用户关系' ROW_FORMAT = Dynamic + + + +CE22484B-6B1C-43AA-9F30-0F4222DFE1AD +id +id +1575627715 +Mhb +1575861003 +Mhb +id +bigint(32) +32 +1 + + +03690EDB-90EC-43DE-BD43-30106141C83A +role_id +role_id +1575627715 +Mhb +1575861003 +Mhb +角色ID +NULL +bigint(32) +32 + + +33DAD906-AFEF-479D-9489-2037BF10FD9D +user_id +user_id +1575627715 +Mhb +1575861003 +Mhb +用户ID +NULL +bigint(32) +32 + + +C4173478-19A5-4AB4-8312-416FAA249B94 +creator +creator +1575627715 +Mhb +1575861003 +Mhb +创建者 +NULL +bigint(32) +32 + + +BACEFE68-8CD4-4272-970C-BE8E0AB3F7D4 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +4F317FA2-C006-4810-BF2F-F7B2B567781E +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +BFF9419B-032A-43F6-8018-939EB5213CED +idx_role_id +idx_role_id +1575627715 +Mhb +1575627719 +Mhb +idx_role_id + + + + + +C335C619-CA22-4755-AC44-D641CDEDD48E +idx_user_id +idx_user_id +1575627715 +Mhb +1575627719 +Mhb +idx_user_id + + + + + + + + + + +1AC9C4B2-5D19-4B26-897A-7C1BFFF63F7E +sys_sms +sys_sms +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '短信' ROW_FORMAT = Dynamic + + + +8A21AD7C-3E3A-4D72-8C33-A1897740B2DE +id +id +1575627715 +Mhb +1575860802 +Mhb +id +bigint(32) +32 +1 + + +F40FDC7D-594A-43DE-AA2B-6A6BBBFFF0FC +platform +platform +1575627715 +Mhb +1575627719 +Mhb +平台类型 +tinyint(3) +3 +1 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +CA8E0C8F-1007-4319-A741-9C0FD7222604 +mobile +mobile +1575627715 +Mhb +1575627719 +Mhb +varchar(20) +20 + + +EBD36F17-DF4D-4931-94B2-AA918BB9A02E +params_1 +params_1 +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +9AC68093-4163-44FB-90AE-87FF682A83E0 +params_2 +params_2 +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +2BC8A341-B440-405E-8E4C-F763DE32EB55 +params_3 +params_3 +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +0E652889-5821-49C6-8CEF-6AD64478A51F +params_4 +params_4 +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +FAD4C6E1-B25D-4CDF-8B05-ED34BC5DFCFB +status +status +1575627715 +Mhb +1575627719 +Mhb +发送状态 0:失败 1:成功 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +6FED6DC6-7149-4FF6-9A48-5B13393ABE01 +creator +creator +1575627715 +Mhb +1575860802 +Mhb +创建者 +NULL +bigint(32) +32 + + +F5F72AEA-3888-4C18-8C64-45B6A47E6837 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +95D56D87-1198-41B3-B9BC-F9681E991376 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +C3DE5639-6BC6-4873-9FD0-78564AB27A8A +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +A58A7698-071B-44D7-AF80-D6D8921DC48A +sys_user +sys_user +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统用户' ROW_FORMAT = Dynamic + + + +AC7A4615-459F-4A48-9E68-B2577EF93BC3 +id +id +1575627715 +Mhb +1575860277 +Mhb +id +bigint(32) +32 +1 + + +17B53829-6D56-4598-AEA9-C06EF2834D97 +username +username +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +D41C3FBE-0992-421B-9CC8-BE1BC090AFF0 +password +password +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +DEF24AE2-AB2E-4CC4-82C0-F587CDB86208 +real_name +real_name +1575627715 +Mhb +1575627719 +Mhb +varchar(50) +50 + + +924123F1-3B59-4FAF-9741-9AD042E80606 +head_url +head_url +1575627715 +Mhb +1575627719 +Mhb +varchar(200) +200 + + +1043B155-5ACF-4001-A70A-E558AAB616A8 +gender +gender +1575627715 +Mhb +1575627719 +Mhb +性别 0:男 1:女 2:保密 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +A239B1A1-AE14-4A3B-86B2-9D2F7FF9CED4 +email +email +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +6888AE0F-E133-4488-A7B5-B6E03C50C19A +mobile +mobile +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +BC22BBFB-68A5-45BC-8261-B81E89C11205 +dept_id +dept_id +1575627715 +Mhb +1575861998 +Mhb +部门ID +NULL +bigint(32) +32 + + +F617DEF0-53F7-4C81-A0B1-4EEB84BDA889 +super_admin +super_admin +1575627715 +Mhb +1575627719 +Mhb +超级管理员 0:否 1:是 +NULL +tinyint(3) +3 +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,56={4A2BD2F3-4A8A-4421-8A48-A8029BDA28E8},Unsigned,4=true + + + + +7F7E5A58-921F-4D62-A615-B8EC20A1874B +status +status +1575627715 +Mhb +1575627719 +Mhb +状态 0:停用 1:正常 +NULL +tinyint(4) +4 + + +DC4FD58A-5646-4686-976C-CB87E91E6E6A +creator +creator +1575627715 +Mhb +1575861998 +Mhb +创建者 +NULL +bigint(32) +32 + + +22BB5FCF-209F-4F41-8879-ACB787BC7C1C +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +D2B92E58-1E65-4EC0-806C-44C1C0C4A049 +updater +updater +1575627715 +Mhb +1575861998 +Mhb +更新者 +NULL +bigint(32) +32 + + +04970014-4F19-485C-BCE5-669B1E00AD21 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +00D374D0-EF55-46C9-9576-B3D9C36F8845 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +A897E52A-0D35-424C-AAD8-5C3DBC88A2F9 +uk_username +uk_username +1575627715 +Mhb +1575627719 +Mhb +uk_username +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + +5002034A-4E71-4BBA-8AD4-822583E53791 +idx_create_date +idx_create_date +1575627715 +Mhb +1575627719 +Mhb +idx_create_date + + + + + + + + + + +A8C9390D-ACFD-4884-A2BB-81FC7E963F06 +sys_user_token +sys_user_token +1575627715 +Mhb +1575627719 +Mhb +ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统用户Token' ROW_FORMAT = Dynamic + + + +83E02F1F-1C82-48A6-82DA-CD4EFA9D14A4 +id +id +1575627715 +Mhb +1575860928 +Mhb +id +bigint(32) +32 +1 + + +E3AF756A-1C01-4B12-B129-7314509AEC9C +user_id +user_id +1575627715 +Mhb +1575860928 +Mhb +用户id +bigint(32) +32 +1 + + +92C51463-0DAD-4A4C-9884-671003A7C354 +token +token +1575627715 +Mhb +1575627719 +Mhb +varchar(100) +100 + + +A6EE45F6-AF53-4F3B-A4BC-2F316E1BC5DF +expire_date +expire_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +2B4C27F5-FE17-4EE6-86A4-31D4B5657C56 +update_date +update_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + +277CECC7-4653-4C4B-854C-9BAAC9A846A4 +create_date +create_date +1575627715 +Mhb +1575627719 +Mhb +datetime + + + + +341ADA0F-3333-469F-B49B-56DDB0BBF8F7 +Key_1 +Key_1 +1575627715 +Mhb +1575627719 +Mhb + + + + + +789407F0-85D0-4339-9B16-6BF7AEDB7132 +user_id +user_id +1575627715 +Mhb +1575627719 +Mhb +user_id +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + +4F9F2EFA-373A-45C9-99C4-91005B5A0669 +token +token +1575627715 +Mhb +1575627719 +Mhb +token +{F4F16ECD-F2F1-4006-AF6F-638D5C65F35E},MYSQL50,57={D1C795B8-8F7B-4AA7-A240-85C5B737C543},ExtUnique,4=true + + + + + + + + + + + + +34248566-81C1-440F-A2DC-310D27B597C2 +control_bayonet_mid +control_bayonet_mid +1574155394 +Mhb +1575624501 +Mhb +布控和摄像头中间表 + + + +BE8962A9-0BF5-4D70-B0B8-49386D8FA61D +id +id +1574155394 +Mhb +1575861116 +Mhb +id +bigint(32) +32 +1 + + +9A3EF00D-C9FE-4624-9DE9-24D52CCCA692 +id_control_task +id_control_task +1575624441 +Mhb +1575861116 +Mhb +id布控id +bigint(32) +32 + + +CBB59FA0-0E7A-485E-AA38-D2A266CA557F +id_face_camera +id_face_camera +1575624473 +Mhb +1575861116 +Mhb +摄像头id +bigint(32) +32 + + +BE8A507C-3BC6-4C32-9C51-8DA1BC1DCDB8 +is_valid +is_valid +1574155394 +Mhb +1575624135 +Mhb +是否有效 Y有效 N无效 +varchar(1) +1 + + +C034A691-DA39-4D27-857F-E1F4322623B1 +create_time +create_time +1574155394 +Mhb +1575624135 +Mhb +创建时间 +datetime + + +7DECBF16-045C-476F-B97F-5691E8724BA0 +update_time +update_time +1574155394 +Mhb +1575624135 +Mhb +更新时间 +datetime + + +602EA424-77B9-436E-B861-D9D13DA52FE9 +create_by +create_by +1574233787 +Mhb +1575624135 +Mhb +创建人 +varchar(32) +32 + + +86FF23B8-EDCB-439F-8DAC-8494EEB4308D +update_by +update_by +1574233787 +Mhb +1575624135 +Mhb +更新人 +varchar(32) +32 + + + + +D831BF3F-A19F-498D-80DE-E27A5E90CDDA +Key_1 +Key_1 +1574218123 +Mhb +1575624135 +Mhb + + + + + + + + + + + + +CA640E14-FD6F-4E42-855B-0A8CC8CED08F +Reference_1 +Reference_1 +1573443498 +Mhb +1573443498 +Mhb +0..* +1 +1 + + + + + + + + + + + +B97457BA-0E2B-4AB8-BD73-C1B917CDBB52 +1573443498 +Mhb +1573443498 +Mhb + + + + + + + + + + +EAC66D9E-DEDF-48C7-938A-FC51012212AE +Reference_2 +Reference_2 +1575624441 +Mhb +1575624441 +Mhb +0..* +1 +1 + + + + + + + + + + + +C4454DC3-3B36-4F7B-8C84-9206DA6A8034 +1575624441 +Mhb +1575624441 +Mhb + + + + + + + + + + +776ACDFD-7BEC-44C7-B8E0-2CDCF4AA96D6 +Reference_3 +Reference_3 +1575624473 +Mhb +1575624473 +Mhb +0..* +1 +1 + + + + + + + + + + + +FC20B0EB-6A62-44D9-A605-55B0FDC144A8 +1575624473 +Mhb +1575624473 +Mhb + + + + + + + + + + +969DEED2-95A2-4879-953C-903E5078A5A5 +Reference_4 +Reference_4 +1575624521 +Mhb +1575624521 +Mhb +0..* +1 +1 + + + + + + + + + + + +296E410E-E215-4872-B62D-359A9E7406E5 +1575624521 +Mhb +1575624521 +Mhb + + + + + + + + + + +FD5A8738-CF6F-4899-820D-A34ED667AEB6 +Reference_5 +Reference_5 +1575624526 +Mhb +1575624526 +Mhb +0..* +1 +1 + + + + + + + + + + + +7D51A18B-4561-48AA-86E7-9C48C377C5A0 +1575624526 +Mhb +1575624526 +Mhb + + + + + + + + + + + + +232A460E-291D-4EE1-AAE3-1613C9E99263 +PUBLIC +PUBLIC +1573436672 +Mhb +1573436672 +Mhb + + + + +09B937B0-C216-4794-9D7E-4ECE097A3E2E +MySQL 5.0 +MYSQL50 +1573436673 +Mhb +1573436673 +Mhb +file:///%_DBMS%/mysql50.xdb +F4F16ECD-F2F1-4006-AF6F-638D5C65F35E +4BA9F647-DAB1-11D1-9944-006097355D9B +1276524678 + + + + + + + + + + \ No newline at end of file diff --git a/doc/数据库变更字段-2020-01-07.sql b/doc/数据库变更字段-2020-01-07.sql new file mode 100644 index 0000000..07bf44f --- /dev/null +++ b/doc/数据库变更字段-2020-01-07.sql @@ -0,0 +1,7 @@ +alter table face_camera add id_version VARCHAR(32) COMMENT "摄像头类型ID"; + + ALTER TABLE face_camera CHANGE id_version id_brand VARCHAR(32) COMMENT "摄像头品牌ID"; + + ALTER TABLE face_camera CHANGE camerat_longitude camera_longitude VARCHAR(100) COMMENT "摄像头经度"; + + ALTER table face_camera add port VARCHAR(32) COMMENT "端口号"; diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0acdeb1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,57 @@ +version: '3' +services: + + minio: + image: minio/minio + container_name: minio + environment: + MINIO_ACCESS_KEY: sunseaiot + MINIO_SECRET_KEY: sunseaiot + restart: always + hostname: minio + ports: + - "9000:9000" + volumes: + - "./minio/data:/data" + command: server /data + minio_mc: + image: minio/mc + container_name: minio_mc + entrypoint: /bin/sh + command: mc config + + redis: + image: redis + container_name: redis + hostname: redis + restart: always +# command: redis-server --requirepass ldjy@2019 + ports: + - "40008:6379" + volumes: + - "./redis/data:/data" + mysql: + image: mysql:5.7 + container_name: mysql + hostname: mysql + restart: always + ports: + - "33060:3306" + volumes: + - "./mysql/conf:/etc/mysql/conf.d" + - "./mysql/data:/var/lib/mysql" + - "./mysql/logs:/logs" + environment: + MYSQL_ROOT_PASSWORD: "123456" + MYSQL_USER: 'root' + MYSQL_PASS: '123456' + + dkha-eureka: + build: ./face-server + volumes: + - "./face-server/face.log:/face.log" + container_name: face-server + restart: always + hostname: face-server + ports: + - "8899:8899" diff --git a/docker-compose1.yml b/docker-compose1.yml new file mode 100644 index 0000000..f33c0e2 --- /dev/null +++ b/docker-compose1.yml @@ -0,0 +1,77 @@ +version: '3' +services: + + face_minio: + image: face_minio + container_name: face_minio + restart: always + hostname: face_minio + ports: + - "9000:9000" + command: server /data + volumes: + - "./minio:/data" + environment: + MINIO_ACCESS_KEY: sunseaiot + MINIO_SECRET_KEY: sunseaiot + + face_redis: + image: face_redis + container_name: face_redis + hostname: face_redis + restart: always + command: redis-server --appendonly yes + ports: + - "6379:6379" + face_mysql: + image: face_mysql + container_name: face_mysql + hostname: face_mysql + restart: always + command: mysqld + ports: + - "3306:3306" + volumes: + - "./mysql/config:/etc/mysql/conf.d" + - "./mysql/data:/var/lib/mysql" + - "./mysql/logs:/logs" + - "/etc/localtime:/etc/localtime" + environment: + MYSQL_ROOT_PASSWORD: "123456" + MYSQL_USER: 'root' + MYSQL_PASS: '123456' + + face_rabbitmq: + image: face_rabbitmq + container_name: face_rabbitmq + hostname: face_rabbitmq + restart: always + command: rabbitmq-server + ports: + - "15672:15672" + - "25672:25672" + - "4369:4369" + - "5671:5671" + - "5672:5672" + + face_es: + image: face_es + container_name: face_es + hostname: face_es + restart: always + command: eswrapper + ports: + - "9200:9200" + - "9300:9300" + + face_nginx: + image: face_nginx + container_name: face_nginx + hostname: face_nginx + restart: always + ports: + - "80:80" + volumes: + - "./nginx/conf.d:/etc/nginx/conf.d" + - "./nginx/face:/usr/share/nginx/html" + - "./nginx/log:/var/log/nginx" diff --git a/face-common/pom.xml b/face-common/pom.xml new file mode 100644 index 0000000..4365904 --- /dev/null +++ b/face-common/pom.xml @@ -0,0 +1,126 @@ + + + + face-application + com.dkha + 1.0-SNAPSHOT + + 4.0.0 + + face-common + + + + org.springframework.boot + spring-boot-starter-web + + + org.apache.mina + mina-core + 2.1.3 + + + cn.afterturn + easypoi-base + + + cn.afterturn + easypoi-web + + + cn.afterturn + easypoi-annotation + + + redis.clients + jedis + + + org.springframework.boot + spring-boot-starter-data-redis + + + com.alibaba + fastjson + + + + io.minio + minio + + + com.github.axet + kaptcha + + + com.baomidou + mybatis-plus-generator + + + com.ecwid.consul + consul-api + + + com.auth0 + java-jwt + + + org.jsoup + jsoup + + + commons-io + commons-io + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + mysql + mysql-connector-java + + + org.freemarker + freemarker + + + org.projectlombok + lombok + + + + + org.apache.poi + poi + ${poi.version} + + + org.apache.poi + poi-ooxml + ${poi.version} + + + org.apache.poi + poi-ooxml-schemas + ${poi.version} + + + + + + org.springframework.boot + spring-boot-maven-plugin + + exec + + + + + diff --git a/face-common/src/main/java/com/dkha/common/CommonApplication.java b/face-common/src/main/java/com/dkha/common/CommonApplication.java new file mode 100644 index 0000000..e14bfb6 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/CommonApplication.java @@ -0,0 +1,19 @@ +package com.dkha.common; + + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author Spring + */ +@SpringBootApplication(exclude = { + org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class}) + +public class CommonApplication { + + public static void main(String[] args) { + SpringApplication.run(CommonApplication.class, args); + } + +} diff --git a/face-common/src/main/java/com/dkha/common/consul/BaseLock.java b/face-common/src/main/java/com/dkha/common/consul/BaseLock.java new file mode 100644 index 0000000..99fd640 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/consul/BaseLock.java @@ -0,0 +1,71 @@ +package com.dkha.common.consul; + +import com.ecwid.consul.v1.ConsulClient; +import com.ecwid.consul.v1.session.model.NewSession; +import com.ecwid.consul.v1.session.model.Session; + +import java.util.ArrayList; +import java.util.List; + +public class BaseLock { + + protected ConsulClient consulClient; + private String sessionName; + protected String sessionId = null; + protected String keyPath; // 互斥锁、信号量存储在consul中的基础key路径 + + protected CheckTtl checkTtl; // Check Ttl + /** + * @param consulClient + * @param lockKey 同步锁在consul的KV存储中的Key路径,会自动增加prefix前缀,方便归类查询 + * @param + */ + + protected BaseLock(ConsulClient consulClient, String sessionName, String lockKey) { + this.consulClient = consulClient; + this.keyPath = lockKey; + this.sessionName=sessionName; + } + /** + * @param consulClient + * @param lockKey 同步锁在consul的KV存储中的Key路径,会自动增加prefix前缀,方便归类查询 + * @param checkTtl 对锁Session的TTL + */ + protected BaseLock(ConsulClient consulClient, String lockKey, CheckTtl checkTtl) { + this.consulClient = consulClient; + this.keyPath = lockKey; + this.checkTtl = checkTtl; + } + /** + * 创建session + * @param sessionName + * @return + */ + + protected String createSession(String sessionName) { + NewSession newSession = new NewSession(); + newSession.setName(sessionName); + if(checkTtl != null) { + checkTtl.start(); + // 如果有CheckTtl,就为该Session设置Check相关信息 + List checks = new ArrayList<>(); + checks.add(checkTtl.getCheckId()); + newSession.setChecks(checks); + newSession.setBehavior(Session.Behavior.DELETE); + } + + return consulClient.sessionCreate(newSession, null).getValue(); + } + + +/** + * 根据成员变量sessionId来销毁session + */ + + protected void destroySession() { + if (sessionId != null) { + consulClient.sessionDestroy(sessionId, null); + sessionId = null; + } + } +} diff --git a/face-common/src/main/java/com/dkha/common/consul/CheckTtl.java b/face-common/src/main/java/com/dkha/common/consul/CheckTtl.java new file mode 100644 index 0000000..a19ca62 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/consul/CheckTtl.java @@ -0,0 +1,89 @@ +package com.dkha.common.consul; + +import com.ecwid.consul.v1.ConsulClient; +import com.ecwid.consul.v1.OperationException; +import com.ecwid.consul.v1.agent.model.NewCheck; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +import java.util.Timer; +import java.util.TimerTask; + +@Slf4j +/** + * + */ +public class CheckTtl { + + private ConsulClient consulClient; + + @Getter + private String checkId; + private NewCheck check; + private Timer timer; + + private int ttlDelay = 5000; + private int ttlPeriod = 10000; + + public CheckTtl(String checkId, ConsulClient consulClient) { + this.checkId = checkId; + this.consulClient = consulClient; + } + + public void agentCheckRegister() { + this.check = new NewCheck(); + check.setId(checkId); + check.setName(checkId); + check.setTtl("30s"); + check.setInterval("10s"); + check.setTimeout("10s"); + this.consulClient.agentCheckRegister(check); + } + + public void agentCheckDegister() { + if (this.checkId != null) { + this.consulClient.agentCheckDeregister(checkId); + } + } + + + public boolean isRunning() { + if (this.timer == null) { + return false; + } + return true; + } + + public void start() { + if (!isRunning()) { + agentCheckRegister(); + consulClient.agentCheckPass(checkId); + this.timer = new Timer(); + timer.scheduleAtFixedRate(new TtlTask(), ttlDelay, ttlPeriod); + } + } + + public void stop() { + if (this.timer != null) { + agentCheckDegister(); + timer.cancel(); + } + } + + class TtlTask extends TimerTask { + + @Override + public void run() { + try { + log.debug("{} run ttl...", checkId); + consulClient.agentCheckPass(checkId); + } catch (OperationException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + } + +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/consul/Lock.java b/face-common/src/main/java/com/dkha/common/consul/Lock.java new file mode 100644 index 0000000..6f8d46b --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/consul/Lock.java @@ -0,0 +1,84 @@ +package com.dkha.common.consul; + +import com.ecwid.consul.v1.ConsulClient; +import com.ecwid.consul.v1.kv.model.PutParams; + +import java.time.LocalDateTime; + +public class Lock extends BaseLock { + + private static final String prefix = "lock/"; // 同步锁参数前缀 + + /** + * @param consulClient + * @param lockKey 同步锁在consul的KV存储中的Key路径,会自动增加prefix前缀,方便归类查询 + */ + + public Lock(ConsulClient consulClient, String sessionName, String lockKey) { + super(consulClient, sessionName, prefix + lockKey); + } + + public Lock(ConsulClient consulClient, String sessionName, CheckTtl checkTtl) { + super(consulClient, sessionName, checkTtl); + } + + /** + * 获取同步锁 + * + * @param block 是否阻塞,直到获取到锁为止,默认尝试间隔时间为500ms。 + * @return + */ + + public Boolean lock(boolean block) throws InterruptedException { + return lock(block, 500L, null); + } + + + /** + * 获取同步锁 + * + * @param block 是否阻塞,直到获取到锁为止 + * @param timeInterval block=true时有效,再次尝试的间隔时间 + * @param maxTimes block=true时有效,最大尝试次数 + * @return + */ + + public Boolean lock(boolean block, Long timeInterval, Integer maxTimes) throws InterruptedException { + if (sessionId != null) { + throw new RuntimeException(sessionId + " - Already locked!"); + } + sessionId = createSession("lock-" + this.keyPath); + int count = 1; + while (true) { + PutParams putParams = new PutParams(); + putParams.setAcquireSession(sessionId); + if (consulClient.setKVValue(keyPath, "lock:" + LocalDateTime.now(), putParams).getValue()) { + return true; + } else if (block) { + if (maxTimes != null && count >= maxTimes) { + return false; + } else { + count++; + if (timeInterval != null) + Thread.sleep(timeInterval); + continue; + } + } else { + return false; + } + } + } + + /** + * 释放同步锁 + * + * @return + */ + public Boolean unlock() { + PutParams putParams = new PutParams(); + putParams.setReleaseSession(sessionId); + boolean result = consulClient.setKVValue(keyPath, "unlock:" + LocalDateTime.now(), putParams).getValue(); + destroySession(); + return result; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/ApiUrlEnum.java b/face-common/src/main/java/com/dkha/common/enums/ApiUrlEnum.java new file mode 100644 index 0000000..6d2c68a --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/ApiUrlEnum.java @@ -0,0 +1,42 @@ +package com.dkha.common.enums; + +import lombok.Getter; +import org.springframework.beans.factory.annotation.Value; + +/** + * @version V1.0 + * @Description: TODO(请求api地址枚举维护类) + * All rights 成都电科慧安 + * @Title: ApiUrl + * @Package com.dkha.common.enums + * @author: panhui + * @date: 2019/12/10 10:37 + * @Copyright: 成都电科慧安 + */ +@Getter +public enum ApiUrlEnum { +// @Value("${api.server.prefix}") 请求前缀维护在face-common的faceApiUrl.properties 中 +// String link; + + ALARM_POSTURL("alarm", "查看单个报警任务(业务场景卡口)post"), + ALARMS_POSTURL("alarms", "查看批量报警post"), + ALARMS_STATUS("taskStatus", "视频任务状态查询"), + FACELIBS_POSTURL("faceLibs", "查看人脸"), + FACELIB_POSTURL("faceLib", "添加人脸"), + FACELIST_POSTURL("face", "添加人像"), + FACE_POSTURL("face", "添加人像"), + TASK_POSTURL("control", "任务操作"), + TASK_VEDIO_POSTURL("controlVedio", "视频比对任务操作"), + FACE_SEARCH_LIB("faceSearchLib", "人脸库检索"), + FACE_SEARCH("faceSearch", "人脸检测"), + FACE_GROUP("faceGroup", "分组检索"), + FACE_COMPARISON("faceComparison", "一比一比对"), + CAMERA("camera", "摄像头操作"); + private String url; + private String message; + + ApiUrlEnum(String url, String message) { + this.url = url; + this.message = message; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/BoardAndLodgingEnums.java b/face-common/src/main/java/com/dkha/common/enums/BoardAndLodgingEnums.java new file mode 100644 index 0000000..eb823ed --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/BoardAndLodgingEnums.java @@ -0,0 +1,19 @@ +package com.dkha.common.enums; + +/** + * 住宿码表 + */ +public enum BoardAndLodgingEnums { + + BOARD("0", "包吃"), + LODGING("1", "包住"), + BOARDANDLODGING("2", "包吃包住"); + + public String name; + public String code; + + BoardAndLodgingEnums(String name, String code) { + this.name = name; + this.code = code; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/CompanyCheckEnums.java b/face-common/src/main/java/com/dkha/common/enums/CompanyCheckEnums.java new file mode 100644 index 0000000..5ab0a22 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/CompanyCheckEnums.java @@ -0,0 +1,22 @@ +package com.dkha.common.enums; + +/** + * @Description: + * @Author: yanping + * @Date: 2019/9/30 18:44 + */ +public enum CompanyCheckEnums { + + PASS("1", "已通过"), + FAIL("2", "未通过"), + PENDING("0", "待审核"); + + + public String code; + public String name; + + CompanyCheckEnums(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/CompanyMessageEnums.java b/face-common/src/main/java/com/dkha/common/enums/CompanyMessageEnums.java new file mode 100644 index 0000000..d8e3aef --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/CompanyMessageEnums.java @@ -0,0 +1,19 @@ +package com.dkha.common.enums; + +/** + * @Description: + * @Author: yangjun + * @Date: 2019/9/23 17:44 + */ +public enum CompanyMessageEnums { + SIGNED("2", "劳动人员同意岗位"), + UNSIGNED("1", "劳动人员发起岗位申请"), + RELIEVE("3", "劳动人员拒绝岗位"); + public String code; + public String name; + + CompanyMessageEnums(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/ContractFileStausEnums.java b/face-common/src/main/java/com/dkha/common/enums/ContractFileStausEnums.java new file mode 100644 index 0000000..f2fee46 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/ContractFileStausEnums.java @@ -0,0 +1,18 @@ +package com.dkha.common.enums; + +/** + * 合同附件上传状态 + */ +public enum ContractFileStausEnums { + + UPLOAD("1", "已上传"), + UNUPLOAD("2", "待上传"); + + public String code; + public String name; + + ContractFileStausEnums(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/ContractStatusEnums.java b/face-common/src/main/java/com/dkha/common/enums/ContractStatusEnums.java new file mode 100644 index 0000000..bebbfd2 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/ContractStatusEnums.java @@ -0,0 +1,19 @@ +package com.dkha.common.enums; + +/** + * 合同状态枚举 + */ +public enum ContractStatusEnums { + + SIGNED("2", "已签订"), + UNSIGNED("1", "待签订"), + RELIEVE("3", "已解除"); + + public String code; + public String name; + + ContractStatusEnums(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/ContractType.java b/face-common/src/main/java/com/dkha/common/enums/ContractType.java new file mode 100644 index 0000000..470d6ab --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/ContractType.java @@ -0,0 +1,18 @@ +package com.dkha.common.enums; + +/** + * 合同类型 + */ +public enum ContractType { + + ORG("1", "有组织就业"), + SCATTERED("2", "自主零散就业"); + + public String code; + public String name; + + ContractType(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/ContralEnums.java b/face-common/src/main/java/com/dkha/common/enums/ContralEnums.java new file mode 100644 index 0000000..9acf354 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/ContralEnums.java @@ -0,0 +1,44 @@ +package com.dkha.common.enums; + +import lombok.Getter; + +/** + * @version V1.0 + * @Description: TODO(布控任务类型) + * All rights 成都电科慧安 + * @Title: ContralEnums + * @Package com.dkha.common.enums + * @author: panhui + * @date: 2019/12/11 17:27 + * @Copyright: 成都电科慧安 + */ +@Getter +public enum ContralEnums { + + + ARREST(0,"抓捕类"), + MONITOR(1,"监控类"), + PROMPT(2,"提示类"); + + + private Integer code; + private String message; + + ContralEnums(Integer code, String message) { + this.code = code; + this.message = message; + } + + public static ContralEnums getTypeByValue(Integer code) + { + if (null==code){ + return ARREST; + } + for (ContralEnums enums : ContralEnums.values()) { + if (enums.getCode().intValue() == code.intValue()) { + return enums; + } + } + return ARREST; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/DictTypeEnums.java b/face-common/src/main/java/com/dkha/common/enums/DictTypeEnums.java new file mode 100644 index 0000000..e4da2bf --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/DictTypeEnums.java @@ -0,0 +1,42 @@ +package com.dkha.common.enums; + +/** + * @ClassName: DictTypeEnums + * @Description: (字典类型枚举) + * @author: 严平 + * @date: 2019-09-18 + * @Copyright: 成都电科惠安 + */ +public enum DictTypeEnums { + + + UNIT_TYPE("unittype", "单位类型"), + GENDER("gender", "性别"), + REGION("region", "摄像头区域"), + EDUCATION("education","教育程度"), + NATION("nation","民族"), + ACCOMMODATION("accommodation","食宿安排"), + SALARY("salary","收入区间"), + MARITALSTATUS("maritalstatus","婚姻状况"), + POLITICAL("political","政治面貌"), + ACCOUNT("account","户口性质"), + POST_SKILL("postSkill","职业技能"), + INDUSTRY("industry","所属行业"), + STAFF_SCALE("staffScale","公司人员规模"), + WORKING_SYSTEM("workingSystem","工作制度"), + EMPLOYEE_CHANNEL("employeeChannel","就业渠道"), + ACADEMIC("academic","学历要求"), + EMPLOYMENT_METHOD("employmentMethod","用工方式"), + TRAINING_TYPE("trainingType","培训类型"), + ORGANIZED_EMPLOYMENT("organizedEmployment","有组织就业"), + SELF_EMPLOYMENT("selfEmployment","自主零散就业"), + AREA("area","全国地区"), + LABOR_STATUS("laborStatus","劳动力状况"); + public String code; + public String name; + + DictTypeEnums(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/EmployeeChannel.java b/face-common/src/main/java/com/dkha/common/enums/EmployeeChannel.java new file mode 100644 index 0000000..08a75e4 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/EmployeeChannel.java @@ -0,0 +1,39 @@ +package com.dkha.common.enums; + +/** + * 就业渠道 + */ +public enum EmployeeChannel { + + NEARBY("1", "就近就地就业"), + ACROSS("2", "疆内跨地州就业"), + INLAND("3", "内地省市就业"), + CORPS("4", "兵团就业"), + TRANSFER("5", "有组织转移就业"), + + SMALLBUSINESS("6", "“十小”服务业"), + + PARK("7", "园区企业就业"), + SPIN("8", "纺织服装产业就业"), + ELECTRONIC("9", "电子装配、假发、玩具等部分劳动密集型就业"), + VILLAGE_WORKSHOP("10", "乡村生产车间就业就业"), + TOURISM_SERVICE("11", "旅游服务就业"), + FIXED_INVESTMENT("12", "固定资产投资项目建设领域就业"); + + public String code; + public String name; + + EmployeeChannel(String code, String name) { + this.code = code; + this.name = name; + } + + public static EmployeeChannel getByCode(String code) { + for(EmployeeChannel employeeChannel : EmployeeChannel.values()){ + if(code.equals(employeeChannel.code)){ + return employeeChannel; + } + } + return null; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/ErrEnum.java b/face-common/src/main/java/com/dkha/common/enums/ErrEnum.java new file mode 100644 index 0000000..5675e97 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/ErrEnum.java @@ -0,0 +1,35 @@ +package com.dkha.common.enums; + +import lombok.Getter; + +/** + * @version V1.0 + * @Description: TODO(api中返回的错误代码) + * All rights 成都电科慧安 + * @Title: errEnum + * @Package com.dkha.api.modules.errnums + * @author: panhui + * @date: 2019/12/2 11:42 + * @Copyright: 成都电科慧安 + */ +@Getter +public enum ErrEnum { + OK(200,"成功"),CREATED(201,"创建成功"), + + ACCEPTED(202,"更新成功"),BAD_REQUEST(400,"请求的地址不存在或者包含不支持的参数"), + + UNAUTHORIZED(401,"未授权"),FORBIDDEN(403,"被禁止访问"), + + NOT_FOUND(404,"请求资源不存在"),ERROR(500,"内部错误"); + + + private Integer code; + private String msg; + + ErrEnum(Integer code, String msg) { + this.code = code; + this.msg = msg; + } + + +} diff --git a/face-common/src/main/java/com/dkha/common/enums/ExpiryTimeTypeEnums.java b/face-common/src/main/java/com/dkha/common/enums/ExpiryTimeTypeEnums.java new file mode 100644 index 0000000..c7a1e7e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/ExpiryTimeTypeEnums.java @@ -0,0 +1,22 @@ +package com.dkha.common.enums; + +/** + * 岗位招聘失效时间枚举 + */ +public enum ExpiryTimeTypeEnums { + + + ONE_WEEK("1", "一周"), + TWO_WEEK("2", "半个月"), + ONE_MONTH("3", "一个月"), + THREE_MONTH("4", "三个月"), + SIX_MONTH("5", "半年"); + + public String code; + public String name; + + ExpiryTimeTypeEnums(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/IndustryTypeEnum.java b/face-common/src/main/java/com/dkha/common/enums/IndustryTypeEnum.java new file mode 100644 index 0000000..e6da482 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/IndustryTypeEnum.java @@ -0,0 +1,30 @@ +package com.dkha.common.enums; + +/** + * @author Spring + * @date 2019/11/22 + * @Description: 产业类型枚举 + */ +public enum IndustryTypeEnum { + + FIRST_INDUSTRY("1", "一产"), + SECOND_INDUSTRY("2", "二产"), + THIRD_INDUSTRY("3", "三产"); + + public String code; + public String name; + + IndustryTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static IndustryTypeEnum getByCode(String code) { + for(IndustryTypeEnum industryType : IndustryTypeEnum.values()){ + if(code.equals(industryType.code)){ + return industryType; + } + } + return null; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/IsOnWorkingEnums.java b/face-common/src/main/java/com/dkha/common/enums/IsOnWorkingEnums.java new file mode 100644 index 0000000..d5f1d3b --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/IsOnWorkingEnums.java @@ -0,0 +1,14 @@ +package com.dkha.common.enums; + +public enum IsOnWorkingEnums { + ON_WORKING("Y", "在职"), + NOT_ON_WORKING("N", "离职"); + + public String code; + public String name; + + IsOnWorkingEnums(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/IsPoorEnums.java b/face-common/src/main/java/com/dkha/common/enums/IsPoorEnums.java new file mode 100644 index 0000000..88ba21b --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/IsPoorEnums.java @@ -0,0 +1,13 @@ +package com.dkha.common.enums; + +public enum IsPoorEnums { + Y("Y", "是"), + N("N", "否"); + public String code; + public String name; + + IsPoorEnums(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/LaborMessageEnms.java b/face-common/src/main/java/com/dkha/common/enums/LaborMessageEnms.java new file mode 100644 index 0000000..1d282fd --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/LaborMessageEnms.java @@ -0,0 +1,20 @@ +package com.dkha.common.enums; + +/** + * @ClassName: LaborMessageEnms + * @Description:(please write your description) + * @author: 严平 + * @date: 2019-09-24 + * @Copyright: 成都电科惠安 + */ +public enum LaborMessageEnms { + SIGNED("1", "用人单位同意岗位"), + RELIEVE("2", "用人单位拒绝岗位"); + public String code; + public String name; + + LaborMessageEnms(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/MsgEnums.java b/face-common/src/main/java/com/dkha/common/enums/MsgEnums.java new file mode 100644 index 0000000..f958bdb --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/MsgEnums.java @@ -0,0 +1,34 @@ +package com.dkha.common.enums; + + +/** + * 预警消息推送 + */ +public enum MsgEnums { + +// Completion warning Income alarm Unemployment alarm + COMPLETION_ALARM(1,"15日旷工人员"), + NO_INCOME_ALARM(2,"6个月没有收入人员"), + UNEMPLOYMENT_ALARM(3,"失业人数"), + UNEMPLOYED_FAMILY(4,"一户零就业户数"), + NEW_COMPANY_ALARM(5,"新公司申请"), + TOTAL_LABORFORCE(6,"劳动力总数"), + ON_WORK(7,"已就业人数"), + ON_POOL(8,"贫困户户数"), + + UNEMPLOYMENT(3,"失业"), + UNEMPLOYED(4,"一户零就业"), + POOR(8,"贫困"), + ; + + + + public Integer type; + public String msg; + + MsgEnums(Integer type,String msg) + { + this.type=type; + this.msg=msg; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/OpinionEnums.java b/face-common/src/main/java/com/dkha/common/enums/OpinionEnums.java new file mode 100644 index 0000000..f8f4df7 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/OpinionEnums.java @@ -0,0 +1,22 @@ +package com.dkha.common.enums; + +/** + * 录取意见状态 + */ +public enum OpinionEnums { + + PASS("1", "通过"), + FAIL("2", "未通过"), + PENDING("0", "待处理"); + + + public String code; + public String name; + + OpinionEnums(String code, String name) { + this.code = code; + this.name = name; + } + + +} diff --git a/face-common/src/main/java/com/dkha/common/enums/PlatformDictTypeEnum.java b/face-common/src/main/java/com/dkha/common/enums/PlatformDictTypeEnum.java new file mode 100644 index 0000000..aaf5289 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/PlatformDictTypeEnum.java @@ -0,0 +1,23 @@ +package com.dkha.common.enums; + +/** + * @author Spring + * @date 2018/5/18-11:30 + * @Description: 全局字典枚举 -- 全平台统一维护 + */ +public enum PlatformDictTypeEnum { + + COMPANY_TYPE("company", "公司类型枚举Type"), + EDUCATION("education", "学历枚举类型"), + POST_SKILL("postSkill", "职业技能枚举类型"), + REGION("region", "区域枚举类型"), + BOARD_AND_LODGING("accommodation", "食宿安排枚举类型"); +// WORK_ADDRESS("workAddress", "工作地点枚举类型"); + public String code; + public String name; + + PlatformDictTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/PlatformTypeEnum.java b/face-common/src/main/java/com/dkha/common/enums/PlatformTypeEnum.java new file mode 100644 index 0000000..e6a3091 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/PlatformTypeEnum.java @@ -0,0 +1,21 @@ +package com.dkha.common.enums; + +/** + * @Author Spring + * @Since 2019/9/11 17:36 + * @Description 平台类型枚举 + */ +public enum PlatformTypeEnum { + + API("API", "APP平台"), + COMPANY("COMPANY", "劳动就业岗位发布平台"), + GOVERNMENT("GOVERNMENT", "劳动就业服务平台"); + + public String code; + public String name; + + PlatformTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/ProjectType.java b/face-common/src/main/java/com/dkha/common/enums/ProjectType.java new file mode 100644 index 0000000..342841e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/ProjectType.java @@ -0,0 +1,19 @@ +package com.dkha.common.enums; + +/** + * + */ +public enum ProjectType { + + APPROVAL("0", "审批"), + CHECK("1", "核准"), + FILING("2", "备案"); + public String code; + public String name; + + ProjectType(String code, String name) { + this.code = code; + this.name = name; + } + +} diff --git a/face-common/src/main/java/com/dkha/common/enums/SEXEnums.java b/face-common/src/main/java/com/dkha/common/enums/SEXEnums.java new file mode 100644 index 0000000..23d3f96 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/SEXEnums.java @@ -0,0 +1,30 @@ +package com.dkha.common.enums; + +/** + * 性别枚举 + */ +public enum SEXEnums { + MAN("0", "男"), + WOMAN("1", "女"), + NOLIMIT("2", "保密"); + public String code; + public String name; + + SEXEnums(String code, String name) { + this.code = code; + this.name = name; + } + public static SEXEnums getTypeByValue(String code) + { + if (null==code){ + return NOLIMIT; + } + for (SEXEnums enums : SEXEnums.values()) { + if (enums.code.equals(code)) { + return enums; + } + } + return NOLIMIT; + } + +} diff --git a/face-common/src/main/java/com/dkha/common/enums/SocketEnum.java b/face-common/src/main/java/com/dkha/common/enums/SocketEnum.java new file mode 100644 index 0000000..2de38e0 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/SocketEnum.java @@ -0,0 +1,28 @@ +package com.dkha.common.enums; + +import lombok.Getter; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: SocketEnum + * @Package com.dkha.common.enums + * @author: panhui + * @date: 2020/1/3 15:50 + * @Copyright: 成都电科慧安 + */ +@Getter +public enum SocketEnum { + + WARNING("WARNING","预警"), + BAYONET("BAYONET","卡口"); + + private String code; + private String msg; + + SocketEnum(String code, String msg) { + this.code = code; + this.msg = msg; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/TaskStatuEnum.java b/face-common/src/main/java/com/dkha/common/enums/TaskStatuEnum.java new file mode 100644 index 0000000..b7ee251 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/TaskStatuEnum.java @@ -0,0 +1,29 @@ +package com.dkha.common.enums; + +import lombok.Getter; + +/** + * @version V1.0 + * @Description: 布控任务 + * @Title: + * @author: huangyugang + * @date: 2019/12/18 16:22 + * @Copyright: 成都电科慧安 + */ +@Getter +public enum TaskStatuEnum { + STATUS_UNDEF("STATUSUNDEF","未知"), + STATUS_STARTING("STATUSSTARTING","正在打开"), + STATUS_WORKING("STATUSWORKING","工作中"), + STATUS_RESTATING("STATUSRESTATING","正在重新打开"), + STATUS_OVER("STATUSOVER","任务已经结束"); + private String code; + private String message; + + TaskStatuEnum(String code, String message) + { + this.code=code; + this.message=message; + } + +} diff --git a/face-common/src/main/java/com/dkha/common/enums/TaskStatusEnum.java b/face-common/src/main/java/com/dkha/common/enums/TaskStatusEnum.java new file mode 100644 index 0000000..a80de0f --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/TaskStatusEnum.java @@ -0,0 +1,23 @@ +package com.dkha.common.enums; + +/** + * @version V1.0 + * @Description: 布控任务状态 + * @Title: + * @author: huangyugang + * @date: 2019/12/11 9:13 + * @Copyright: 成都电科慧安 + */ +public enum TaskStatusEnum { + RUN("0", "运行中"), + STOP("-1", "停止运行"), + SUSPEND("1","暂停运行"); + + public String code; + public String name; + + TaskStatusEnum(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/TrainingAssessmentStatus.java b/face-common/src/main/java/com/dkha/common/enums/TrainingAssessmentStatus.java new file mode 100644 index 0000000..e3bb097 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/TrainingAssessmentStatus.java @@ -0,0 +1,15 @@ +package com.dkha.common.enums; + +public enum TrainingAssessmentStatus { + PASS("0", "通过"), + + NOT_PASS("1", "未通过"), + INIT("2", "初始状态"); + public String code; + public String name; + + TrainingAssessmentStatus(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/YNEnums.java b/face-common/src/main/java/com/dkha/common/enums/YNEnums.java new file mode 100644 index 0000000..47d7366 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/YNEnums.java @@ -0,0 +1,20 @@ +package com.dkha.common.enums; + +/** + * @author Spring + * @date 2018/5/18-11:30 + * @Description: 逻辑判断枚举 + */ +public enum YNEnums { + + YES("Y", "是"), + NO("N", "否"); + + public String code; + public String name; + + YNEnums(String code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/enums/YNNumberEnum.java b/face-common/src/main/java/com/dkha/common/enums/YNNumberEnum.java new file mode 100644 index 0000000..5437a93 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/enums/YNNumberEnum.java @@ -0,0 +1,20 @@ +package com.dkha.common.enums; + +/** + * @ClassName: 是否枚举 + * @Description: 使用数字 + * @author: yanping + * @date: 2020-01-06 + * @Copyright: 成都电科惠安 + */ +public enum YNNumberEnum { + YES(1, "是"), + NO(0, "否"); + public Integer code; + public String name; + + YNNumberEnum(Integer code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/face-common/src/main/java/com/dkha/common/exception/AuthorityException.java b/face-common/src/main/java/com/dkha/common/exception/AuthorityException.java new file mode 100644 index 0000000..5cbff2e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/exception/AuthorityException.java @@ -0,0 +1,27 @@ +package com.dkha.common.exception; + +/** + * @Author Spring + * @Since 2019/9/21 11:58 + * @Description 权限相关异常--主要用于权限拦截器 + * + */ + +public class AuthorityException extends RuntimeException { + + public AuthorityException(String s) { + super(s); + } + + public AuthorityException(String s, Throwable throwable) { + super(s, throwable); + } + + public AuthorityException(Throwable throwable) { + super(throwable); + } + + public AuthorityException() { + + } +} diff --git a/face-common/src/main/java/com/dkha/common/exception/DkAuthorityException.java b/face-common/src/main/java/com/dkha/common/exception/DkAuthorityException.java new file mode 100644 index 0000000..694e0ca --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/exception/DkAuthorityException.java @@ -0,0 +1,27 @@ +package com.dkha.common.exception; + +/** + * @Author Spring + * @Since 2019/9/21 11:58 + * @Description 权限相关异常--主要用于权限拦截器 + * + */ + +public class DkAuthorityException extends RuntimeException { + + public DkAuthorityException(String s) { + super(s); + } + + public DkAuthorityException(String s, Throwable throwable) { + super(s, throwable); + } + + public DkAuthorityException(Throwable throwable) { + super(throwable); + } + + public DkAuthorityException() { + + } +} diff --git a/face-common/src/main/java/com/dkha/common/exception/DkException.java b/face-common/src/main/java/com/dkha/common/exception/DkException.java new file mode 100644 index 0000000..81e898c --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/exception/DkException.java @@ -0,0 +1,78 @@ +package com.dkha.common.exception; + + +import com.dkha.common.systemcode.SystemCode; + +/** + * @author Spring + * @date 2018/5/18-11:30 + * @Description: 自定义异常 + */ +public class DkException extends RuntimeException { + /** + * 异常码 + */ + private int code; + /** + * 异常信息 + */ + private String msg; + + public DkException() { + this.code = SystemCode.HANDLER_FAILED.code; + this.msg = SystemCode.HANDLER_FAILED.des; + } + + public DkException(int code) { + this.code = code; + this.msg = SystemCode.get(code).des; + } + public DkException(int code,String msg) { + this.code = code; + this.msg = msg; + } + public DkException(int code, Throwable e) { + super(e); + this.code = code; + this.msg = SystemCode.get(code).des; + } + + public DkException(String msg) { + super(msg); + this.code = SystemCode.HANDLER_FAILED.code; + this.msg = msg; + } + + public DkException(String msg, Throwable e) { + super(msg, e); + this.code = SystemCode.HANDLER_FAILED.code; + this.msg = msg; + } + public DkException(SystemCode systemCode) { + super(systemCode.des); + this.code = systemCode.code; + this.msg = systemCode.des; + } + + public DkException(Throwable e) { + super(e); + this.code = SystemCode.HANDLER_FAILED.code; + this.msg = SystemCode.HANDLER_FAILED.des; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } +} diff --git a/face-common/src/main/java/com/dkha/common/exception/EmployeeException.java b/face-common/src/main/java/com/dkha/common/exception/EmployeeException.java new file mode 100644 index 0000000..bca8a59 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/exception/EmployeeException.java @@ -0,0 +1,25 @@ +package com.dkha.common.exception; + +/** + * @author Spring + * @date 2018/5/18-11:30 + * @Description: 自定义异常 + */ +public class EmployeeException extends RuntimeException { + + public EmployeeException(String s) { + super(s); + } + + public EmployeeException(String s, Throwable throwable) { + super(s, throwable); + } + + public EmployeeException(Throwable throwable) { + super(throwable); + } + + public EmployeeException() { + + } +} diff --git a/face-common/src/main/java/com/dkha/common/fileupload/MinioUtil.java b/face-common/src/main/java/com/dkha/common/fileupload/MinioUtil.java new file mode 100644 index 0000000..adec556 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/fileupload/MinioUtil.java @@ -0,0 +1,391 @@ +package com.dkha.common.fileupload; + +import com.alibaba.fastjson.JSONObject; +import com.dkha.common.util.UtilValidate; +import io.minio.MinioClient; +import io.minio.ObjectStat; +import io.minio.Result; +import io.minio.messages.DeleteError; +import io.minio.messages.Item; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import javax.servlet.http.HttpServletResponse; +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +/** + * @ClassName: + * @Description: (please write your description) + * @author: {开发人的姓名} + * @date: + * @Copyright: 成都电科惠安 + */ +@Component +public class MinioUtil { + + public static final Logger logger = LoggerFactory.getLogger(MinioUtil.class); + + @Value("${minio.url}") + private String url; + @Value("${minio.accessKey}") + private String accessKey; + + @Value("${minio.secretKey}") + private String secretKey; + + @Value("${minio.bucketName}") + private String bucketName; + + + /** + * @param inputStream + * @param suffix + * @return + * @throws Exception + * @Title: uploadImage + * @Description:上传图片 + */ + public JSONObject uploadImage(InputStream inputStream, String fileName, String suffix) throws Exception { + return upload(inputStream, fileName, suffix, "image/jpeg"); + } + + /** + * 上传图片 + * + * @param inputStream + * @param suffix + * @return + * @throws Exception + */ + public JSONObject uploadImage(InputStream inputStream, String suffix) throws Exception { + return upload(inputStream, null, suffix, "image/jpeg"); + } + + /** + * @param inputStream + * @param suffix + * @return + * @throws Exception + * @Title: uploadVideo + * @Description:上传视频 + */ + public JSONObject uploadVideo(InputStream inputStream, String fileName, String suffix) throws Exception { + return upload(inputStream, fileName, suffix, "video/mp4"); + } + + + /** + * @param inputStream + * @param suffix + * @return + * @throws Exception + * @Title: uploadVideo + * @Description:上传文件 + */ + public JSONObject uploadFile(InputStream inputStream, String fileName, String suffix) throws Exception { + return upload(inputStream, fileName, suffix, "application/octet-stream"); +// return upload(inputStream, fileName, suffix, "audio/mp3"); + } + + /** + * @param inputStream + * @param suffix + * @return + * @throws Exception + * @Title: uploadVideo + * @Description:上传文件 + */ + public JSONObject uploadFiles(InputStream inputStream, String folder,String fileName, String suffix) throws Exception { + return uploads(inputStream, folder,fileName, suffix, "application/octet-stream"); +// return upload(inputStream, fileName, suffix, "audio/mp3"); + } + /** + * 上传字符串大文本内容 + * + * @param str + * @return + * @throws Exception + * @Title: uploadString + * @Description:描述方法 + */ + public JSONObject uploadString(String str, String fileName) throws Exception { + if (!StringUtils.isEmpty(str)) { + return new JSONObject(); + } + InputStream inputStream = new ByteArrayInputStream(str.getBytes()); + return upload(inputStream, fileName, null, "text/html"); + } + + + /** + * @return + * @throws Exception + * @Title: upload + * @Description:上传主功能 + */ + private JSONObject upload(InputStream inputStream, String fileName, String suffix, String contentType) throws Exception { + JSONObject map = new JSONObject(); + MinioClient minioClient = new MinioClient(url, accessKey, secretKey); + // 检查存储桶是否已经存在 + boolean isExist = minioClient.bucketExists(bucketName); + if (isExist) { +// System.out.println("Bucket already exists."); + } else { + // 创建一个名为asiatrip的存储桶,用于存储文件。 + minioClient.makeBucket(bucketName); + } + + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + String ymd = sdf.format(new Date()); +// String objectName = ymd + "/" + fileName + "/" + UUID.randomUUID() + (suffix != null ? suffix : ""); + String objectName = ymd + "/" + (UtilValidate.isEmpty(fileName) ? getUniqueFileName() : fileName) + (suffix != null ? suffix : ""); + minioClient.putObject(bucketName, objectName, inputStream, contentType); + String url = minioClient.getObjectUrl(bucketName, objectName); + map.put("flag", "0"); + map.put("mess", "上传成功"); + map.put("url", url); + map.put("fullName", objectName); +// map.put("path", bucketName + "/" + objectName); + map.put("path", objectName); + return map; + } + /** + * @return + * @throws Exception + * @Title: upload + * @Description:上传主功能 + */ + private JSONObject uploads(InputStream inputStream,String folder, String fileName, String suffix, String contentType) throws Exception { + JSONObject map = new JSONObject(); + MinioClient minioClient = new MinioClient(url, accessKey, secretKey); + // 检查存储桶是否已经存在 + boolean isExist = minioClient.bucketExists(bucketName); + if (isExist) { +// System.out.println("Bucket already exists."); + } else { + // 创建一个名为asiatrip的存储桶,用于存储文件。 + minioClient.makeBucket(bucketName); + } + + String objectName = folder + "/" + (UtilValidate.isEmpty(fileName) ? getUniqueFileName() : fileName) + (suffix != null ? suffix : ""); + minioClient.putObject(bucketName, objectName, inputStream, contentType); + String url = minioClient.getObjectUrl(bucketName, objectName); + map.put("flag", "0"); + map.put("mess", "上传成功"); + map.put("url", url); + map.put("fullName", objectName); +// map.put("path", bucketName + "/" + objectName); + map.put("path", objectName); + return map; + } + /** + * 获取上传对象信息 + * + * @param bucketName + * @param objectName + * @return + * @throws Exception + */ + public ObjectStat objectStat(String bucketName, String objectName) throws Exception { + MinioClient minioClient = new MinioClient(url, accessKey, secretKey); + ObjectStat objectStat = minioClient.statObject(bucketName, objectName); + return objectStat; + } + + /** + * 删除多个 + * + * @param bucketName + * @param objectNames + * @return + * @throws Exception + */ + public JSONObject removeObjects(String bucketName, List objectNames) throws Exception { + JSONObject map = new JSONObject(); + MinioClient minioClient = new MinioClient(url, accessKey, secretKey); + for (Result errorResult : minioClient.removeObjects(bucketName, objectNames)) { + DeleteError error = errorResult.get(); + System.out.println("Failed to remove '" + error.objectName() + "'. Error:" + error.message()); + map.put("results", error); + } +// Iterable> results =minioClient.removeObjects(bucketName,objectNames); +// map.put("results",results); + return map; + } + + /** + * 删除文件 + * + * @param bucketName + * @param objectName + * @return + * @throws Exception + */ + public JSONObject removeObject(String bucketName, String objectName) throws Exception { + JSONObject map = new JSONObject(); + MinioClient minioClient = new MinioClient(url, accessKey, secretKey); + minioClient.removeObject(bucketName, objectName); + map.put("results", "ok"); + return map; + } + + /** + * 根据存储箱和前缀查询对象集合 + * + * @param bucketName + * @param prefix 文件对象前缀可以不传) + * @return + */ + public Iterable> listObjects(String bucketName, String prefix) { + Iterable> myObjects = new ArrayList<>(); + try { + MinioClient minioClient = new MinioClient(url, accessKey, secretKey); + // Check whether 'mybucket' exists or not. + boolean found = minioClient.bucketExists(bucketName); + if (found) { + //如果prefix为null或者‘’ + if ("".equals(prefix) || prefix == null) { + myObjects = minioClient.listObjects(bucketName); + } else { + //前缀查询 + myObjects = minioClient.listObjects(bucketName, prefix); + } + } else { + System.out.println("mybucket does not exist"); + } + } catch (Exception e) { + e.printStackTrace(); + System.out.println("Error occurred: " + e); + } + return myObjects; + } + + /** + * 根据桶和前缀输出里面所有的信息 + * + * @param bucketName + * @param prefix + */ + public void printObjectsMsg(String bucketName, String prefix) { + Iterable> results = listObjects(bucketName, prefix); + for (Result result : results) { + Item item = null; + try { + item = result.get(); + } catch (Exception e) { + e.printStackTrace(); + } + logger.info(item.lastModified() + ", " + item.size() + ", " + item.objectName()); + } + } + + /** + * 以流的形式下载文件 + * + * @param bucketName 桶名称 + * @param objectName 对象名称 + * @return + */ + public void downloadFile(String bucketName, String objectName, HttpServletResponse response,String fileName) { + try { + MinioClient minioClient = new MinioClient(url, accessKey, secretKey); + InputStream inputStream = minioClient.getObject(bucketName, objectName); + OutputStream os = response.getOutputStream(); + BufferedInputStream br = new BufferedInputStream(inputStream); + byte[] buf = new byte[1024]; + int len = 0; + response.reset(); + response.setContentType("application/octet-stream"); +// response.setHeader("Access-Control-Allow-Origin", "localhost:8001"); + response.setHeader("Content-Disposition", "attachment; filename=" + new String(fileName.getBytes("utf-8"), "ISO-8859-1")); + OutputStream out = response.getOutputStream(); + while ((len = br.read(buf)) > 0) { + out.write(buf, 0, len); + } + br.close(); + out.close(); + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + + } + + /** + * 获取唯一文件名 + * + * @return + */ + public String getUniqueFileName() { + return UUID.randomUUID().toString().replaceAll("-", ""); + } + + /** + * 通过图片路径获取桶名称 + * + * @param fileUrl + * @return 桶名称 + */ + public String getBucketNameByUrl(String fileUrl) { + String[] splitArray = fileUrl.split("/"); + return splitArray[3]; + } + + + /** + * 通过图片路径获取对象名称/文件名称 + * + * @param fileUrl + * @return + */ + public String getObjectNameByUrl(String fileUrl) { + String[] splitArray = fileUrl.split(getBucketNameByUrl(fileUrl)); + String splitResult = splitArray[1].replaceFirst("/", ""); + //临时地址处理 + if (splitResult.contains("?")) { + String[] split = splitResult.split("\\?"); + return split[0]; + } + return splitResult; + } + + /** + * 获取文件名称 包括后缀 + * + * @param fileUrl + * @return + */ + public String getFileName(String fileUrl) { + String[] split = fileUrl.split("/"); + return split[split.length - 1]; + } + + /** + * 截取minio有效的url 将问号后面的所有内容去掉 + * + * @param minioUrl + * @return + */ + public String interceptValidUrl(String minioUrl) { + if (UtilValidate.isNotEmpty(minioUrl)) { + return minioUrl.substring(0, minioUrl.indexOf("?")); + } + return null; + } + + public static void main(String[] args) throws Exception { + System.out.println(UUID.randomUUID().toString().replaceAll("-", "")); + } + +} diff --git a/face-common/src/main/java/com/dkha/common/http/ConfigBean.java b/face-common/src/main/java/com/dkha/common/http/ConfigBean.java new file mode 100644 index 0000000..a87e9de --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/http/ConfigBean.java @@ -0,0 +1,25 @@ +package com.dkha.common.http; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestTemplate; + +/** + * @Description: + * @Author: Spring + * @CreateDate: 2019/8/5 14:19 + */ +@Configuration +public class ConfigBean { + + /** + * @ConditionalOnMissingBean bean不存在的情况下才注入 + * @return + */ + @Bean + @ConditionalOnMissingBean + public RestTemplate getRestTemplate() { + return new RestTemplate(); + } +} diff --git a/face-common/src/main/java/com/dkha/common/http/HttpUtil.java b/face-common/src/main/java/com/dkha/common/http/HttpUtil.java new file mode 100644 index 0000000..e3d5910 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/http/HttpUtil.java @@ -0,0 +1,175 @@ +package com.dkha.common.http; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.dkha.common.modules.vo.face.ApiAlarmVO; +import com.dkha.common.util.UtilValidate; +import jdk.nashorn.internal.scripts.JS; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.*; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + +import javax.servlet.http.HttpServletRequest; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; + + +/** + * @Author Spring + * @Since 2019/10/31 18:21 + * @Description + */ +@Component +public class HttpUtil { + + public static final Logger logger = LoggerFactory.getLogger(HttpUtil.class); + + @Autowired + private RestTemplate restTemplate; + + /** + * post request + * @param url + * @param requestObj request params + * @param resultClass + * @param + * @return + */ + public T post(String url, Object requestObj, Class resultClass) { + T t = restTemplate.postForObject(url, this.getHeaders(requestObj), resultClass); +// logger.info("post result: {}", JSON.toJSONString(resultClass)); + return t; + } + + /** + * put request + * @param url + * @param requestObj + * @param resultClass + * @param + * @return + */ + public T put(String url, Object requestObj, Class resultClass) { + ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.PUT, this.getHeaders(requestObj), resultClass); +// logger.info("put result: {}", JSON.toJSONString(resultClass)); + return responseEntity.getBody(); + } + + /** + * get request + * @param url + * @param resultClass + * @param + * @return + */ + public T get(String url, Class resultClass) { + ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.GET, this.getHeaders(null), resultClass); + return responseEntity.getBody(); + } + public T get(String url, Object requestObj, Class resultClass) { + ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.GET, this.getHeaders(requestObj), resultClass); + return responseEntity.getBody(); + } + + public T delete(String url, Class resultClass) { + ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.DELETE, this.getHeaders(null), resultClass); + +// logger.info("delete result: {}", JSON.toJSONString(resultClass)); + return responseEntity.getBody(); + } + + /** + * 判断返回是否成功 + * @param resultObject + * @return + */ + public boolean isSuccess(Object resultObject) { + String resultJson = JSON.toJSONString(resultObject); + Map map = JSON.parseObject(resultJson, Map.class); + if (UtilValidate.isNotEmpty(map) && map.get("rtn").toString().equals("0")) { + return true; + } else { + return false; + } + } + + /**\ + * 获取POST请求参数 + * @param request + * @return + */ + public static String getPostRequestParam(HttpServletRequest request) throws IOException { + String bodyStr = getRequestPostBytes(request); + return new String(bodyStr.getBytes(), "UTF-8"); + } + + /** + * 描述:获取 post 请求的 byte[] 数组 + *
+     * 举例:
+     * 
+ * @param request + * @return + * @throws IOException + */ + public static String getRequestPostBytes(HttpServletRequest request) throws IOException { + + BufferedReader br = request.getReader(); + + String str; + String wholeStr = ""; + while((str = br.readLine()) != null){ + wholeStr += str; + } + return wholeStr.toString(); + } + + /** + * 获取HTTP请求头信息 + * @param request + * @return + */ + public static Map getRequestHeadMsg(HttpServletRequest request) { + Map requestHeaderMsgMap = new HashMap<>(); + Enumeration headerNames = request.getHeaderNames(); + while (headerNames.hasMoreElements()) { + String key = (String) headerNames.nextElement(); + String value = request.getHeader(key); + requestHeaderMsgMap.put(key, value); + } + return requestHeaderMsgMap; + } + + /** + * 请求头设置 + */ + private HttpEntity getHeaders(Object requestObject) { + HttpHeaders headers = new HttpHeaders(); + MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); + headers.setContentType(type); + headers.add("Accept", MediaType.APPLICATION_JSON.toString()); + //请求url不包含login,则需要设置请求头 + /*if (!(JSON.toJSONString(requestObject).contains("name") && JSON.toJSONString(requestObject).contains("password"))) { + headers.add("session_id", FaceSessionCache.get()); + }*/ + +// if (JSON.toJSONString(requestObject).contains("token") ) { +// try { +// ApiAlarmVO apiAlarmVO=(ApiAlarmVO)requestObject; +// headers.add("token",apiAlarmVO.getToken() ); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } + + + HttpEntity headerEntity = new HttpEntity<>(UtilValidate.isEmpty(requestObject) ? null : JSON.toJSONString(requestObject), headers); + return headerEntity; + } +} diff --git a/face-common/src/main/java/com/dkha/common/jwt/JwtConstantEnum.java b/face-common/src/main/java/com/dkha/common/jwt/JwtConstantEnum.java new file mode 100644 index 0000000..f7e9810 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/jwt/JwtConstantEnum.java @@ -0,0 +1,22 @@ +package com.dkha.common.jwt; + +/** + * @Author Spring + * @Since 2019/9/11 17:36 + * @Description + */ +public enum JwtConstantEnum { + + PLATFORM("platform", "platform"), + USER_ID("uerId", "userId"), + UUID("uuid", "uuid"); + + + public String code; + public String msg; + + JwtConstantEnum(String code, String msg) { + this.code = code; + this.msg = msg; + } +} diff --git a/face-common/src/main/java/com/dkha/common/jwt/JwtHelper.java b/face-common/src/main/java/com/dkha/common/jwt/JwtHelper.java new file mode 100644 index 0000000..96062f8 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/jwt/JwtHelper.java @@ -0,0 +1,97 @@ +package com.dkha.common.jwt; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.TokenExpiredException; +import com.auth0.jwt.interfaces.Claim; +import com.auth0.jwt.interfaces.DecodedJWT; +import com.dkha.common.exception.AuthorityException; +import com.dkha.common.exception.EmployeeException; +import com.dkha.common.systemcode.SystemCode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Map; + +/** + * 后端主要实现用户的验证、token的签发、从http中解析出token串、token的验证、token的刷新等 + * 在本类中并未全部实现,有待完善 + * @Author: Spring + * Created on 2018/4/23. + */ +public class JwtHelper { + + private static final Logger logger = LoggerFactory.getLogger(JwtHelper.class); + + /** + * 用于HS256 hash加密算法,也可采用非对称的RS256公私钥加密 https://www.cnblogs.com/hehheai/p/6513871.html + */ + private static final String secret = "dk_employment_2019.10.12"; + + /** + * JWT生成方法,采用id和expiresTime,除保留字段,用户可自定义其余字段 + * 以下为保留字段 + * + * iss(Issuser):如果签发的时候这个claim的值是“a.com”,验证的时候如果这个claim的值不是“a.com”就属于验证失败; + * sub(Subject):如果签发的时候这个claim的值是“liuyunzhuge”,验证的时候如果这个claim的值不是“liuyunzhuge”就属于验证失败; + * aud(Audience):如果签发的时候这个claim的值是“['b.com','c.com']”,验证的时候这个claim的值至少要包含b.com,c.com的其中一个才能验证通过; + * exp(Expiration time):如果验证的时候超过了这个claim指定的时间,就属于验证失败; + * nbf(Not Before):如果验证的时候小于这个claim指定的时间,就属于验证失败; + * iat(Issued at):它可以用来做一些maxAge之类的验证,假如验证时间与这个claim指定的时间相差的时间大于通过maxAge指定的一个值,就属于验证失败; + * jti(JWT ID):如果签发的时候这个claim的值是“1”,验证的时候如果这个claim的值不是“1”就属于验证失败 + * + * @return + */ + public static String generateJWT(String platform, String userId, String uuid) { + + /**设置JWT头部信息*/ + Map headerMap = new HashMap(2); + headerMap.put("typ", "JWT"); + headerMap.put("alg", "HS256"); + String token = null; + try { + token = JWT.create().withHeader(headerMap) + .withClaim(JwtConstantEnum.PLATFORM.code, platform) + .withClaim(JwtConstantEnum.USER_ID.code, userId) + .withClaim(JwtConstantEnum.UUID.code, uuid) + .sign(Algorithm.HMAC256(secret)); + } catch (UnsupportedEncodingException e) { + logger.error(e.getMessage(), e); + throw new EmployeeException(e); + } + return token; + } + + + /** + * 验证JWT 该验证只能验证JWT保留字段,具体自定义验证需自定义完成 + * 具体的错误类型可以通过设置求参数通过下面的main函数验证 + * @param token + * @return + */ + public static Map verifyToken(String token) { + DecodedJWT jwt = null; + try { + JWTVerifier verifier = JWT.require(Algorithm.HMAC256(secret)).build(); + jwt = verifier.verify(token); + return jwt.getClaims(); + } catch (UnsupportedEncodingException e) { + logger.error(e.getMessage(), e); + throw new AuthorityException(SystemCode.TOKEN_ERROR.code.toString()); + } catch (TokenExpiredException e) { + logger.error(e.getMessage(), e); + throw new AuthorityException(SystemCode.TOKEN_EXPIRED.code.toString()); + } catch (Exception e) { + logger.error(e.getMessage(), e); + throw new AuthorityException(SystemCode.TOKEN_ERROR.code.toString()); + } + } + + public static void main(String[] args) { + //JwtHelper.verifyToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIn0.kEZueQ8xZ_FKvlOxfC01bTaW3EqUGV9HJKKeeor6XQ1"); + } + +} diff --git a/face-common/src/main/java/com/dkha/common/kaptcha/KaptchaConfig.java b/face-common/src/main/java/com/dkha/common/kaptcha/KaptchaConfig.java new file mode 100644 index 0000000..6d86986 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/kaptcha/KaptchaConfig.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.common.kaptcha; + +import com.google.code.kaptcha.impl.DefaultKaptcha; +import com.google.code.kaptcha.util.Config; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.Properties; + + +/** + * 生成验证码配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class KaptchaConfig { + + @Bean + public DefaultKaptcha producer() { + Properties properties = new Properties(); + properties.put("kaptcha.border", "no"); + properties.put("kaptcha.textproducer.font.color", "black"); + properties.put("kaptcha.textproducer.font.names", "Arial,Courier,cmr10,宋体,楷体,微软雅黑"); + properties.put("kaptcha.textproducer.char.space", "5"); + Config config = new Config(properties); + DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); + defaultKaptcha.setConfig(config); + return defaultKaptcha; + } +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/ApiVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/ApiVO.java new file mode 100644 index 0000000..a25f0a1 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/ApiVO.java @@ -0,0 +1,34 @@ +package com.dkha.common.modules.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiVO + * @Package com.dkha.common.entity.vo + * @author: panhui + * @date: 2019/11/27 9:36 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="通用接口参数类 发送和接收通用", description="用于和底层传输统一参数格式") +public class ApiVO { + @ApiModelProperty(value = "错误码") + private Integer code; + @ApiModelProperty(value = "错误提示") + private String message; + @ApiModelProperty(value = "操作命令对应不同的接口") + private String cmd; + @ApiModelProperty(value = "请求参数") + private Object data; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/ReturnVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/ReturnVO.java new file mode 100644 index 0000000..1f70d49 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/ReturnVO.java @@ -0,0 +1,150 @@ +package com.dkha.common.modules.vo; + + +import com.dkha.common.enums.ErrEnum; +import com.dkha.common.exception.DkException; +import com.dkha.common.util.UtilValidate; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.validation.BindingResult; + +import java.io.Serializable; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ReturnVO + * @Package com.dkha.api.modules + * @author: panhui + * @date: 2019/12/2 13:34 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="API通用返回", description="Api通用返回結構類") +public class ReturnVO implements Serializable { + + private Integer code; + private String message; + private Object data; + private static final long serialVersionUID = 1L; + + + public ReturnVO(Object data, Integer code, String message) { + this.code = code; + this.data = data; + this.message = message; + } + + public ReturnVO(Integer code, String message) { + this.code = code; + this.data = null; + this.message = message; + } + + /** + * 操作成功返回集 code为200 + */ + public ReturnVO successResult(Object data) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.OK.getCode(); + ReturnVO.data = data; + ReturnVO.message = ErrEnum.OK.getMsg(); + return ReturnVO; + } + + /** + * 操作成功返回集 code为200 + * @param message + * @param data + */ + public ReturnVO successResult(String message, Object data) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.OK.getCode(); + ReturnVO.data = data; + ReturnVO.message = UtilValidate.isEmpty(message) ? ErrEnum.OK.getMsg() : message; + return ReturnVO; + } + + /** + * 操作失败返回集 默认code 500 + * @param message + * @return + */ + public ReturnVO failResult(String message) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.ERROR.getCode(); + ReturnVO.data = null; + ReturnVO.message = message; + return ReturnVO; + } + + /** + * 参数不正确 默认code + * @param message + * @return + */ + public ReturnVO paramErrorResult(String message) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.BAD_REQUEST.getCode(); + ReturnVO.data = null; + ReturnVO.message = (UtilValidate.isEmpty(message)? ErrEnum.BAD_REQUEST.getMsg():message); + return ReturnVO; + } + + /** + * 没有查询到数据 默认code + * @param message + * @return + */ + public ReturnVO notInfoResult(String message) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.NOT_FOUND.getCode(); + ReturnVO.data = null; + ReturnVO.message = (UtilValidate.isEmpty(message)? ErrEnum.NOT_FOUND.getMsg():message); + return ReturnVO; + } + + /** + * 操作失败返回集 + * @param + * @return + */ + public ReturnVO fail() { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.ERROR.getCode(); + ReturnVO.data = null; + ReturnVO.message = ErrEnum.ERROR.getMsg(); + return ReturnVO; + } + + /** + * 操作失败返回集 + * @param data + * @param message + * @param code + */ + public ReturnVO failResult(Integer code, String message, Object data) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = UtilValidate.isEmpty(code) ? ErrEnum.ERROR.getCode() : code; + ReturnVO.data = data; + ReturnVO.message = UtilValidate.isEmpty(message) ? ErrEnum.ERROR.getMsg() : message; + return ReturnVO; + } + + /** + * 用于Hibernate-validate vo校验 + * @param bindingResult + */ + public void validate(BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + throw new DkException(bindingResult.getFieldError().getDefaultMessage()); + } + } +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/camera/AssociationPeopleVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/camera/AssociationPeopleVO.java new file mode 100644 index 0000000..6d6c7e5 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/camera/AssociationPeopleVO.java @@ -0,0 +1,32 @@ +package com.dkha.common.modules.vo.camera; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: AssociationPeopleVO + * @Package com.dkha.common.modules.vo.camera + * @author: panhui + * @date: 2020/1/9 17:57 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸特征id关联的预警信息", description="人脸特征id关联的预警信息") +public class AssociationPeopleVO { + @ApiModelProperty(value = "特征id") + private String featId; + @ApiModelProperty(value = "预警信息") + private List armIds; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/camera/BayOnetCameraVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/camera/BayOnetCameraVO.java new file mode 100644 index 0000000..6c11502 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/camera/BayOnetCameraVO.java @@ -0,0 +1,48 @@ +package com.dkha.common.modules.vo.camera; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.tomcat.jni.Library; + +import java.util.List; +import java.util.Map; + +/** + * @version V1.0 + * @Description: TODO(人物轨迹中redis存储单个摄像头分组信息) + * All rights 成都电科慧安 + * @Title: BayOnetCameraVO + * @Package com.dkha.common.modules.vo.camera + * @author: panhui + * @date: 2020/1/9 17:38 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人物轨迹数据", description="人物轨迹中redis存储单个摄像头分组信息") +public class BayOnetCameraVO { + + @ApiModelProperty(value = "摄像头id") + private String cameraId; + + @ApiModelProperty(value = "关联库id") + private String associationLibraryId; + +// @ApiModelProperty(value = "关联的人物数据") +// private PeopleVO peopleVO; + + @ApiModelProperty(value = "处理抓拍条数") + public Long warningNum = 0L; + + @ApiModelProperty(value = "关于人脸的featids") + private List featIds; +// @ApiModelProperty(value = "关联任务信息预警的id,人脸特征id-》不同的预警id信息") +// private List associationPeople; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/camera/CameraInfoVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/camera/CameraInfoVO.java new file mode 100644 index 0000000..d28cdcd --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/camera/CameraInfoVO.java @@ -0,0 +1,27 @@ +package com.dkha.common.modules.vo.camera; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: CameraInfoVO + * @Package com.dkha.task.modual.vo.track + * @author: panhui + * @date: 2020/1/8 18:05 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +public class CameraInfoVO { + + private String idFaceCamera; + private String cameraName; + private String cameraLongitude; + private String cameraLatitude; + private String status; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/camera/PeopleComparableVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/camera/PeopleComparableVO.java new file mode 100644 index 0000000..b7e5d1c --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/camera/PeopleComparableVO.java @@ -0,0 +1,44 @@ +package com.dkha.common.modules.vo.camera; + +import com.dkha.common.modules.vo.face.FeatureVO; +import com.dkha.common.modules.vo.position.PositionVO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: PeopleComparableVO + * @Package com.dkha.common.modules.vo.camera + * @author: panhui + * @date: 2020/1/14 16:20 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +public class PeopleComparableVO implements Comparable{ + + private String cameraId; + private CameraInfoVO cameraInfoVO; + private String esId; + private String faceUrl; + private String bgUrl; + private PositionVO position; + private Long timestamp; + private String time; + private Double score; + private FeatureVO featureVO; + private String faceId; + + @Override + public int compareTo(PeopleComparableVO peopleComparableVO) { + if(this.timestamp.intValue()!=peopleComparableVO.getTimestamp().intValue()) + { + return (this.timestamp.intValue()-peopleComparableVO.getTimestamp().intValue()); + } + return 0; + } +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/camera/PeopleVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/camera/PeopleVO.java new file mode 100644 index 0000000..45bf682 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/camera/PeopleVO.java @@ -0,0 +1,35 @@ +package com.dkha.common.modules.vo.camera; + +import com.dkha.common.modules.vo.face.FeatureVO; +import com.dkha.common.modules.vo.position.PositionVO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @version V1.0 + * @Description: TODO(绑定轨迹中需要的人脸数据) + * All rights 成都电科慧安 + * @Title: PeopleVO + * @Package com.dkha.task.modual.vo.track + * @author: panhui + * @date: 2020/1/10 11:36 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +public class PeopleVO implements Serializable { + private String esId; + private String faceUrl; + private String cameraId; + private String bgUrl; + private PositionVO position; + private Long timestamp; + private String time; + private Double score; + private FeatureVO featureVO; + private String faceId; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/control/ControlTaskVedioVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/control/ControlTaskVedioVO.java new file mode 100644 index 0000000..085c355 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/control/ControlTaskVedioVO.java @@ -0,0 +1,42 @@ +package com.dkha.common.modules.vo.control; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + *

+ * 布控表 + *

+ * + * @author Spring + * @since 2019-11-20 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) + +public class ControlTaskVedioVO{ + + private static final long serialVersionUID = 1L; + private String idControlTask; + @ApiModelProperty(value = "布控阈值") + private Double threshold; + @ApiModelProperty(value = "布控名称") + private String name; + @TableField(exist = false) + @ApiModelProperty(value = "url") + private String url; + + @TableField(exist = false) + @ApiModelProperty(value = "库id") + private List libraryId; + + @ApiModelProperty(value = "任务id") + private String taskId; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/control/ControlVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/control/ControlVO.java new file mode 100644 index 0000000..bdc54fb --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/control/ControlVO.java @@ -0,0 +1,43 @@ +package com.dkha.common.modules.vo.control; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ControlVO + * @Package com.dkha.common.entity.vo.control + * @author: panhui + * @date: 2019/11/27 10:55 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "布控-新增/删除", description = "用于布控和底层传输统一参数格式") +public class ControlVO { + @ApiModelProperty(value = "任务id") + private String taskId_cameraId; + @ApiModelProperty(value = "任务地址根据下面类型来传递不同的地址比如:rtsp和http") + private String vdUrl; + @ApiModelProperty(value = "任务类型VdUrlRtsp rtsp流类型url VdUrlGb28181 gb28181流类型url VdUrlHttp http视频文件类型url") + private String vdType; + @ApiModelProperty(value = "库列表id") + private List libIds; + @ApiModelProperty(value = "最小分值,取值范围0.00~1.00") + private Double minScore; + @ApiModelProperty(value = "每个库最大返回结果数, 0~100") + private Double maxRetNb; + + @ApiModelProperty(value = "删除任务列表") + private List taskIdCameraIds; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/control/TaskControlVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/control/TaskControlVO.java new file mode 100644 index 0000000..6df71ac --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/control/TaskControlVO.java @@ -0,0 +1,84 @@ +package com.dkha.common.modules.vo.control; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @version V1.0 + * @Description: 应用层布控任务VO + * @Title: + * @author: huangyugang + * @date: 2019/12/10 9:14 + * @Copyright: 成都电科慧安 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="ControlTask对象", description="布控任务") +public class TaskControlVO implements Serializable { + + @ApiModelProperty(value = "任务ID") + private Long idControlTask; + @ApiModelProperty(value = "布控对象(id 人像库id 或者上传图片id)") + private String controlObject; + + @ApiModelProperty(value = "任务名称") + @NotNull + @Length(min=3,message = "任务名称最小长度不能小于3") + private String taskName; + + @ApiModelProperty(value = "处置类型-码值 抓捕类1,监控类2,提示类0 默认选择0") + @NotNull(message = "处置类型不能为空") + private String disposalType; + + @ApiModelProperty(value = "布控类型-码值 长期布控 0,临时布控 1 默认选择0 ") + @NotNull(message = "布控类型不能为空") + private String controlType; + + @ApiModelProperty(value = "布控开始时间") + @DateTimeFormat(pattern = "yyy-MM-dd HH:mm") + private Date controlStartTime; + + @ApiModelProperty(value = "布控结束时间") + @DateTimeFormat(pattern = "yyy-MM-dd HH:mm") + private Date controlEndTime; + + @ApiModelProperty(value = "布控区域") + // @NotNull(message = "布控区域不能为空") + private String controlRegion; + + @ApiModelProperty(value = "布控阈值") + @NotNull(message = "布控阀值不能为空必须是0-1之间") + @Max(value = 1,message = "布控阈值 最大值为1") + @Min(value = 0,message = "布控阈值 最小值为0") + private Double controlThreshold; + + @ApiModelProperty(value = "布控对象库ID列表") + @NotNull + @Size(min = 1) + private List libIds; + + @ApiModelProperty(value = "布控的摄像头ID列表") + @NotNull + @Size(min = 1) + private List listcamera; + + @ApiModelProperty(value = "备注信息") + private String remarks; + + @ApiModelProperty(value = "上传图片布控的url") + private String imgurl; + + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/control/VideoControlVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/control/VideoControlVo.java new file mode 100644 index 0000000..8a9c518 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/control/VideoControlVo.java @@ -0,0 +1,48 @@ +package com.dkha.common.modules.vo.control; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.List; + +/** + * @version V1.0 + * @Description: + * @Title: + * @author: huangyugang + * @date: 2019/12/11 15:21 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "视频比对布控", description = "用于布控和底层传输统一参数格式") +public class VideoControlVo { + @ApiModelProperty(value = "任务名称") + private String taskName; + + @ApiModelProperty(value = "布控阈值") + @NotNull(message = "布控阀值不能为空必须是0-1之间") + @Max(value = 1,message = "布控阈值 最大值为1") + @Min(value = 0,message = "布控阈值 最小值为0") + private Double controlThreshold; + + @ApiModelProperty(value = "布控对象库ID列表") + @NotNull + @Size(min = 1) + private List libIds; + + @ApiModelProperty(value = "布控视频URL地址") + @NotNull + private String videourl; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/cut/CutVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/cut/CutVo.java new file mode 100644 index 0000000..6ee2007 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/cut/CutVo.java @@ -0,0 +1,24 @@ +package com.dkha.common.modules.vo.cut; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author Spring + * @Since 2019/12/13 16:43 + * @Description 裁剪图片 + */ +@Data +public class CutVo { + + @ApiModelProperty(value = "图片路径") + private String url; + @ApiModelProperty(value = "坐标 x") + private Integer x; + @ApiModelProperty(value = "坐标 y") + private Integer y; + @ApiModelProperty(value = "坐标 w") + private Integer w; + @ApiModelProperty(value = "坐标 h") + private Integer h; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/dto/FaceLibraryVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/dto/FaceLibraryVO.java new file mode 100644 index 0000000..caceb87 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/dto/FaceLibraryVO.java @@ -0,0 +1,39 @@ +package com.dkha.common.modules.vo.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: FaceLibraryVO + * @Package com.dkha.api.modules.vo + * @author: yangjun + * @date: 2019/12/3 15:13 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="特征库", description="特征库信息") +public class FaceLibraryVO { + @ApiModelProperty(value="库id") + private String libraryId; + @ApiModelProperty(value="库名称") + private String name; + @ApiModelProperty(value="库类型") + private String type; + @ApiModelProperty(value="额外信息") + private String extraMeta; + + @ApiModelProperty(value = "创建时间") + private Date createTime; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/dto/ImageListVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/dto/ImageListVO.java new file mode 100644 index 0000000..30dfb57 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/dto/ImageListVO.java @@ -0,0 +1,35 @@ +package com.dkha.common.modules.vo.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ImagesVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/3 15:14 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "批量图片入库接口", description = "用于图片入库接口") +public class ImageListVO { + @ApiModelProperty(value = "目标库id") + @NotNull(message = "目标库id不能为空") + private String libraryId; + + @ApiModelProperty(value = "人脸相关信息") + private List faces; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/dto/ImageVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/dto/ImageVO.java new file mode 100644 index 0000000..ff4f5a0 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/dto/ImageVO.java @@ -0,0 +1,50 @@ +package com.dkha.common.modules.vo.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ImagesVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/3 15:14 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "用于图片入库接口", description = "用于图片入库接口") +public class ImageVO { + + @ApiModelProperty(value = "需要入库的人脸地址") + @NotBlank(message = "人脸图片地址不能为空") + private String url; + + @ApiModelProperty(value = "身份证id可空") + private String idCard; + + @ApiModelProperty(value = "性别可空") + private String gender; + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "名族") + private String nation; + + @ApiModelProperty(value = "特征信息") + private String feature; + + @ApiModelProperty(value = "额外信息") + private String extraMeta; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/AlarmReturnVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/AlarmReturnVO.java new file mode 100644 index 0000000..edde3a7 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/AlarmReturnVO.java @@ -0,0 +1,72 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(预警报警返回接口) + * All rights 成都电科慧安 + * @Title: AlarmReturnVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/2 11:16 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="预警报警接口返回给业务层的数据", description="预警报警接口返回给业务层的数据") +public class AlarmReturnVO { + + + @ApiModelProperty(value = "任务id") + private String taskId; + + @ApiModelProperty(value = "摄像头id") + private String cameraId; + + @ApiModelProperty(value = "摄像头名称") + private String cameraName; + + @ApiModelProperty(value = "任务名称") + private String taskName; + + + @ApiModelProperty(value = "任务处置类型") + private String taskType; + + @ApiModelProperty(value = "背景图片") + private String faceBgUrl; + @ApiModelProperty(value = "背景高度") + private Integer bgHeight; + @ApiModelProperty(value = "背景宽度") + private Integer bgWidth; + + @ApiModelProperty(value = "报警唯一id") + private String alarmId; + + @ApiModelProperty(value="抓拍时间") + private Long timestamp; + + @ApiModelProperty(value="抓拍时间") + private String date; + + + @ApiModelProperty(value = "人脸比中信息") + private List faces; + + @ApiModelProperty(value = "今日数量") + private long toDaySnapShot; + @ApiModelProperty(value = "总数") + private long totalSnapShot; + + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiAlarmVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiAlarmVO.java new file mode 100644 index 0000000..3bbf840 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiAlarmVO.java @@ -0,0 +1,50 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiAlarmVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/11/29 16:00 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="预警任务参数", description="业务层调用返回的数据") +public class ApiAlarmVO { + + + @ApiModelProperty(value="任务id") + private String taskId; + + @ApiModelProperty(value="任务id列表") + private List taskIds; + + @ApiModelProperty(value = "摄像头列表") + private List cameraIds; + + @ApiModelProperty(value = "查询参数筛选") + private PageVO page; + + @ApiModelProperty(value = "摄像头id仅用于卡口类型业务") + private String cameraId; + + @ApiModelProperty(value = "任务类别:0 报警任务,1是视频任务") + private Integer taskType; + + @ApiModelProperty(value = "任务类别:0 报警任务,1是视频任务") + private String token; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchFaceVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchFaceVO.java new file mode 100644 index 0000000..ba096bb --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchFaceVO.java @@ -0,0 +1,29 @@ +package com.dkha.common.modules.vo.face; + + +import com.dkha.common.modules.vo.position.PositionVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiFaceOneSearchFaceVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/9 11:38 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "人脸库1:1比对返回", description = "人脸检索") +public class ApiFaceOneSearchFaceVO { + private PositionVO faceRect; + private String url; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchReturnFaceVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchReturnFaceVO.java new file mode 100644 index 0000000..86e245a --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchReturnFaceVO.java @@ -0,0 +1,32 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiFaceOneSearchReturnFaceVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/9 11:42 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "人脸库1:1比对返回", description = "人脸检索") +public class ApiFaceOneSearchReturnFaceVO { + + private Double hitSimilarity; + private List faces; + + private String extraMeta; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearGroupReturnVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearGroupReturnVO.java new file mode 100644 index 0000000..8cf3835 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearGroupReturnVO.java @@ -0,0 +1,30 @@ +package com.dkha.common.modules.vo.face; + + +import com.dkha.common.modules.vo.position.PositionVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiFaceSearGroupReturnVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/9 13:00 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "人脸分组检索返回数据", description = "人脸分组检索返回数据") +public class ApiFaceSearGroupReturnVO { + private PositionVO faceRect; + private String url;//背景图片 + private double hitSimilarity;//命中的相似度 +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchFaceVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchFaceVO.java new file mode 100644 index 0000000..caa7246 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchFaceVO.java @@ -0,0 +1,32 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiFaceSearchFaceVo + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/9 15:03 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "人脸库检索faces返回", description = "人脸检索") +public class ApiFaceSearchFaceVO { + @ApiModelProperty(value = "比中分数") + private Double hitSimilarity; + @ApiModelProperty(value = "比中人脸的人脸id") + private String faceId; + @ApiModelProperty(value = "人脸库id") + private String libraryId; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchFacesVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchFacesVO.java new file mode 100644 index 0000000..15d047a --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchFacesVO.java @@ -0,0 +1,35 @@ +package com.dkha.common.modules.vo.face; + + +import com.dkha.common.modules.vo.position.PositionVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiFaceSearchFacesVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/9 10:32 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "人脸库检索faces返回", description = "人脸检索") +public class ApiFaceSearchFacesVO { + + private String url; + private PositionVO faceRect; + @ApiModelProperty(value = "当前库检索结果") + private List faceList; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchReturnVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchReturnVO.java new file mode 100644 index 0000000..ba4c5c5 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchReturnVO.java @@ -0,0 +1,30 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiFaceSearchReturnVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/6 18:34 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "人脸库检索返回", description = "人脸检索") +public class ApiFaceSearchReturnVO { + private List faces; + private PageVO pageVO; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchVO.java new file mode 100644 index 0000000..6159b2e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceSearchVO.java @@ -0,0 +1,36 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiFaceSearcVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/6 18:28 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸检索类", description="人脸检索类") +public class ApiFaceSearchVO { + @ApiModelProperty(value = "人脸url列表") + private String url; + @ApiModelProperty(value = "人脸库列表") + private List libraryIds; + @ApiModelProperty(value = "每个库最大返回结果数, 0~100") + private Double minScore; + @ApiModelProperty(value = "分页数据") + private PageVO pageVO; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceVO.java new file mode 100644 index 0000000..0b85bc6 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceVO.java @@ -0,0 +1,40 @@ +package com.dkha.common.modules.vo.face; + + +import com.dkha.common.modules.vo.position.PositionVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(用于接口返回实体) + * All rights 成都电科慧安 + * @Title: FaceVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/2 14:11 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +//@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="预警报警组装给业务层的数据实体类", description="预警报警组装给业务层的数据实体类") +public class ApiFaceVO { + + @ApiModelProperty(value="人脸坐标") + private PositionVO faceRect; + + @ApiModelProperty(value="人脸比中信息") + private List compare; + + @ApiModelProperty(value="特征") + private FeatureVO feature; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiSearchFaceRectVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiSearchFaceRectVO.java new file mode 100644 index 0000000..6695be4 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiSearchFaceRectVO.java @@ -0,0 +1,29 @@ +package com.dkha.common.modules.vo.face; + + +import com.dkha.common.modules.vo.position.PositionVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiSearchFaceRectVo + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/9 12:36 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸检测返回人脸信息", description="人脸检测返回人脸信息") +public class ApiSearchFaceRectVO { + private PositionVO faceRect; + private String url; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ComparisonVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ComparisonVO.java new file mode 100644 index 0000000..be45f2d --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ComparisonVO.java @@ -0,0 +1,34 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ComparisonVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/2 14:42 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +//@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="比中人脸信息", description="比中人脸信息") +public class ComparisonVO { + @ApiModelProperty(value="比中库id") + private String libraryId; + + @ApiModelProperty(value="比中库中的人脸id") + private String comparisonFaceId; + + @ApiModelProperty(value="比中分值") + private Double hitSimilarity; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ControlTaskVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ControlTaskVO.java new file mode 100644 index 0000000..8b871f1 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ControlTaskVO.java @@ -0,0 +1,46 @@ +package com.dkha.common.modules.vo.face; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + *

+ * 布控表 + *

+ * + * @author Spring + * @since 2019-11-20 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) + +public class ControlTaskVO extends GovShortBaseEntity{ + + private static final long serialVersionUID = 1L; + private String idControlTask; + @ApiModelProperty(value = "布控阈值") + private Double threshold; + @ApiModelProperty(value = "布控名称") + private String name; + + @ApiModelProperty(value = "额外信息") + private String extraMeta; + + @TableField(exist = false) + @ApiModelProperty(value = "摄像头id") + private List cameraId; + + @TableField(exist = false) + @ApiModelProperty(value = "库id") + private List libraryId; + + @ApiModelProperty(value = "任务id") + private String taskId; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/EsReturnVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/EsReturnVO.java new file mode 100644 index 0000000..15d17b8 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/EsReturnVO.java @@ -0,0 +1,34 @@ +package com.dkha.common.modules.vo.face; + + +import com.dkha.common.modules.vo.warning.WarningVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ESReturnVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/11/29 18:30 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="查询es返回数据的实体类", description="业务层调用返回的数据") +public class EsReturnVO { + + @ApiModelProperty(value="警报数据") + private WarningVO content; + + @ApiModelProperty(value="总数") + private Long totalElements; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/FaceBayonetVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/FaceBayonetVO.java new file mode 100644 index 0000000..85411d5 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/FaceBayonetVO.java @@ -0,0 +1,46 @@ +package com.dkha.common.modules.vo.face; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: FaceBayonetVO + * @Package com.dkha.api.modules.vo + * @author: yangjun + * @date: 2019/12/5 17:57 + * @Copyright: 成都电科慧安 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="FaceBayonet对象", description="摄像头表") +public class FaceBayonetVO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + private String carmeraId; + + @ApiModelProperty(value = "摄像头名称") + private String name; + + @ApiModelProperty(value = "摄像头地址") + private String url; + + @ApiModelProperty(value = "摄像头类型") + private String type; + + @ApiModelProperty(value = "额外信息") + private String extraMeta; + + @ApiModelProperty(value = "创建时间") + private Date createTime; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/FaceLibraryVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/FaceLibraryVO.java new file mode 100644 index 0000000..b02af9a --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/FaceLibraryVO.java @@ -0,0 +1,39 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: FaceLibraryVO + * @Package com.dkha.api.modules.vo + * @author: yangjun + * @date: 2019/12/3 15:13 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="特征库", description="特征库信息") +public class FaceLibraryVO { + @ApiModelProperty(value="库id") + private String libraryId; + @ApiModelProperty(value="库名称") + private String name; + @ApiModelProperty(value="库类型") + private String type; + @ApiModelProperty(value="额外信息") + private String extraMeta; + + @ApiModelProperty(value = "创建时间") + private Date createTime; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/FaceTrackVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/FaceTrackVO.java new file mode 100644 index 0000000..564a4f3 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/FaceTrackVO.java @@ -0,0 +1,46 @@ +package com.dkha.common.modules.vo.face; + + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class FaceTrackVO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 图片url + */ + private String url; + /** + * 人像id + */ + private String faceId; + /** + * 摄像头id + */ + private Long idFaceCamera; + /** + * 库id + */ + private String startTime; + /** + * 人物数据 + */ + private String endTime; + + /** + * 轨迹判定阈值 + */ + private Double trajectoryThreshold; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/FeatureVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/FeatureVO.java new file mode 100644 index 0000000..e7d30b5 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/FeatureVO.java @@ -0,0 +1,31 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: FeatureVO + * @Package com.dkha.common.entity.vo.position + * @author: panhui + * @date: 2019/12/13 14:42 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="特征类", description="人脸特征类") +public class FeatureVO { + + @ApiModelProperty(value = "人脸检查后年龄") + private Integer age; + @ApiModelProperty(value = "人脸检查后性别") + private String gender ; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/GovShortBaseEntity.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/GovShortBaseEntity.java new file mode 100644 index 0000000..bf99bff --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/GovShortBaseEntity.java @@ -0,0 +1,44 @@ +package com.dkha.common.modules.vo.face; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @ClassName: + * @Description:(please write your description) + * @author: {yangjun} + * @date: + * @Copyright: 成都电科惠安 + */ +@Data +public class GovShortBaseEntity implements Serializable { + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "是否有效 Y有效 N无效 作逻辑删除使用") + private String isValid; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "创建人") + private String createBy; + + @TableField(fill = FieldFill.INSERT_UPDATE) + @ApiModelProperty(value = "更新人") + private String updateBy; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + private Date updateTime; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/HitConditionVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/HitConditionVO.java new file mode 100644 index 0000000..8809bce --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/HitConditionVO.java @@ -0,0 +1,41 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(预警任务中过滤参数) + * All rights 成都电科慧安 + * @Title: HitConditionVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/11/29 17:08 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="预警任务中过滤参数", description="业务层调用返回的数据") +public class HitConditionVO { + + @ApiModelProperty(value = "当前页") + private Integer pageNo; + + @ApiModelProperty(value = "每页条数") + private Integer pageSize; + + @ApiModelProperty(value = "开始时间戳") + private Long startTimestamp; + + @ApiModelProperty(value = "结束时间戳") + private Long stopTimestamp; + + @ApiModelProperty(value = "排序时间戳默认DESC传递ASC") + private String order; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ImageListVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ImageListVO.java new file mode 100644 index 0000000..6c3293e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ImageListVO.java @@ -0,0 +1,35 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ImagesVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/3 15:14 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "批量图片入库接口", description = "用于图片入库接口") +public class ImageListVO { + @ApiModelProperty(value = "目标库id") + @NotNull(message = "目标库id不能为空") + private String libraryId; + + @ApiModelProperty(value = "人脸相关信息") + private List faces; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ImageReturnVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ImageReturnVO.java new file mode 100644 index 0000000..8f6cfb2 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ImageReturnVO.java @@ -0,0 +1,50 @@ +package com.dkha.common.modules.vo.face; + + +import com.dkha.common.modules.vo.position.PositionVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ImageReturnVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/3 18:28 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "用于图片入库返回参数", description = "用于图片入库返回参数") +public class ImageReturnVO { + @ApiModelProperty(value = "成功的人脸id") + private String faceId; + @ApiModelProperty(value = "人脸库id") + private String libraryId; + @ApiModelProperty(value = "人脸id") + private String idFaceid; + @ApiModelProperty(value = "人脸坐标") + private PositionVO faceRect; + @ApiModelProperty(value = "传递的人脸信息") + private ImagesVO face; + + public ImageReturnVO(String faceId, String libraryId,String idFaceid, PositionVO faceRect, ImagesVO face) + { + this.faceId=faceId; + this.libraryId=libraryId; + this.idFaceid=idFaceid; + this.faceRect=faceRect; + this.face=face; + } + + @ApiModelProperty(value = "批量导入是否导入成功") + private Boolean isSuccess; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ImageVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ImageVO.java new file mode 100644 index 0000000..c46c31e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ImageVO.java @@ -0,0 +1,50 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ImagesVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/3 15:14 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "用于图片入库接口", description = "用于图片入库接口") +public class ImageVO { + + @ApiModelProperty(value = "需要入库的人脸地址") + @NotBlank(message = "人脸图片地址不能为空") + private String url; + + @ApiModelProperty(value = "身份证id可空") + private String idCard; + + @ApiModelProperty(value = "性别可空") + private String gender; + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "名族") + private String nation; + + @ApiModelProperty(value = "特征信息") + private String feature; + + @ApiModelProperty(value = "额外信息") + private String extraMeta; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ImagesVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ImagesVO.java new file mode 100644 index 0000000..463c0ef --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ImagesVO.java @@ -0,0 +1,65 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.util.Date; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ImagesVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/3 15:14 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "用于图片入库接口", description = "用于图片入库接口") +public class ImagesVO { + @ApiModelProperty(value = "目标库id") + @NotBlank(message = "目标库id不能为空") + private String libraryId; + + @ApiModelProperty(value = "需要入库的人脸地址") + @NotBlank(message = "人脸图片地址不能为空") + private String url; + + @ApiModelProperty(value = "人脸id") + private String faceId; + + @ApiModelProperty(value = "身份证id可空") + private String idCard; + + @ApiModelProperty(value = "性别可空") + private String gender; + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "名族") + private String nation; + + @ApiModelProperty(value = "特征信息") + private String feature; + + @ApiModelProperty(value = "额外信息") + private String extraMeta; + + @ApiModelProperty(value = "入库后人脸的URL") + private String faceUrl; + + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/PagePortraitVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/PagePortraitVO.java new file mode 100644 index 0000000..296e5db --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/PagePortraitVO.java @@ -0,0 +1,31 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: PagePortraitVO + * @Package com.dkha.api.modules.vo + * @author: panhui + * @date: 2019/12/5 10:06 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸列表参数接收类", description="人脸列表参数接收类") +public class PagePortraitVO { + private String libraryId; + /**摄像头类型*/ + private String type; + /**库名称*/ + private String factoryName; + private PageVO page; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/PageVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/PageVO.java new file mode 100644 index 0000000..51e0826 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/PageVO.java @@ -0,0 +1,44 @@ +package com.dkha.common.modules.vo.face; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: PageVO + * @Package com.dkha.api.modules + * @author: panhui + * @date: 2019/12/5 10:13 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="用于列表查询后续的分页", description="用于列表查询后续的分页") +public class PageVO { + + @ApiModelProperty(value = "排序 默认按时间DESC ASC") + private String order="DESC"; + + @ApiModelProperty(value = "开始时间戳") + private Long startTimestamp; + + @ApiModelProperty(value = "结束时间戳") + private Long stopTimestamp; + + @ApiModelProperty(value = "当前页") + private Integer pageNo=1; + + @ApiModelProperty(value = "每页条数") + private Integer pageSize=10; + + @ApiModelProperty(value = "总数") + private Long total; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareListVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareListVO.java new file mode 100644 index 0000000..6244bb3 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareListVO.java @@ -0,0 +1,33 @@ +package com.dkha.common.modules.vo.facelib; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: 比中返回结果 + * All rights 成都电科慧安 + * @Title: CompareList + * @Package com.dkha.common.entity.vo.facelib + * @author: panhui + * @date: 2019/11/27 15:20 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="比中结果通用", description="用于和底层传输统一参数格式") +public class CompareListVO { + @ApiModelProperty(value = "比中库里面的人脸id") + private String comparisonFaceId; + + @ApiModelProperty(value = "库id") + private String libId; + @ApiModelProperty(value = "比分") + private Double score; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareRequestVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareRequestVo.java new file mode 100644 index 0000000..b7d5e94 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareRequestVo.java @@ -0,0 +1,21 @@ +package com.dkha.common.modules.vo.facelib; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @Author Spring + * @Since 2019/12/11 16:32 + * @Description 分组请求vo + */ +@Data +public class CompareRequestVo { + + @ApiModelProperty(value = "需要分组的url集合") + private List urlList; + + @ApiModelProperty(value = "阀值") + private Double minScore; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareResultDetailVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareResultDetailVo.java new file mode 100644 index 0000000..67abf5d --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareResultDetailVo.java @@ -0,0 +1,19 @@ +package com.dkha.common.modules.vo.facelib; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author Spring + * @Since 2019/12/11 16:23 + * @Description 分组比对结果详情 + */ +@Data +public class CompareResultDetailVo { + + @ApiModelProperty(value = "图片url") + private String url; + + @ApiModelProperty(value = "相似度") + private double score; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareResultSubVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareResultSubVo.java new file mode 100644 index 0000000..07d19a4 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareResultSubVo.java @@ -0,0 +1,22 @@ +package com.dkha.common.modules.vo.facelib; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author Spring + * @Since 2019/12/11 16:18 + * @Description 人脸分组结果集,子项 + */ +@Data +public class CompareResultSubVo { + + @ApiModelProperty(value = "结果url--随机获取其中一个") + private String resultUrl; + + @ApiModelProperty(value = "除结果url后,其余的url集合") + private List compareResultSubVoList = new ArrayList<>(); +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareResultVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareResultVo.java new file mode 100644 index 0000000..3297eca --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/CompareResultVo.java @@ -0,0 +1,19 @@ +package com.dkha.common.modules.vo.facelib; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author Spring + * @Since 2019/12/11 16:17 + * @Description 比较结果集合 + */ +@Data +public class CompareResultVo { + + @ApiModelProperty(value = "分组比对返回结果集") + private List compareResultSubVoList = new ArrayList<>(); +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FaceDeleteVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FaceDeleteVO.java new file mode 100644 index 0000000..97466e8 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FaceDeleteVO.java @@ -0,0 +1,32 @@ +package com.dkha.common.modules.vo.facelib; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: 人脸删除请求 + * All rights 成都电科慧安 + * @Title: FaceDeleteVO + * @Package com.dkha.common.entity.vo.facelib + * @author: yangjun + * @date: 2019/11/27 11:16 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸删除通用接口请求参数类", description="用于和底层传输统一参数格式") +public class FaceDeleteVO { + @ApiModelProperty(value = "库id") + private String libId; + @ApiModelProperty(value = "人脸id") + private List faceIds; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FaceLibaryReturnVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FaceLibaryReturnVO.java new file mode 100644 index 0000000..b405b3b --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FaceLibaryReturnVO.java @@ -0,0 +1,34 @@ +package com.dkha.common.modules.vo.facelib; + + +import com.dkha.common.modules.vo.position.FaceVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: 人脸入库返回 + * All rights 成都电科慧安 + * @Title: FaceLibaryReturnVO + * @Package com.dkha.common.entity.vo.facelib + * @author: yangjun + * @date: 2019/11/27 10:15 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸入库通用接口返回参数类", description="用于和底层传输统一参数格式") +public class FaceLibaryReturnVO { + @ApiModelProperty(value = "人脸相关信息") + private List faces; + @ApiModelProperty(value = "库id") + private String libId; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FaceLibaryVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FaceLibaryVO.java new file mode 100644 index 0000000..a8467e8 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FaceLibaryVO.java @@ -0,0 +1,34 @@ +package com.dkha.common.modules.vo.facelib; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: 人脸入库请求 + * All rights 成都电科慧安 + * @Title: FaceLibaryVO + * @Package com.dkha.common.entity.vo.facelib + * @author: yangjun + * @date: 2019/11/27 10:03 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸入库通用接口请求参数类", description="用于和底层传输统一参数格式") +public class FaceLibaryVO { + @ApiModelProperty(value = "库id") + private String libId; + @ApiModelProperty(value = "图片url") + private List imgs; + @ApiModelProperty(value = "人员信息") + private PersonalInformationVO personalInformation; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FileImageVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FileImageVo.java new file mode 100644 index 0000000..486dc82 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/FileImageVo.java @@ -0,0 +1,19 @@ +package com.dkha.common.modules.vo.facelib; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * + */ +@Data +public class FileImageVo { + + @ApiModelProperty(value = "url") + private String url; + + @ApiModelProperty(value = "url") + private List urls; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/OneToOneResultVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/OneToOneResultVo.java new file mode 100644 index 0000000..e816a2e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/OneToOneResultVo.java @@ -0,0 +1,22 @@ +package com.dkha.common.modules.vo.facelib; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author Spring + * @Since 2019/12/11 17:37 + * @Description 一比一比对返回结果集 + */ +@Data +public class OneToOneResultVo { + + @ApiModelProperty(value = "url集合") + private List urls = new ArrayList<>(); + + @ApiModelProperty(value = "分数") + private double score; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/OnecompareOneVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/OnecompareOneVO.java new file mode 100644 index 0000000..935907b --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/OnecompareOneVO.java @@ -0,0 +1,34 @@ +package com.dkha.common.modules.vo.facelib; + + +import com.dkha.common.modules.vo.search.FaceCompareVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: OnecompareOneVO + * @Package com.dkha.common.entity.vo.facelib + * @author: yangjun + * @date: 2019/12/6 16:17 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="比中结果", description="用于和底层传输统一参数格式") +public class OnecompareOneVO { + @ApiModelProperty(value = "相似度") + private Double hitSimilarity; + private List faces; + +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/facelib/PersonalInformationVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/PersonalInformationVO.java new file mode 100644 index 0000000..033b6a2 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/facelib/PersonalInformationVO.java @@ -0,0 +1,37 @@ +package com.dkha.common.modules.vo.facelib; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: 人员信息(年龄** 性别 ** 身份证** 特征) + * All rights 成都电科慧安 + * @Title: PersonalInformationVO + * @Package com.dkha.common.entity.vo.facelib + * @author: yangjun + * @date: 2019/11/27 10:09 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人员信息通用接口参数类", description="用于和底层传输统一参数格式") +public class PersonalInformationVO { + @ApiModelProperty(value = "姓名") + private String name; + @ApiModelProperty(value = "年龄") + private String age; + @ApiModelProperty(value = "性别") + private String sex; + @ApiModelProperty(value = "身份证号码") + private String idCard; + @ApiModelProperty(value = "特征") + private String feature; + +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/libary/FaceLibraryVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/libary/FaceLibraryVO.java new file mode 100644 index 0000000..5c015bf --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/libary/FaceLibraryVO.java @@ -0,0 +1,39 @@ +package com.dkha.common.modules.vo.libary; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: FaceLibraryVO + * @Package com.dkha.api.modules.vo + * @author: yangjun + * @date: 2019/12/3 15:13 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="特征库", description="特征库信息") +public class FaceLibraryVO { + @ApiModelProperty(value="库id") + private String libraryId; + @ApiModelProperty(value="库名称") + private String name; + @ApiModelProperty(value="库类型") + private String type; + @ApiModelProperty(value="额外信息") + private String extraMeta; + + @ApiModelProperty(value = "创建时间") + private Date createTime; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/libary/LibaryVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/libary/LibaryVO.java new file mode 100644 index 0000000..67a7093 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/libary/LibaryVO.java @@ -0,0 +1,31 @@ +package com.dkha.common.modules.vo.libary; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: 库新增 + * All rights 成都电科慧安 + * @Title: LibaryVO + * @Package com.dkha.common.entity.vo.libary + * @author: yangjun + * @date: 2019/11/27 9:59 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="库通用接口参数类", description="用于和底层传输统一参数格式") +public class LibaryVO { + @ApiModelProperty(value = "库id列表") + private List libIds; + +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/FScoreCompVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/FScoreCompVO.java new file mode 100644 index 0000000..5fb5f24 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/FScoreCompVO.java @@ -0,0 +1,14 @@ +package com.dkha.common.modules.vo.position; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class FScoreCompVO { + private String faceId; + private String comparisonFaceId; + private Double score; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/FaceCompareVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/FaceCompareVO.java new file mode 100644 index 0000000..d803756 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/FaceCompareVO.java @@ -0,0 +1,36 @@ +package com.dkha.common.modules.vo.position; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: + * All rights 成都电科慧安 + * @Title: faceVO + * @Package com.dkha.common.entity.vo.face + * @author: panhui + * @date: 2019/11/27 10:36 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸和坐标相关类", description="人脸和坐标相关类") +public class FaceCompareVO { + + @ApiModelProperty(value = "背景图片") + private String url; + @ApiModelProperty(value = "人脸id") + private String faceId; + @ApiModelProperty(value = "坐标") + private PositionVO position; + @ApiModelProperty(value = "额外信息") + private Object extraMeta; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/FaceVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/FaceVO.java new file mode 100644 index 0000000..145b14b --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/FaceVO.java @@ -0,0 +1,40 @@ +package com.dkha.common.modules.vo.position; + + +import com.dkha.common.modules.vo.facelib.CompareListVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: + * All rights 成都电科慧安 + * @Title: faceVO + * @Package com.dkha.common.entity.vo.face + * @author: panhui + * @date: 2019/11/27 10:36 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸和坐标相关类", description="人脸和坐标相关类") +public class FaceVO { + + @ApiModelProperty(value = "背景图片") + private String bgImg; + @ApiModelProperty(value = "人脸id") + private String faceId; + @ApiModelProperty(value = "坐标") + private PositionVO position; + @ApiModelProperty(value = "人脸比中结果集 注:人脸入库不需要返回此字段") + private List compareList; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupInfoVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupInfoVO.java new file mode 100644 index 0000000..8ada990 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupInfoVO.java @@ -0,0 +1,21 @@ +package com.dkha.common.modules.vo.position; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class GroupInfoVO { + + private String head;//头像id + private String headUrl;//头像图片地址 + private String bgpic;//背景图片 + private Integer x;//x坐标 + private Integer y;//y坐标 + private Integer width;//长 + private Integer height;//宽 + + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupPositionVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupPositionVO.java new file mode 100644 index 0000000..4e7f392 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupPositionVO.java @@ -0,0 +1,37 @@ +package com.dkha.common.modules.vo.position; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * @version V1.0 + * @Description: 人脸坐标位置 + * All rights 成都电科慧安 + * @Title: PositionVO + * @Package com.dkha.common.entity.vo.face + * @author: panhui + * @date: 2019/11/27 10:36 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="坐标类", description="人脸坐标") +public class GroupPositionVO { + @ApiModelProperty(value = "人脸对应的id") + private String faceId; + private Integer x; + private Integer y; + private Integer w; + private Integer h; + private String headUrl;//头像图片地址 + private String bgUrl;//背景图片 + private double hitSimilarity;//命中的相似度 + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupRelation.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupRelation.java new file mode 100644 index 0000000..37a9b49 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupRelation.java @@ -0,0 +1,26 @@ +package com.dkha.common.modules.vo.position; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 做分组后的关联id + * All rights 成都电科慧安 + * @ClassName: GroupRelation + * @Description:TODO(please write your description) + * @author: dkha{panhui} + * @date: 2019年10月25日 下午6:27:50 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class GroupRelation { + + private String headId;//关联id + private List groupInfoVO;//关联数据 + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupVO.java new file mode 100644 index 0000000..c1a99b8 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/GroupVO.java @@ -0,0 +1,36 @@ +package com.dkha.common.modules.vo.position; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: GroupVO + * @Package com.dkha.common.entity.vo.position + * @author: yangjun + * @date: 2019/12/2 15:32 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸分组相关类", description="人脸和坐标相关类") +public class GroupVO { + @ApiModelProperty(value = "人脸对id") + private Map faceId; + @ApiModelProperty(value = "人脸对应的坐标") + private List faceIds; + @ApiModelProperty(value = "人脸比对结果") + private List fScoreComp; + +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/Imginfo.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/Imginfo.java new file mode 100644 index 0000000..7609589 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/Imginfo.java @@ -0,0 +1,17 @@ +package com.dkha.common.modules.vo.position; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class Imginfo { + + private List faceIds; + private Integer reSizeH; + private Integer reSizeW; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/PortraitListVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/PortraitListVo.java new file mode 100644 index 0000000..b81aa6c --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/PortraitListVo.java @@ -0,0 +1,28 @@ +package com.dkha.common.modules.vo.position; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: PortraitListVo + * @Package com.dkha.server.modules.vo.position + * @author: yangjun + * @date: 2019/12/10 17:16 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人像id列表", description="人脸坐标") +public class PortraitListVo { + private List idPortrait; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/position/PositionVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/position/PositionVO.java new file mode 100644 index 0000000..ba39b00 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/position/PositionVO.java @@ -0,0 +1,38 @@ +package com.dkha.common.modules.vo.position; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: 人脸坐标位置 + * All rights 成都电科慧安 + * @Title: PositionVO + * @Package com.dkha.common.entity.vo.face + * @author: panhui + * @date: 2019/11/27 10:36 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="坐标类", description="人脸坐标") +public class PositionVO { + private Integer x; + private Integer y; + private Integer w; + private Integer h; + public PositionVO(Integer x,Integer y,Integer w,Integer h) + { + this.x=x; + this.y=y; + this.w=w; + this.h=h; + } + private Integer bgWidth; + private Integer bgHeight; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/search/FaceCheckVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/search/FaceCheckVO.java new file mode 100644 index 0000000..b1aa01a --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/search/FaceCheckVO.java @@ -0,0 +1,34 @@ +package com.dkha.common.modules.vo.search; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: 人脸库检查/人脸分组参数 + * All rights 成都电科慧安 + * @Title: FaceSearchVO + * @Package com.dkha.common.entity.vo.search + * @author: yangjun + * @date: 2019/11/27 10:40 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸库检测通用接口参数类", description="用于和底层传输统一参数格式") +public class FaceCheckVO { + @ApiModelProperty(value = "人脸url列表") + private List imgs; + @ApiModelProperty(value = "每个库最大返回结果数, 0~100") + private Double minScore; + @ApiModelProperty(value = "每个库最大返回结果数, 0~100") + private Integer maxRetNb; +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/search/FaceCompareVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/search/FaceCompareVO.java new file mode 100644 index 0000000..eb62468 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/search/FaceCompareVO.java @@ -0,0 +1,33 @@ +package com.dkha.common.modules.vo.search; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: 人脸库检查/人脸分组参数 + * All rights 成都电科慧安 + * @Title: FaceSearchVO + * @Package com.dkha.common.entity.vo.search + * @author: yangjun + * @date: 2019/11/27 10:40 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸库检测通用接口参数类", description="用于和底层传输统一参数格式") +public class FaceCompareVO { + @ApiModelProperty(value = "人脸图片1") + private String image1; + @ApiModelProperty(value = "人脸图片2") + private String image2; + @ApiModelProperty(value = "拓展字段") + private String extraMeta; + +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/search/FaceSearchVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/search/FaceSearchVO.java new file mode 100644 index 0000000..726f5f0 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/search/FaceSearchVO.java @@ -0,0 +1,37 @@ +package com.dkha.common.modules.vo.search; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: 人脸库检索参数 + * All rights 成都电科慧安 + * @Title: FaceSearchVO + * @Package com.dkha.common.entity.vo.search + * @author: yangjun + * @date: 2019/11/27 10:40 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="人脸库检索通用接口参数类", description="用于和底层传输统一参数格式") +public class FaceSearchVO { + @ApiModelProperty(value = "人脸url列表") + private List imgs; + @ApiModelProperty(value = "人脸库列表") + private List libIds; + @ApiModelProperty(value = "每个库最大返回结果数, 0~100") + private Double minScore; + @ApiModelProperty(value = "每个库最大返回结果数, 0~100") + private Integer maxRetNb; + +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchFutureVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchFutureVo.java new file mode 100644 index 0000000..737236e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchFutureVo.java @@ -0,0 +1,21 @@ +package com.dkha.common.modules.vo.search; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @Author Spring + * @Since 2019/12/10 16:16 + * @Description 查询结果特征Id集合 + */ +@Data +public class SearchFutureVo { + + @ApiModelProperty(value = "库Id") + private String libId; + + @ApiModelProperty(value = "搜索结果人脸Id集合") + private List faceIdLIst; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchPortraitVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchPortraitVo.java new file mode 100644 index 0000000..c1d07d8 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchPortraitVo.java @@ -0,0 +1,42 @@ +package com.dkha.common.modules.vo.search; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author Spring + * @Since 2019/12/10 15:07 + * @Description 人脸库检索返回数据 + */ +@Data +public class SearchPortraitVo implements Comparable{ + + @ApiModelProperty(value = "人脸Id") + private String idPortrait; + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "性别") + private String sex; + + @ApiModelProperty(value = "身份证号码") + private String idCard; + + @ApiModelProperty(value = "相似度") + private Double similarityDegree = new Double(0L); + + @ApiModelProperty(value = "库Id") + private String idLibrary; + + @ApiModelProperty(value = "库名称/来源") + private String libraryName; + + @ApiModelProperty(value = "人脸图片") + private String url; + + @Override + public int compareTo(SearchPortraitVo o) { + return o.getSimilarityDegree().compareTo(this.getSimilarityDegree()); + } +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchRequestVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchRequestVo.java new file mode 100644 index 0000000..d21339f --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchRequestVo.java @@ -0,0 +1,39 @@ +package com.dkha.common.modules.vo.search; + +import com.dkha.common.page.PageParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * @Author Spring + * @Since 2019/12/10 15:33 + * @Description 人脸库检索请求Vo + */ +@Data +public class SearchRequestVo { + + @ApiModelProperty(value = "人像库Id") + private List libIdList; + + @ApiModelProperty(value = "人脸图像请求集合") + private List faceImageRequestList; + + @ApiModelProperty(value = "人脸ID,分数集合,及其对应分数--由sdk返回") + private Map faceApiResultMap; + + @ApiModelProperty(value = "姓名/身份证号码") + private String search; + + @ApiModelProperty(value = "性别 0男 1女") + private String sex; + + @ApiModelProperty(value = "阀值") + private String minScore; + + @ApiModelProperty(value = "分页相关参数") + private PageParam pageParam; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchResultVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchResultVo.java new file mode 100644 index 0000000..6823b7f --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/search/SearchResultVo.java @@ -0,0 +1,34 @@ +package com.dkha.common.modules.vo.search; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author Spring + * @Since 2019/12/10 16:12 + * @Description 库搜索返回结果集 + */ +@Data +public class SearchResultVo { + + @ApiModelProperty(value = "人脸ID,分数集合,及其对应分数--由sdk返回") + private Map faceApiResultMap = new HashMap<>(); + + @ApiModelProperty(value = "人脸图像请求集合") + private List faceImageRequestList = new ArrayList<>(); + + @ApiModelProperty(value = "人脸检索分页返回数据集合") + private Page resultPage; + + @ApiModelProperty(value = "请求对应search参数") + private String requestSearch; + + @ApiModelProperty(value = "请求对应库Id集合") + private List requestLibIdList = new ArrayList<>(); +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/upload/ImageUploadResult.java b/face-common/src/main/java/com/dkha/common/modules/vo/upload/ImageUploadResult.java new file mode 100644 index 0000000..5dc48fd --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/upload/ImageUploadResult.java @@ -0,0 +1,24 @@ +package com.dkha.common.modules.vo.upload; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @Author Spring + * @Since 2019/12/11 15:34 + * @Description 图片上传结果集合 + */ +@Data +public class ImageUploadResult { + + @ApiModelProperty(value = "上传成功后对应url集合") + private List successFileUrlList; + @ApiModelProperty(value = "总的文件数") + private int totalFiles; + @ApiModelProperty(value = "失败文件数") + private int failFiles; + @ApiModelProperty(value = "成功文件数") + private int successFiles; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/BayoneReturnListVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/BayoneReturnListVO.java new file mode 100644 index 0000000..24e56b0 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/BayoneReturnListVO.java @@ -0,0 +1,37 @@ +package com.dkha.common.modules.vo.warning; + +import com.dkha.common.modules.vo.face.AlarmReturnVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: BayoneReturnListVO + * @Package com.dkha.common.modules.vo.warning + * @author: panhui + * @date: 2020/1/6 16:55 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="卡口抓拍返回list数据", description="卡口抓拍返回list数据") +public class BayoneReturnListVO { + @ApiModelProperty(value = "人脸信息") + private List result; + + @ApiModelProperty(value = "今日抓拍数量") + private long toDaySnapShot; + + @ApiModelProperty(value = "累计抓拍") + private long totalSnapShot; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/BayonetReturnVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/BayonetReturnVO.java new file mode 100644 index 0000000..a22bf26 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/BayonetReturnVO.java @@ -0,0 +1,37 @@ +package com.dkha.common.modules.vo.warning; + +import com.dkha.common.modules.vo.face.AlarmReturnVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: BayonetReturnVO + * @Package com.dkha.server.modules.vo.warning + * @author: panhui + * @date: 2019/12/10 16:29 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="卡口返回数据", description="卡口返回数据") +public class BayonetReturnVO { + + @ApiModelProperty(value = "人脸信息") + private AlarmReturnVO result; + + @ApiModelProperty(value = "今日抓拍数量") + private Long toDaySnapShot; + + @ApiModelProperty(value = "累计抓拍") + private Long totalSnapShot; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/BgImageSize.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/BgImageSize.java new file mode 100644 index 0000000..8435754 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/BgImageSize.java @@ -0,0 +1,27 @@ +package com.dkha.common.modules.vo.warning; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: BgImageSize + * @Package com.dkha.common.modules.vo.warning + * @author: panhui + * @date: 2020/1/8 9:14 + * @Copyright: 成都电科慧安 + */ + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BgImageSize implements Serializable { + private String cameraId; + private Integer bgWidth; + private Integer bgHeight; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/CameraVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/CameraVO.java new file mode 100644 index 0000000..fc3c59e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/CameraVO.java @@ -0,0 +1,62 @@ +package com.dkha.common.modules.vo.warning; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: CameraVO + * @Package com.dkha.common.modules.vo.warning + * @author: panhui + * @date: 2020/1/9 15:51 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="摄像头数据", description="摄像头数据") +public class CameraVO { + /** + * 主键id + * 分布式全局唯一ID 长整型类型 + */ + @ApiModelProperty(value = "摄像头id") + private Long idFaceCamera; + /** + * 摄像头名称 + */ + @ApiModelProperty(value = "摄像头名称") + private String cameraName; + + /** + * 摄像头详细地址 + */ + @ApiModelProperty(value = "摄像头详细地址") + private String cameraAddress; + /** + * 摄像头经度 + */ + @ApiModelProperty(value = "摄像头经度") + public static final String CAMERA_LONGITUDE="camera_longitude"; + private String cameraLongitude; + /** + * 摄像头纬度 + */ + @ApiModelProperty(value = "摄像头纬度") + public static final String CAMERA_LATITUDE="camera_latitude"; + private String cameraLatitude; + /** + * 是否运行 Y启动 N未启动 + */ + @ApiModelProperty(value = "是否运行,Y启动 N未启动") + private String status; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/CameraWarningVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/CameraWarningVO.java new file mode 100644 index 0000000..d9d98cb --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/CameraWarningVO.java @@ -0,0 +1,27 @@ +package com.dkha.common.modules.vo.warning; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: CameraWarningVO + * @Package com.dkha.common.modules.vo.warning + * @author: panhui + * @date: 2020/1/9 15:47 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +@ApiModel(value="地图模式中摄像头和预警信息", description="地图模式中摄像头和预警信息") +public class CameraWarningVO { + + private WarningPageVO warning; + private CameraVO camera; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/FScoreCompVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/FScoreCompVO.java new file mode 100644 index 0000000..55ead41 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/FScoreCompVO.java @@ -0,0 +1,14 @@ +package com.dkha.common.modules.vo.warning; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class FScoreCompVO { + private String feat1; + private String feat2; + private Double score; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/GroupInfoVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/GroupInfoVO.java new file mode 100644 index 0000000..26c8927 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/GroupInfoVO.java @@ -0,0 +1,21 @@ +package com.dkha.common.modules.vo.warning; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class GroupInfoVO { + + private String head;//头像id + private String headUrl;//头像图片地址 + private String bgpic;//背景图片 + private Integer x;//x坐标 + private Integer y;//y坐标 + private Integer width;//长 + private Integer height;//宽 + + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/GroupRelation.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/GroupRelation.java new file mode 100644 index 0000000..77802e8 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/GroupRelation.java @@ -0,0 +1,25 @@ +package com.dkha.common.modules.vo.warning; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 做分组后的关联id + * All rights 成都电科慧安 + * @ClassName: GroupRelation + * @Description:TODO(please write your description) + * @author: dkha{panhui} + * @date: 2019年10月25日 下午6:27:50 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class GroupRelation { + + private String headId;//关联id + private List groupInfoVO;//关联数据 +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/GroupVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/GroupVO.java new file mode 100644 index 0000000..3a2b104 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/GroupVO.java @@ -0,0 +1,19 @@ +package com.dkha.common.modules.vo.warning; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class GroupVO { + private HeadVo head; + private Map faceIds; + private Map position; + private List fScoreComp; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/HeadVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/HeadVo.java new file mode 100644 index 0000000..b047cc8 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/HeadVo.java @@ -0,0 +1,18 @@ +package com.dkha.common.modules.vo.warning; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class HeadVo { + + private String protId; + private Integer wappId; + private Integer serId; + private Integer ret; + private String errInfo; + private String version; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/Imginfo.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/Imginfo.java new file mode 100644 index 0000000..a5b60f9 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/Imginfo.java @@ -0,0 +1,17 @@ +package com.dkha.common.modules.vo.warning; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class Imginfo { + + private List faceIds; + private Integer reSizeH; + private Integer reSizeW; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/P5sVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/P5sVO.java new file mode 100644 index 0000000..8494fda --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/P5sVO.java @@ -0,0 +1,19 @@ +package com.dkha.common.modules.vo.warning; + +public class P5sVO { + + private Integer x1; + private Integer y1; + + private Integer x2; + private Integer y2; + + private Integer x3; + private Integer y3; + + private Integer x4; + private Integer y4; + + private Integer x5; + private Integer y; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/PositionVo.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/PositionVo.java new file mode 100644 index 0000000..9c02f02 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/PositionVo.java @@ -0,0 +1,17 @@ +package com.dkha.common.modules.vo.warning; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@AllArgsConstructor +@NoArgsConstructor +@Data +public class PositionVo { + + private String faceId; + private RectVO rect; + private P5sVO p5s; + private String extId; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/RectVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/RectVO.java new file mode 100644 index 0000000..5ff8602 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/RectVO.java @@ -0,0 +1,16 @@ +package com.dkha.common.modules.vo.warning; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RectVO { + + private Integer left; + private Integer top; + private Integer right; + private Integer bottom; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/WarningBayonetReturnVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/WarningBayonetReturnVO.java new file mode 100644 index 0000000..91a9e5d --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/WarningBayonetReturnVO.java @@ -0,0 +1,35 @@ +package com.dkha.common.modules.vo.warning; + +import com.dkha.common.modules.vo.face.AlarmReturnVO; +import com.dkha.common.modules.vo.face.PageVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(卡口返回数据) + * All rights 成都电科慧安 + * @Title: WarningBayonetReturnVO + * @Package com.dkha.server.modules.vo.warning + * @author: panhui + * @date: 2019/12/10 11:42 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +//@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="卡口返回数据", description="卡口返回数据") +public class WarningBayonetReturnVO { + + @ApiModelProperty(value = "预警信息") + private List result; + @ApiModelProperty(value = "分页数据") + private PageVO page; +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/WarningPageVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/WarningPageVO.java new file mode 100644 index 0000000..99f6459 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/WarningPageVO.java @@ -0,0 +1,69 @@ +package com.dkha.common.modules.vo.warning; + +import com.dkha.common.modules.vo.position.PositionVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: WarningPageVO + * @Package com.dkha.server.modules.vo.warning + * @author: panhui + * @date: 2019/12/12 9:00 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +//@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="预警页面展示的vo", description="前端页面展示数据") +public class WarningPageVO { + + @ApiModelProperty(value = "背景图片") + private String bgImg; + @ApiModelProperty(value = "坐标") + private PositionVO positionVO; + + @ApiModelProperty(value = "比分") + private Double score; + @ApiModelProperty(value = "时间") + private String time; + + + @ApiModelProperty(value = "比中头像地址") + private String faceUrl; + @ApiModelProperty(value = "姓名") + private String name; + @ApiModelProperty(value = "性别") + private String sex; + @ApiModelProperty(value = "身份证号码") + private String idCard; + @ApiModelProperty(value = "年龄") + private Integer age; + + + @ApiModelProperty(value = "任务id") + private String taskId; + @ApiModelProperty(value = "任务名称") + private String taskName; + @ApiModelProperty(value = "任务类型") + private String taskType; + + @ApiModelProperty(value = "库名称") + private String libName; + @ApiModelProperty(value = "库id") + private String libId; + + + @ApiModelProperty(value = "摄像头区域") + private String cameraRegion; + @ApiModelProperty(value = "摄像头id") + private String cameraId; + +} diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/warning/WarningVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/warning/WarningVO.java new file mode 100644 index 0000000..51d078e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/modules/vo/warning/WarningVO.java @@ -0,0 +1,54 @@ +package com.dkha.common.modules.vo.warning; + + +import com.dkha.common.modules.vo.position.FaceVO; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; + +import java.util.List; + +/** + * @version V1.0 + * @Description: 预警信息 + * All rights 成都电科慧安 + * @Title: WarningVO + * @Package com.dkha.common.entity.vo.warning + * @author: panhui + * @date: 2019/11/27 9:49 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +//@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="预警", description="用于和底层传输统一参数格式") +public class WarningVO { + @ApiModelProperty(value = "报警唯一id") + @Id +// @Field(type= FieldType.Keyword) + private String id; + @ApiModelProperty(value="时间戳用来排序") + private Long timestamp; + @ApiModelProperty(value = "消息日期") + private String date; + @ApiModelProperty(value = "任务id") + private String taskIdCameraId;//task_id_ph_0001 + @ApiModelProperty(value = "api端任务id") + private String taskId;//task_id_ph + @ApiModelProperty(value = "摄像头id") + private String cameraId;//0001 + @ApiModelProperty(value = "背景图片") + private String bgImg; + @ApiModelProperty(value = "背景高度") + private Integer bgHeight; + @ApiModelProperty(value = "背景宽度") + private Integer bgWidth; + @ApiModelProperty(value = "人脸坐标列表") + private List faces; + +} diff --git a/face-common/src/main/java/com/dkha/common/mybatis/CodeGenerator.java b/face-common/src/main/java/com/dkha/common/mybatis/CodeGenerator.java new file mode 100644 index 0000000..8c96c44 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/mybatis/CodeGenerator.java @@ -0,0 +1,178 @@ +package com.dkha.common.mybatis; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.DateType; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; + +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + + +/** + * @Description: mybatis-plus 代码生成器 + * @Author: Spring + * @CreateDate: 2019/8/1 17:47 + */ + +public class CodeGenerator { + + /** + * 代码生成 + * @param folderPath 输出文件夹路径 + */ + public static void generate(String folderPath) throws IOException { + + deleteDir(folderPath); + + // 代码生成器 + AutoGenerator mpg = new AutoGenerator(); + + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + String projectPath = folderPath; + gc.setOutputDir(projectPath + "/src/main/java"); + gc.setAuthor("Spring"); + gc.setOpen(false); + //生成时间为Date类 + gc.setDateType(DateType.ONLY_DATE); + //实体属性 Swagger2 注解 + gc.setSwagger2(true); + //分布式全局唯一Id生成策略 + gc.setIdType(IdType.ID_WORKER_STR); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); +// dsc.setUrl("jdbc:mysql://192.168.3.240:3301/employ?useUnicode=true&useSSL=false&characterEncoding=utf8"); + dsc.setUrl("jdbc:mysql://10.51.10.201:3301/face_application?useUnicode=true&useSSL=false&characterEncoding=utf8"); + + dsc.setDriverName("com.mysql.jdbc.Driver"); + dsc.setUsername("root"); + dsc.setPassword("123456"); + mpg.setDataSource(dsc); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent("com.dkha.server"); + pc.setEntity("modules.entities"); + pc.setService("services"); + pc.setServiceImpl("services.impl"); + pc.setMapper("mappers"); + pc.setController("controllers"); + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + + // 如果模板引擎是 freemarker + String templatePath = "/templates/mapper.xml.ftl"; + // 自定义输出配置 + List focList = new ArrayList<>(); + // 自定义配置会被优先输出 + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!! + return projectPath + "/src/main/resources/mappers/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML; + } + }); + + cfg.setFileOutConfigList(focList); + mpg.setCfg(cfg); + + // 配置模板 + TemplateConfig templateConfig = new TemplateConfig(); + + templateConfig.setXml(null); + mpg.setTemplate(templateConfig); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setNaming(NamingStrategy.underline_to_camel); + strategy.setColumnNaming(NamingStrategy.underline_to_camel); + strategy.setEntityLombokModel(true); + strategy.setRestControllerStyle(true); + strategy.setSuperEntityColumns("id"); + strategy.setControllerMappingHyphenStyle(true); + strategy.setTablePrefix(pc.getModuleName() + "_"); + //是否显示属性注解 + strategy.setEntityTableFieldAnnotationEnable(false); + mpg.setStrategy(strategy); + mpg.setTemplateEngine(new FreemarkerTemplateEngine()); + mpg.execute(); + + //弹出生成代码文件夹 + Desktop.getDesktop().open(new File(folderPath)); + } + + /** + * delete dir + * @param folderPath + */ + public static void deleteDir(String folderPath) { + try { + //删除完里面所有内容 + delAllFile(folderPath); + String filePath = folderPath; + filePath = filePath.toString(); + File myFilePath = new File(filePath); + myFilePath.delete(); //删除空文件夹 + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * delete all file + * @param path + * @return + */ + public static boolean delAllFile(String path) { + boolean flag = false; + File file = new File(path); + if (!file.exists()) { + return flag; + } + if (!file.isDirectory()) { + return flag; + } + String[] tempList = file.list(); + File temp = null; + for (int i = 0; i < tempList.length; i++) { + if (path.endsWith(File.separator)) { + temp = new File(path + tempList[i]); + } else { + temp = new File(path + File.separator + tempList[i]); + } + if (temp.isFile()) { + temp.delete(); + } + if (temp.isDirectory()) { + //先删除文件夹里面的文件 + delAllFile(path + "/" + tempList[i]); + //再删除空文件夹 + deleteDir(path + "/" + tempList[i]); + flag = true; + } + } + return flag; + } + + public static void main(String[] args) throws IOException { + generate("d:\\mybatis-code-generate"); + } +} diff --git a/face-common/src/main/java/com/dkha/common/page/PageParam.java b/face-common/src/main/java/com/dkha/common/page/PageParam.java new file mode 100644 index 0000000..7be219e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/page/PageParam.java @@ -0,0 +1,101 @@ +package com.dkha.common.page; + +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 分页类 用于分页传参 + * @author Spring + * @create 2016-12-10 14:38 + **/ +public class PageParam { + + /** + * 当前页码 + */ + private int pageNo = 1; + + /** + * 每页记录数 默认10条 + */ + private int pageSize = 10; + + /** + * 搜索条件 + */ + private Map note=new HashMap(); + + /** + * 排序条件 + */ + private Map sort=new HashMap(); + + /** + * 拼接搜索条件 + * @return + */ + public String getSortString() { + return sort.entrySet() + .stream() + //过滤掉key和value都为空的项 + .filter(x -> !StringUtils.isEmpty(x.getKey())&&!StringUtils.isEmpty(x.getValue())) + //map转list + .map(x -> x.getKey() + " " + x.getValue()) + //逗号拼接 + .collect(Collectors.joining(",")); + } + + /** + * 模糊查询拼接 + * @param params + * @param likes + * @return + */ + public Map paramsToLike(Map params, String... likes){ + for (String like : likes){ + String val = params.get(like); + if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(val)){ + params.put(like, "%" + val + "%"); + }else { + params.put(like, null); + } + } + return params; + } + + public int getPageNo() { + return pageNo; + } + + public void setPageNo(int pageNo) { + this.pageNo = pageNo; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public Map getNote() { + return note; + } + + public void setNote(Map note) { + this.note = note; + } + + public Map getSort() { + return sort; + } + + public void setSort(Map sort) { + this.sort = sort; + } + +} diff --git a/face-common/src/main/java/com/dkha/common/pool/EmployeeThreadPool.java b/face-common/src/main/java/com/dkha/common/pool/EmployeeThreadPool.java new file mode 100644 index 0000000..b0de760 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/pool/EmployeeThreadPool.java @@ -0,0 +1,25 @@ +package com.dkha.common.pool; + + +import org.apache.commons.lang3.concurrent.BasicThreadFactory; + +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; + +/** + * @Author Spring + * @Since 2019/8/15 11:55 + * @Description 系统线程池 + */ +public class EmployeeThreadPool { + + /** + * 不要手动设置线程池并发线程数量,应根据线程所执行的任务是IO型任务还是CPU密集计算型任务进行设置,粗略设置如下 + * 如果是CPU密集型应用,则线程池大小设置为N+1 + * 如果是IO密集型应用,则线程池大小设置为2N+1 + * 线程IO时间占整个执行时间比例越高,则可以适当放大并发数,反之适当减少并发数量 + */ + public static ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(2 * Runtime.getRuntime().availableProcessors() + 1, + new BasicThreadFactory.Builder().namingPattern("async-face-pool-%d").daemon(true).build()); + +} diff --git a/face-common/src/main/java/com/dkha/common/pwd/MD5.java b/face-common/src/main/java/com/dkha/common/pwd/MD5.java new file mode 100644 index 0000000..e7bda7a --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/pwd/MD5.java @@ -0,0 +1,70 @@ +package com.dkha.common.pwd; + +import java.security.MessageDigest; + +public class MD5 { + + private static String byteArrayToHexString(byte b[]) { + StringBuffer resultSb = new StringBuffer(); + for (int i = 0; i < b.length; i++) + resultSb.append(byteToHexString(b[i])); + + return resultSb.toString(); + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0) + n += 256; + int d1 = n / 16; + int d2 = n % 16; + return hexDigits[d1] + hexDigits[d2]; + } + + public static String MD5Encode(String origin, String charsetname) { + String resultString = null; + try { + resultString = new String(origin); + MessageDigest md = MessageDigest.getInstance("MD5"); + if (charsetname == null || "".equals(charsetname)) + resultString = byteArrayToHexString(md.digest(resultString + .getBytes())); + else + resultString = byteArrayToHexString(md.digest(resultString + .getBytes(charsetname))); + } catch (Exception exception) { + } + return resultString; + } + + private static final String hexDigits[] = {"0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}; + + public final static String getMessageDigest(String s) { + char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + + try { + byte[] btInput = s.getBytes(); + // 获得MD5摘要算法的 MessageDigest 对象 + MessageDigest mdInst = MessageDigest.getInstance("MD5"); + // 使用指定的字节更新摘要 + mdInst.update(btInput); + // 获得密文 + byte[] md = mdInst.digest(); + // 把密文转换成十六进制的字符串形式 + int j = md.length; + char str[] = new char[j * 2]; + int k = 0; + for (int i = 0; i < j; i++) { + byte byte0 = md[i]; + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; + str[k++] = hexDigits[byte0 & 0xf]; + } + return new String(str); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + + } +} diff --git a/face-common/src/main/java/com/dkha/common/pwd/SHA1.java b/face-common/src/main/java/com/dkha/common/pwd/SHA1.java new file mode 100644 index 0000000..f18da3e --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/pwd/SHA1.java @@ -0,0 +1,47 @@ +package com.dkha.common.pwd; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +/** + * sha转换 + */ +public class SHA1 { + + private static Logger logger = LoggerFactory.getLogger(SHA1.class); + + public static String convert(String password) { + MessageDigest messageDigest; + try { + messageDigest = MessageDigest.getInstance("SHA-1"); + messageDigest.update(password.getBytes("UTF-8")); + password = SHA1.byte2hex(messageDigest.digest()); + } catch (NoSuchAlgorithmException e) { + logger.error(e.getMessage(), e); + } catch (UnsupportedEncodingException e) { + logger.error(e.getMessage(), e); + } + return password; + } + + private static String byte2hex(byte[] b) { + String hs = ""; + String stmp = ""; + for (int n = 0; n < b.length; n++) { + stmp = (Integer.toHexString(b[n] & 0xFF)); + if (stmp.length() == 1) + hs = hs + "0" + stmp; + else + hs = hs + stmp; + } + return hs; + } + + public static void main(String[] args) { + System.out.println(SHA1.convert("123123")); + } +} diff --git a/face-common/src/main/java/com/dkha/common/redis/RedisConfig.java b/face-common/src/main/java/com/dkha/common/redis/RedisConfig.java new file mode 100644 index 0000000..876a092 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/redis/RedisConfig.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.common.redis; + +import com.dkha.common.redis.serializer.JsonRedisSerializer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +import javax.annotation.Resource; + +/** + * Redis配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class RedisConfig { + @Resource + private RedisConnectionFactory factory; + + @Bean + public RedisTemplate redisTemplate() { + RedisTemplate redisTemplate = new RedisTemplate<>(); + redisTemplate.setKeySerializer(new StringRedisSerializer()); + redisTemplate.setValueSerializer(new JsonRedisSerializer<>(Object.class)); + redisTemplate.setHashKeySerializer(new StringRedisSerializer()); + redisTemplate.setHashValueSerializer(new JsonRedisSerializer<>(Object.class)); + redisTemplate.setConnectionFactory(factory); + + return redisTemplate; + } +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/redis/RedisKeys.java b/face-common/src/main/java/com/dkha/common/redis/RedisKeys.java new file mode 100644 index 0000000..0fc0eca --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/redis/RedisKeys.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.common.redis; + + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class RedisKeys { + /** + * 系统参数Key + */ + public static String getSysParamsKey(){ + return "sys:params"; + } + + /** + * 验证码Key + */ + public static String getCaptchaKey(String uuid){ + return "sys:captcha:" + uuid; + } + + /** + * socketSessionId Key + */ + public static String getSessionIdKey(String sessionId){ + return "sys:sessionId:" + sessionId; + } + /** + * 摄像头id + * @param cameraId + * @return + */ + public static String getCameraSize(String cameraId){return "task:socket:"+cameraId;} + + + /** + * 用來軌跡追蹤保存摄像头信息 + * @param cameraId + * @return + */ + public static String getCameraByTrack(String time,String cameraId){return "task:track:"+time+":"+cameraId;} + + /** + * 用來軌跡追蹤保存摄像头信息 + * @param faceId + * @return + */ + public static String getCameraByFaceId(String time,String cameraId,String faceId){return "task:track:"+time+":"+cameraId+":face:"+faceId;} + + /** + * 用來軌跡追蹤保存摄像头信息 + * @param time + * @param cameraId + * @return + */ + public static String getCameraByExpired(String time,String cameraId){return "task:expired:"+time+":"+cameraId;} + +} diff --git a/face-common/src/main/java/com/dkha/common/redis/RedisUtils.java b/face-common/src/main/java/com/dkha/common/redis/RedisUtils.java new file mode 100644 index 0000000..634ca1b --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/redis/RedisUtils.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.common.redis; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.Collection; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * Redis工具类 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class RedisUtils { + @Autowired + private RedisTemplate redisTemplate; + + /** 默认过期时长为1天,单位:秒 */ + public final static long DEFAULT_EXPIRE = 60 * 60 * 24L; + + /** 长登录--保持15天 */ + public final static long LONG_LOGIN_EXPIRE = 60 * 60 * 24 * 15L; + + /** 短登录-保持30分钟 */ + public final static long SHORT_LOGIN_EXPIRE = 60 * 30L; + + /** 30分钟缓存有效期 */ + public final static long SHORT_DEFAULT_EXPIRE = 60 * 30L; + + /** 默认短信过期时间 */ + public final static long SHORT_MESSAGE_EXPIRE = 60 * 5L; + + /** 不设置过期时长 */ + public final static long NOT_EXPIRE = -1L; + + public void set(String key, Object value, long expire){ + redisTemplate.opsForValue().set(key, value); + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + } + /** + * 检测key是否存在 + * @param key + * @return + */ + public boolean exists(String key) + { + return redisTemplate.hasKey(key); + } + public void set(String key, Object value){ + set(key, value, DEFAULT_EXPIRE); + } + + public Object get(String key, long expire) { + Object value = redisTemplate.opsForValue().get(key); + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + return value; + } + + + public Object get(String key) { + return get(key, NOT_EXPIRE); + } + + public void delete(String key) { + redisTemplate.delete(key); + } + + public void delete(Collection keys) { + redisTemplate.delete(keys); + } + + public Object hGet(String key, String field) { + return redisTemplate.opsForHash().get(key, field); + } + + public Map hGetAll(String key){ + HashOperations hashOperations = redisTemplate.opsForHash(); + return hashOperations.entries(key); + } + + public void hMSet(String key, Map map){ + hMSet(key, map, DEFAULT_EXPIRE); + } + + public void hMSet(String key, Map map, long expire){ + redisTemplate.opsForHash().putAll(key, map); + + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + } + + public void hSet(String key, String field, Object value) { + hSet(key, field, value, DEFAULT_EXPIRE); + } + + public void hSet(String key, String field, Object value, long expire) { + redisTemplate.opsForHash().put(key, field, value); + + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + } + + public void expire(String key, long expire){ + redisTemplate.expire(key, expire, TimeUnit.SECONDS); + } + + public void hDel(String key, Object... fields){ + redisTemplate.opsForHash().delete(key, fields); + } + + public void leftPush(String key, Object value){ + leftPush(key, value, DEFAULT_EXPIRE); + } + + public void leftPush(String key, Object value, long expire){ + redisTemplate.opsForList().leftPush(key, value); + + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + } + + public Object rightPop(String key){ + return redisTemplate.opsForList().rightPop(key); + } +} diff --git a/face-common/src/main/java/com/dkha/common/redis/serializer/JsonRedisSerializer.java b/face-common/src/main/java/com/dkha/common/redis/serializer/JsonRedisSerializer.java new file mode 100644 index 0000000..d6c4843 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/redis/serializer/JsonRedisSerializer.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.common.redis.serializer; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.parser.ParserConfig; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.alibaba.fastjson.util.IOUtils; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationException; + + +/** + * Redis序列化 + * + * @author Mark sunlightcs@gmail.com + */ +public class JsonRedisSerializer implements RedisSerializer { + private static ParserConfig defaultRedisConfig = new ParserConfig(); + static { + defaultRedisConfig.setAutoTypeSupport(true); + } + + private Class type; + + public JsonRedisSerializer(Class type) { + this.type = type; + } + + @Override + public byte[] serialize(T t) throws SerializationException { + if (t == null) { + return new byte[0]; + } + return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(IOUtils.UTF8); + } + + @Override + public T deserialize(byte[] bytes) throws SerializationException { + if (bytes == null || bytes.length <= 0) { + return null; + } + String str = new String(bytes, IOUtils.UTF8); + + return JSON.parseObject(str, type, defaultRedisConfig); + } +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/result/CommonResult.java b/face-common/src/main/java/com/dkha/common/result/CommonResult.java new file mode 100644 index 0000000..a3b8084 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/result/CommonResult.java @@ -0,0 +1,145 @@ +package com.dkha.common.result; + + +import com.dkha.common.exception.DkException; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.UtilValidate; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ControllerAdvice; + +import java.io.Serializable; + +/** + * @Author Spring + * @Since 2019/8/15 11:55 + * @Description 通用结果类 每个controller都集成该类,从而实现统返回结果 + * 约束如下:成功的状态码返回0 + * 错误操作或者特殊状态码 统一返回非0 错误码默认采用60001 + */ +@ControllerAdvice +public class CommonResult implements Serializable { + + private static final long serialVersionUID = 1L; + + /** 返回信息码 */ + private Integer code; + /** 返回的文字信息 */ + private String message; + /** 返回数据 */ + private Object data; + + /** + * 用于auto write + */ + public CommonResult(){ + + } + + public CommonResult(Object data, Integer code, String message) { + this.code = code; + this.data = data; + this.message = message; + } + + public CommonResult(Integer code, String message) { + this.code = code; + this.data = null; + this.message = message; + } + + /** + * 操作成功返回集 code为0 + */ + public CommonResult successResult(Object data) { + CommonResult commonResult = new CommonResult(); + commonResult.code = SystemCode.HANDLER_SUCCESS.code; + commonResult.data = data; + commonResult.message = SystemCode.HANDLER_SUCCESS.des; + return commonResult; + } + + /** + * 操作成功返回集 code为0 + * @param message + * @param data + */ + public CommonResult successResult(String message, Object data) { + CommonResult commonResult = new CommonResult(); + commonResult.code = SystemCode.HANDLER_SUCCESS.code; + commonResult.data = data; + commonResult.message = UtilValidate.isEmpty(message) ? SystemCode.HANDLER_SUCCESS.des : message; + return commonResult; + } + + /** + * 操作失败返回集 默认code 60001 + * @param message + * @return + */ + public CommonResult failResult(String message) { + CommonResult commonResult = new CommonResult(); + commonResult.code = SystemCode.HANDLER_FAILED.code; + commonResult.data = null; + commonResult.message = message; + return commonResult; + } + + /** + * 操作失败返回集 默认code + * @return + */ + public CommonResult failResult(SystemCode systemCode) { + CommonResult commonResult = new CommonResult(); + commonResult.code = systemCode.code; + commonResult.data = null; + commonResult.message = systemCode.des; + return commonResult; + } + + /** + * 操作失败返回集 + * @param data + * @param message + * @param code + */ + public CommonResult failResult(Integer code, String message, Object data) { + CommonResult commonResult = new CommonResult(); + commonResult.code = UtilValidate.isEmpty(code) ? SystemCode.HANDLER_FAILED.code : code; + commonResult.data = data; + commonResult.message = UtilValidate.isEmpty(message) ? SystemCode.HANDLER_FAILED.des : message; + return commonResult; + } + /** + * 用于Hibernate-validate vo校验 + * @param bindingResult + */ + public void validate(BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + throw new DkException(bindingResult.getFieldError().getDefaultMessage()); + } + } + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} + diff --git a/face-common/src/main/java/com/dkha/common/signature/SignatureUtil.java b/face-common/src/main/java/com/dkha/common/signature/SignatureUtil.java new file mode 100644 index 0000000..ef9fbb9 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/signature/SignatureUtil.java @@ -0,0 +1,144 @@ +package com.dkha.common.signature; + +import com.dkha.common.http.HttpUtil; +import com.dkha.common.util.UtilValidate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.DigestUtils; +import sun.misc.BASE64Encoder; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; + +/** + * @Author Spring + * @Since 2019/9/26 22:14 + * @Description 接口签名校验 + */ + +public class SignatureUtil { + + public static final Logger logger = LoggerFactory.getLogger(SignatureUtil.class); + + public static final String HMAC_SHA1_ALGORITHM = "HmacSHA1"; + + /** + * 校验签名 + * @param request + * @param secretKey 秘钥 + * @param time 请求时间 + * @param signature 请求过来的签名 + * @return + */ + public static boolean validateSignature(HttpServletRequest request, String secretKey, String time, String signature) { + if (signature(request, secretKey, time).equals(signature)) { + return true; + } + return false; + } + + /** + * 生成签名 + * @param request + * @param secretKey 秘钥 + * @param time 请求时间 + * @return + * + * 签名生成算法如下 + * StringToSing = HTTP-Verb +”\n”+      //http请求的动作 + * + *             Content-MD5+”\n”+     //http请求的MD5值 + * + *             Content-Type+”\n”+     //http请求的类型 + * + *             Date+”\n”+            //http请求时间 + * + *             CanonicalizdResource;  //http请求资源--当前版本不适用该字段做为签名 + * + * 签名生成算法 + * Signature = Base64( HMAC-SHA1( AccessSecret, UTF-8-Encoding-Of(StringToSign)) ) + * + * https://help.aliyun.com/knowledge_detail/106305.html + * https://blog.csdn.net/huanggang028/article/details/9004322 + */ + public static String signature(HttpServletRequest request, String secretKey, String time) { + //获取请求方法 + String requestMethod = request.getMethod(); + String requestData = ""; + try { + requestData = HttpUtil.getRequestPostBytes(request); + } catch (IOException e) { + logger.error(e.getMessage(), e); + return null; + } + String contentType = request.getContentType(); + String waitSignStr = requestMethod + "\n" + (UtilValidate.isEmpty(requestData) ? "" : md5Encode(requestData) + "\n") + contentType + "\n" + time; + try { + waitSignStr = new String(waitSignStr.getBytes(), "utf-8"); + } catch (UnsupportedEncodingException e) { + logger.error(e.getMessage(), e); + return null; + } + String cipherText = hamcsha1(waitSignStr, secretKey); + cipherText = base64Encode(cipherText); + return cipherText; + } + + + /** + * HMAC_SHA1 签名 + * @param data 消息 + * @param secretKey 签名密钥 + * @return + */ + public static String hamcsha1(String data, String secretKey) { + try { + SecretKeySpec signingKey = new SecretKeySpec(secretKey.getBytes(), HMAC_SHA1_ALGORITHM); + Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM); + mac.init(signingKey); + return byte2hex(mac.doFinal(data.getBytes())); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (InvalidKeyException e) { + e.printStackTrace(); + } + return null; + } + + /** + * md5 加密 + * @param data + * @return + */ + public static String md5Encode(String data) { + return DigestUtils.md5DigestAsHex(data.getBytes()); + } + + public static String base64Encode(String data) { + BASE64Encoder encoder = new BASE64Encoder(); + return encoder.encode(data.getBytes()); + } + + /** + * 字节数组转16进制 + * @param b 字节数组 + * @return + */ + public static String byte2hex(byte[] b) { + StringBuilder hs = new StringBuilder(); + String stmp; + for (int n = 0; b != null && n < b.length; n++) { + stmp = Integer.toHexString(b[n] & 0XFF); + if (stmp.length() == 1) { + hs.append('0'); + } + hs.append(stmp); + } + return hs.toString().toUpperCase(); + } +} diff --git a/face-common/src/main/java/com/dkha/common/systemcode/SystemCode.java b/face-common/src/main/java/com/dkha/common/systemcode/SystemCode.java new file mode 100644 index 0000000..6c06efa --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/systemcode/SystemCode.java @@ -0,0 +1,148 @@ +package com.dkha.common.systemcode; + + +/** + * @Author Spring + * @Since 2018/8/15 11:55 + * @Description 系统通用返回码 约束如下: + * 操作成功 统一返回code 0 + * 错误操作或者特殊状态码 统一返回非0 错误码默认采用60001 + */ +public enum SystemCode { + + WX_GET_CONFIG_ERROR(40000, "获取微信参数错误"), + WX_UPLOAD_ERROR(40001, "获取微信参数错误"), + + /** + * -----------------------------统一异常捕获(50***)异常码定义------------------------------------- + */ + + INTERNAL_PROGRAM_ERROR(50000, "程序内部错误,操作失败"), + DATA_ACCESS_EXCEPTION(50001, "数据库操作失败"), + COMMUNICATIONS_EXCEPTION(50002, "数据库连接中断"), + CONSTRAINT_VIOLATION_EXCEPTION(50002, "对象已经存在,请勿重复操作"), + DATA_INTEGRITY_VIOLATION_EXCEPTION(50003, "对象已经存在,请勿重复操作"), + MYSQL_INTEGRITY_CONSTRAINT_VIOLATION_EXCEPTION(50004, "对象已经存在,请勿重复操作"), + NULL_POINTER_EXCEPTION(50005, "调用了未经初始化的对象或者是不存在的对象"), + IO_EXCEPTION(50006, "IO异常"), + CLASS_NOT_FOUND_EXCEPTION(50007, "指定的类不存在"), + ARITHMETIC_EXCEPTION(50008, "数学运算异常"), + ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION(50009, "数组下标越界"), + ILLEGAL_ARGUMENT_EXCEPTION(50010, "参数错误或非法"), + ClassCastException(50011, "类型强制转换错误"), + SQL_EXCEPTION(50013, "操作数据库异常"), + SECURITY_EXCEPTION(50012, "违背安全原则异常"), + NO_SUCH_METHOD_EXCEPTION(50014, "方法未找到异常"), + INTERNAL_ERROR(50015, "内部错误"), + CONNECT_EXCEPTION(50016, "服务器连接异常"), + CANCELLATION_EXCEPTION(50017, "任务已被取消的异常"), + API_EXCEPTION(50018, "阿里服务器错误"), + PARSE_EXCEPTION(50019, "日期格式错误"), + DATA_OVER_LONG(50020, "数据超长"), + + /**-----------------------------统一异常捕获(50***)异常码定义-------------------------------------*/ + + + /** + * -----------------------------参数异常(51***)异常码定义------------------------------------- + */ + + ParaIsNull(51002, "参数为空"), + paraNotRight(51003, "参数非法"), + + /** + * -----------------------------公共操作成功、失败(60***)异常码定义------------------------------------- + */ + + HANDLER_SUCCESS(0, "操作成功"), + HANDLER_FAILED(60001, "操作失败"), + SAVE_SUCCESS(60002, "新增成功"), + SAVE_SUCCESS_(60017, "保存成功"), + SAVE_FAILED(60003, "新增失败"), + DELETE_SUCCESS(60004, "删除成功"), + DELETE_FAILED(60005, "删除失败"), + UPDATE_SUCCESS(60006, "修改成功"), + UPDATE_FAILED(60007, "修改失败"), + SET_SUCCESS(60008, "设置成功"), + SET_FAILED(60009, "设置失败"), + NO_DATA(60010, "无对应数据"), + SYNC_SUCCESS(60011, "同步成功"), + SYNC_FAILED(60012, "同步失败"), + SYNC_DATA_IS_NULL(60013, "同步数据为空"), + SYNC_DATA_NOT_ALL_SUCCESS(60014, "同步数据部分成功"), + FIND_SUCCESS(60015, "查询成功"), + FIND_FAILED(60016, "查询失败"), + COMMODITY_NUM_NOT_ENOUGH_FOR_ADD(60017, "商品数量不足"), + + COMMODITY_NUM_NOT_ENOUGH_FOR_REDUCE(60018, "商品数量不足"), + + COMMODITY_NOT_ENABLE(60019, "商品已下架"), + EXCEL_ERROR_DATA(60020, "excel错误数据"), + + ORDER_INVALID(61000, "订单已无效"), + + WX_PAY_ERROR(62000, "微信支付异常"), + + /** + * -----------------------------登录成功、失败(70***)异常码定义------------------------------------- + */ + + LOGIN_SUCCESS(70000,"登录成功"), + LOGIN_FAILED(70001,"登录失败"), + LOGIN_FAILED_USERNAME(70002,"用户名不存在"), + LOGIN_FAILED_PASSWORD(70003,"密码错误"), + LOGIN_FAILED_USERNAME_OR_PASSWORD(70004,"用户名或密码错误"), + LOGIN_FAILED_SESSION_TIMEOUT(70005,"重新登录"), + LOGIN_ERROR_USER(70006,"用户状态异常"), + ACCOUNT_ENABLE(70007, "账号已停用"), + ACCOUNT_CAN_NOT_EMPTY(70008, "账号不能为空"), + PASSWORD_CAN_NOT_EMPTY(70009, "密码不能为空"), + LOGIN_LIMIT(70010, "账号已锁定,请联系主管部门管理人员初始化登录密码!"), + + TOKEN_ERROR(71000, "token无效"), + TOKEN_EXPIRED(71001, "token已过期"), + SESSION_EXPIRE(71002, "账号已过期,请重新登录!"), + VERIFICATION_CODE_ERROR(71003, "图形验证码错误!"), + SINGLE_EQUIPMENT_ERROR(71004, "当前账号已在其他设备登录!"), + SHORT_MESSAGE_CODE_ERROR(71005, "短信验证码错误!"), + SHORT_MESSAGE_CAN_NOT_NULL(71006, "短信验证码不能为空!"), + SHORT_MESSAGE_EXPIRED(71007, "短信验证码已过期!"), + SIGNATURE_ERROR(71008, "签名错误!"), + PHONE_ALREADY_REGISTER(71009, "当前手机号已注册!"), + USER_NOT_FOLLOW(72000, "当前用户未关注微信公众号."), + ACCOUNT_WAIT_REVIEW(72001, "账号待审核."), + ACCOUNT_REVIEW_NOT_PASS(72002, "账号审核未通过."), + NOT_AUTHORIZATION(72003, "当前用户暂无权限."), + + REDIS_ERROR(80001, "redis错误"), + DATA_CAN_NOT_EMPTY(80002, "数据不能为空!"), + LABEL_ERROR(80003, "查不到身份信息,请到人社局录入!"), + IDCARD_ERROR(80005, "身份证号码输入不正确!"), + FILE_ERROR(80006, "文件名格式不正确!"), + DELETELIB_ERROR(80007, "该库有关联的布控信息,不能删除!"), + FACESRH_ERROR(80008, "没有人脸信息!"), + LABELCONLL_ERROR(80004, "岗位已经收藏过了!"); + + public Integer code; + public String des; + + SystemCode(Integer code, String des) { + this.code = code; + this.des = des; + } + + public static SystemCode get(Integer code) { + for (SystemCode errorCode : SystemCode.values()) { + if (errorCode.code.toString().equals(code.toString())) { + return errorCode; + } + } + return null; + } + + @Override + public String toString() { + return "code:" + code + ", des:" + des; + } + +} diff --git a/face-common/src/main/java/com/dkha/common/util/Base64ImageUtils.java b/face-common/src/main/java/com/dkha/common/util/Base64ImageUtils.java new file mode 100644 index 0000000..b4cc126 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/Base64ImageUtils.java @@ -0,0 +1,444 @@ +package com.dkha.common.util; + +import com.dkha.common.modules.vo.position.PositionVO; +import com.google.gson.Gson; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import sun.misc.BASE64Decoder; +import sun.misc.BASE64Encoder; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.*; +import java.net.MalformedURLException; +import java.net.URL; + +@Component +public class Base64ImageUtils { + + public static final Logger logger = LoggerFactory.getLogger(Base64ImageUtils.class); + + /** + * 将网络图片进行Base64位编码 + * + * @param imageUrl 图片的url路径,如http://.....xx.jpg + * @return + */ + public static String encodeImgageToBase64(URL imageUrl) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 + ByteArrayOutputStream outputStream = null; + try { + BufferedImage bufferedImage = ImageIO.read(imageUrl); + outputStream = new ByteArrayOutputStream(); + ImageIO.write(bufferedImage, "png", outputStream); + // 对字节数组Base64编码 + BASE64Encoder encoder = new BASE64Encoder(); + byte[] by = outputStream.toByteArray(); + return encoder.encode(by); + } catch (MalformedURLException e1) { + e1.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + + return null;///encoder.encode(by);// 返回Base64编码过的字节数组字符串 + } + + /** + * 将网络图片进行Base64位编码 + * + * @param imageUrl 图片的url路径,如http://.....xx.jpg + * @return + */ + public static BufferedImage urlToBufferImage(URL imageUrl) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 + try { + BufferedImage bufferedImage = ImageIO.read(imageUrl); + return bufferedImage; + } catch (MalformedURLException e1) { + } catch (IOException e) { + } finally { + + } + + + return null;///encoder.encode(by);// 返回Base64编码过的字节数组字符串 + } + + /** + * 将图片流转换为Base64 + * + * @param bufferedImage + * @return + */ + public static String encodeImgageToBase64(BufferedImage bufferedImage) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 + ByteArrayOutputStream outputStream = null; + try { +// BufferedImage bufferedImage = ImageIO.read(imageUrl); + outputStream = new ByteArrayOutputStream(); + ImageIO.write(bufferedImage, "png", outputStream); + // 对字节数组Base64编码 + BASE64Encoder encoder = new BASE64Encoder(); + byte[] by = outputStream.toByteArray(); + return encoder.encode(by); + } catch (MalformedURLException e1) { + e1.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + + return null;///encoder.encode(by);// 返回Base64编码过的字节数组字符串 + } + + /** + * 将本地图片进行Base64位编码 + * + * @param imageFile 图片的url路径,如F:/.....xx.jpg + * @return + */ + public static String encodeImgageToBase64(File imageFile) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 + ByteArrayOutputStream outputStream = null; + try { + BufferedImage bufferedImage = ImageIO.read(imageFile); + outputStream = new ByteArrayOutputStream(); + ImageIO.write(bufferedImage, "png", outputStream); + // 对字节数组Base64编码 + BASE64Encoder encoder = new BASE64Encoder(); + + byte[] by = outputStream.toByteArray(); + return encoder.encode(by); + } catch (MalformedURLException e1) { + e1.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + return null; + // 返回Base64编码过的字节数组字符串 + } + + /** + * 将Base64位编码的图片进行解码,并保存到指定目录 + * + * @param base64 base64编码的图片信息 + * @return + */ + public static void decodeBase64ToImage(String base64, String path, + String imgName) { + BASE64Decoder decoder = new BASE64Decoder(); + FileOutputStream write = null; + try { + write = new FileOutputStream(new File(path + + imgName)); + byte[] decoderBytes = decoder.decodeBuffer(base64); + write.write(decoderBytes); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + write.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + } + + /** + * 将Base64位编码的图片进行解码,输出byte + * + * @param base64 base64编码的图片信息 + * @return + */ + public static byte[] decodeBase64ToImage(String base64) { + BASE64Decoder decoder = new BASE64Decoder(); + try { + byte[] decoderBytes = decoder.decodeBuffer(base64); + return decoderBytes; + } catch (IOException e) { + return null; + } finally { + } + } + + /** + * @return + */ + public static InputStream encodeImgage(BufferedImage subimage) { + ByteArrayOutputStream outputStream = null; + try { + /**如果根据坐标找不到人脸的时候*/ + if (UtilValidate.isNotEmpty(subimage)) { + outputStream = new ByteArrayOutputStream(); + ImageIO.write(subimage, "png", outputStream); + byte[] by = outputStream.toByteArray(); + /**将byte转为InputStream*/ + InputStream sbs = new ByteArrayInputStream(by); + return sbs; + } + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + public static InputStream encodeImgage(BufferedImage subimage, String imagetype) { + ByteArrayOutputStream outputStream = null; + try { + /**如果根据坐标找不到人脸的时候*/ + if (UtilValidate.isNotEmpty(subimage)) { + outputStream = new ByteArrayOutputStream(); + ImageIO.write(subimage, "png", outputStream); + byte[] by = outputStream.toByteArray(); + /**将byte转为InputStream*/ + InputStream sbs = new ByteArrayInputStream(by); + return sbs; + } + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 对返回的人脸坐标进行扩大处理 + * deelPostion + * + * @param picwidth 原图长 + * @param picheight 原图宽 + * @return ImgPositionVO + */ + public static PositionVO deelPostion(PositionVO positionVO, Integer picwidth, Integer picheight) { + + int xold = positionVO.getX(); + int yold = positionVO.getY(); + int widthold = positionVO.getW(); + int heightold = positionVO.getH(); + + int x = ((xold - widthold / 2)); + int y = (yold - heightold / 2); + int width = widthold * 2; + int height = heightold * 2; + if (width > picwidth) { + width = picwidth; + } + if (height > picheight) { + height = picheight; + } + + if (x + width > picwidth) { + x = picwidth-width; + } + if (x < 0) {x = 0;} + if (y + height > picheight) { + y = picheight-height ; + } + if (y < 0) { + y=0; + } + return new PositionVO(x, y, width, height); + } + + /** + * 根据坐标 获取头部位置 + * + * @param + * @param positionVo 坐标类 + * @return + */ + public static InputStream encodeHeadImage(BufferedImage bufferedImage, PositionVO positionVo) { + try { +// BufferedImage bufferedImage = ImageIO.read(url); + //获取整个背景图片的宽度和高度 +// int picWidth = bufferedImage.getWidth(); +// int picHeight = bufferedImage.getHeight(); +// +// int xOld = positionVo.getX(); +// int yOld = positionVo.getY(); +// int widthOld = positionVo.getW(); +// int heightOld = positionVo.getH(); +// +// int x = ((xOld - widthOld/2)); +// int y = (yOld - heightOld/2); +// int width = widthOld * 2; +// int height = heightOld * 2; +// if(width > picWidth) +// { +// width = picWidth; +// } +// if(height > picHeight) +// { +// height = picHeight; +// } +// +// if(x+width > picWidth) +// { +// x = x - picWidth; +// } +// +// if(x < 0) { +// x = 0; +// } +// if(y + height > picHeight) +// { +// y= y - picHeight; +// +// } +// if(y < 0) { +// y = 0; +// } + BufferedImage subimage = bufferedImage.getSubimage(positionVo.getX(), positionVo.getY(), positionVo.getW(), positionVo.getH()); + return encodeImgage(subimage); + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + return null; + } + + /** + * base64转成InputStream + * + * @param base64string + * @return + */ + public static InputStream BaseToInputStream(String base64string) { + try { + byte[] bytes = decodeBase64ToImage(base64string); + /**将byte转为InputStream*/ + InputStream sbs = new ByteArrayInputStream(bytes); + return sbs; + } catch (Exception e) { + logger.error(e.getMessage(), e); + + } + return null; + + } + + public static void main(String[] args) { +// URL url = null; +// try { +// url = new URL("http://img1.imgtn.bdimg.com/it/u=2064054871,2037178638&fm=200&gp=0.jpg"); +// } catch (MalformedURLException e) { +// e.printStackTrace(); +// } +// String encoderStr = Base64ImageUtils.encodeImgageToBase64(url); +// System.out.println(encoderStr); +// +// Base64ImageUtils.decodeBase64ToImage(encoderStr, "E:/", "football.jpg"); +// +// PositionVO positionVO = new PositionVO(); +// positionVO.setX(1080); +// positionVO.setY(657); +// positionVO.setW(34); +// positionVO.setH(43); +// positionVO.setBgHeight(607); +// positionVO.setBgWidth(1080); +//// PositionVO positionVO1 =Base64ImageUtils.deelPostion(positionVO,1080,607); +//// logger.info("结果",positionVO1); +// String a = "http://10.51.10.203:32080/g10203/M00/09/50/CjMKy14eqj-AKvQFAAlJMLj0vEY312.jpg"; +// +// +// BufferedImage bufferedImage = null; +// try { +// url = new URL("http://10.51.10.203:32080/g10203/M00/0B/16/CjMKy14e0hyAekdqAAEJd1FBfaY815.jpg"); +// } catch (MalformedURLException e) { +// e.printStackTrace(); +// } +// int x=694; +// int y=744; +// int w=240; +// int h=324; +// int bgw=1920; +// int bgh=1080; +// +// PositionVO positionVO=new PositionVO(); +// positionVO.setW(w); +// positionVO.setX(x); +// positionVO.setY(y); +// positionVO.setH(h); +// positionVO.setBgWidth(bgw); +// positionVO.setBgHeight(bgh); +// +// Gson gson=new Gson(); +// System.out.println(gson.toJson(positionVO)); +// BufferedImage bufferedImage=urlToBufferImage(url); +// PositionVO positionVO1=deelPostion(positionVO,positionVO.getBgWidth(),positionVO.getBgHeight()); +// System.out.println(gson.toJson(positionVO1)); +// BufferedImage bufferedImage2=bufferedImage.getSubimage(positionVO1.getX(),positionVO1.getY(),positionVO1.getW(),positionVO1.getH()); +// BufferedImage bufferedImage3=bufferedImage.getSubimage(positionVO.getX(),positionVO.getY(),positionVO.getW(),positionVO.getH()); +// +// +// +// try { +// File file1 =new File("D:/test/curtvedio/img/"+System.currentTimeMillis()+".png"); +// ImageIO.write(bufferedImage2, "png",file1); +// File file2 =new File("D:/test/curtvedio/img/"+System.currentTimeMillis()+".png"); +// ImageIO.write(bufferedImage3, "png",file2); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// +// +//// String encoderStr = Base64ImageUtils.encodeImgageToBase64(url); +//// System.out.println(encoderStr); +// +// +//// Base64ImageUtils.decodeBase64ToImage(encoderStr, "E:/", "football.jpg"); +//======= +// bufferedImage = Base64ImageUtils.urlToBufferImage(new URL(a)); +// +// } catch (MalformedURLException e) { +// e.printStackTrace(); +// } +// PositionVO positionVo = Base64ImageUtils.deelPostion(positionVO, bufferedImage.getWidth(), bufferedImage.getHeight()); +// positionVo.setBgHeight(bufferedImage.getHeight()); +// positionVo.setBgWidth(bufferedImage.getWidth()); +// InputStream in = Base64ImageUtils.encodeHeadImage(bufferedImage, positionVo); +// +// File file = new File("E:/footba.jpg");//文件名 相对路径(项目名根目录下) +// try { +// FileOutputStream fos = new FileOutputStream(file);//true表示追加,如果文件存在 向里面继续添加内容 +// byte[] bytes = new byte[1024]; +// while ((in.read(bytes)) != -1) { +// fos.write(bytes); +// } +// in.close(); +// fos.close();//关闭流 +// } catch (IOException e) { +// e.printStackTrace(); +// } +// +//>>>>>>> 6f675f6d18b0403c24529d795e1b57ca27a1f970 + + } + +} diff --git a/face-common/src/main/java/com/dkha/common/util/ContextUtil.java b/face-common/src/main/java/com/dkha/common/util/ContextUtil.java new file mode 100644 index 0000000..42175cd --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/ContextUtil.java @@ -0,0 +1,33 @@ +package com.dkha.common.util; + +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +/** + * @Author Spring + * @Since 2019/8/15 14:10 + * @Description Spring上下文工具类 + */ +public class ContextUtil { + + /** + * get request + * @return + */ + public static HttpServletRequest getRequest() { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + return request; + } + + /** + * get session + * @return + */ + public static HttpSession getSession() { + HttpSession session = getRequest().getSession(); + return session; + } +} diff --git a/face-common/src/main/java/com/dkha/common/util/DateUtils.java b/face-common/src/main/java/com/dkha/common/util/DateUtils.java new file mode 100644 index 0000000..9ddf9b2 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/DateUtils.java @@ -0,0 +1,1221 @@ +package com.dkha.common.util; + +import org.springframework.util.StringUtils; + +import java.beans.PropertyEditorSupport; +import java.sql.Timestamp; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * @Author Spring + * @Since 2016/8/15 14:10 + * @Description 日期工具类 + */ +public class DateUtils extends PropertyEditorSupport { + + public static final SimpleDateFormat date_sdf = new SimpleDateFormat("yyyy-MM-dd"); + public static final SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); + public static final SimpleDateFormat date_sdf_wz = new SimpleDateFormat("yyyy年MM月dd日"); + public static final SimpleDateFormat time_sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + public static final SimpleDateFormat yyyymmddhhmmss = new SimpleDateFormat("yyyyMMddHHmmss"); + public static final SimpleDateFormat short_time_sdf = new SimpleDateFormat("HH:mm"); + public static final SimpleDateFormat datetimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public static final SimpleDateFormat yyyyMM = new SimpleDateFormat("yyyy-MM"); + + /** + * 时间格式(yyyy-MM-dd HH:mm:ss) + */ + public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; + + // 以毫秒表示的时间 + private static final long DAY_IN_MILLIS = 24 * 3600 * 1000; + private static final long HOUR_IN_MILLIS = 3600 * 1000; + private static final long MINUTE_IN_MILLIS = 60 * 1000; + private static final long SECOND_IN_MILLIS = 1000; + + // 指定模式的时间格式 + private static SimpleDateFormat getSDFormat(String pattern) { + return new SimpleDateFormat(pattern); + } + + /** + * 当前日历,这里用中国时间表示 + * + * @return 以当地时区表示的系统当前日历 + */ + public static Calendar getCalendar() { + return Calendar.getInstance(); + } + + /** + * 指定毫秒数表示的日历 + * + * @param millis 毫秒数 + * @return 指定毫秒数表示的日历 + */ + public static Calendar getCalendar(long millis) { + Calendar cal = Calendar.getInstance(); + cal.setTime(new Date(millis)); + return cal; + } + + // //////////////////////////////////////////////////////////////////////////// + // getDate + // 各种方式获取的Date + // //////////////////////////////////////////////////////////////////////////// + + /** + * 当前日期 + * + * @return 系统当前时间 + */ + public static Date getDate() { + return new Date(); + } + + /** + * @param dt + * @return (1 = 星期天, 2 = 星期一, … … 7 = 星期六 + */ + public static int getWeekOfDate(Date dt) { + Calendar cal = Calendar.getInstance(); + cal.setTime(dt); + return cal.get(Calendar.DAY_OF_WEEK); + } + + /** + * 获取指定时间属于周几 + * + * @param date 指定日期 + * @return + */ + public static int getChinaWeekOfDate(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + int week = cal.get(Calendar.DAY_OF_WEEK) - 1; + if (week == 0) { + week = 7; + } + return week; + } + + /** + * 指定毫秒数表示的日期 + * + * @param millis 毫秒数 + * @return 指定毫秒数表示的日期 + */ + public static Date getDate(long millis) { + return new Date(millis); + } + + /** + * 时间戳转换为字符串 + * + * @param time + * @return + */ + public static String timestamptoStr(Timestamp time) { + Date date = null; + if (null != time) { + date = new Date(time.getTime()); + } + return date2Str(date_sdf); + } + + /** + * 字符串转换时间戳 + * + * @param str + * @return + */ + public static Timestamp str2Timestamp(String str) { + Date date = str2Date(str, date_sdf); + return new Timestamp(date.getTime()); + } + + /** + * 字符串转换成日期 + * + * @param str + * @param sdf + * @return + */ + public static Date str2Date(String str, SimpleDateFormat sdf) { + if (null == str || "".equals(str)) { + return null; + } + Date date = null; + try { + date = sdf.parse(str); + return date; + } catch (ParseException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 日期转换为字符串 + * + * @param date_sdf 日期格式 + * @return 字符串 + */ + public static String date2Str(SimpleDateFormat date_sdf) { + Date date = getDate(); + if (null == date) { + return null; + } + return date_sdf.format(date); + } + + /** + * 格式化时间 + * + * @param date + * @param format + * @return + */ + public static String dateformat(String date, String format) { + SimpleDateFormat sformat = new SimpleDateFormat(format); + Date _date = null; + try { + _date = sformat.parse(date); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return sformat.format(_date); + } + + /** + * 日期转换为字符串 + * + * @param date 日期 + * @param date_sdf 日期格式 + * @return 字符串 + */ + public static String date2Str(Date date, SimpleDateFormat date_sdf) { + if (null == date) { + return null; + } + return date_sdf.format(date); + } + + /** + * 日期转换为字符串 + * + * @param format 日期格式 + * @return 字符串 + */ + public static String getDate(String format) { + Date date = new Date(); + if (null == date) { + return null; + } + SimpleDateFormat sdf = new SimpleDateFormat(format); + return sdf.format(date); + } + + /** + * 指定毫秒数的时间戳 + * + * @param millis 毫秒数 + * @return 指定毫秒数的时间戳 + */ + public static Timestamp getTimestamp(long millis) { + return new Timestamp(millis); + } + + /** + * 以字符形式表示的时间戳 + * + * @param time 毫秒数 + * @return 以字符形式表示的时间戳 + */ + public static Timestamp getTimestamp(String time) { + return new Timestamp(Long.parseLong(time)); + } + + /** + * 系统当前的时间戳 + * + * @return 系统当前的时间戳 + */ + public static Timestamp getTimestamp() { + return new Timestamp(new Date().getTime()); + } + + /** + * 指定日期的时间戳 + * + * @param date 指定日期 + * @return 指定日期的时间戳 + */ + public static Timestamp getTimestamp(Date date) { + return new Timestamp(date.getTime()); + } + + /** + * 指定日历的时间戳 + * + * @param cal 指定日历 + * @return 指定日历的时间戳 + */ + public static Timestamp getCalendarTimestamp(Calendar cal) { + return new Timestamp(cal.getTime().getTime()); + } + + public static Timestamp gettimestamp() { + Date dt = new Date(); + DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String nowTime = df.format(dt); + Timestamp buydate = Timestamp.valueOf(nowTime); + return buydate; + } + + // //////////////////////////////////////////////////////////////////////////// + // getMillis + // 各种方式获取的Millis + // //////////////////////////////////////////////////////////////////////////// + + /** + * 系统时间的毫秒数 + * + * @return 系统时间的毫秒数 + */ + public static long getMillis() { + return new Date().getTime(); + } + + /** + * 指定日历的毫秒数 + * + * @param cal 指定日历 + * @return 指定日历的毫秒数 + */ + public static long getMillis(Calendar cal) { + return cal.getTime().getTime(); + } + + /** + * 指定日期的毫秒数 + * + * @param date 指定日期 + * @return 指定日期的毫秒数 + */ + public static long getMillis(Date date) { + return date.getTime(); + } + + /** + * 指定时间戳的毫秒数 + * + * @param ts 指定时间戳 + * @return 指定时间戳的毫秒数 + */ + public static long getMillis(Timestamp ts) { + return ts.getTime(); + } + + // //////////////////////////////////////////////////////////////////////////// + // formatDate + // 将日期按照一定的格式转化为字符串 + // //////////////////////////////////////////////////////////////////////////// + + /** + * 默认方式表示的系统当前日期,具体格式:年-月-日 + * + * @return 默认日期按“年-月-日“格式显示 + */ + public static String formatDate() { + return date_sdf.format(getCalendar().getTime()); + } + + /** + * 获取时间字符串 + */ + public static String getDataString(SimpleDateFormat formatstr) { + return formatstr.format(getCalendar().getTime()); + } + + /** + * 指定日期的默认显示,具体格式:年-月-日 + * + * @param cal 指定的日期 + * @return 指定日期按“年-月-日“格式显示 + */ + public static String formatDate(Calendar cal) { + return date_sdf.format(cal.getTime()); + } + + /** + * 指定日期的默认显示,具体格式:年-月-日 + * + * @param date 指定的日期 + * @return 指定日期按“年-月-日“格式显示 + */ + public static String formatDate(Date date) { + return date_sdf.format(date); + } + + /** + * 指定毫秒数表示日期的默认显示,具体格式:年-月-日 + * + * @param millis 指定的毫秒数 + * @return 指定毫秒数表示日期按“年-月-日“格式显示 + */ + public static String formatDate(long millis) { + return date_sdf.format(new Date(millis)); + } + + /** + * 默认日期按指定格式显示 + * + * @param pattern 指定的格式 + * @return 默认日期按指定格式显示 + */ + public static String formatDate(String pattern) { + return getSDFormat(pattern).format(getCalendar().getTime()); + } + + /** + * 指定日期按指定格式显示 + * + * @param cal 指定的日期 + * @param pattern 指定的格式 + * @return 指定日期按指定格式显示 + */ + public static String formatDate(Calendar cal, String pattern) { + return getSDFormat(pattern).format(cal.getTime()); + } + + /** + * 指定日期按指定格式显示 + * + * @param date 指定的日期 + * @param pattern 指定的格式 + * @return 指定日期按指定格式显示 + */ + public static String formatDate(Date date, String pattern) { + return getSDFormat(pattern).format(date); + } + + // //////////////////////////////////////////////////////////////////////////// + // formatTime + // 将日期按照一定的格式转化为字符串 + // //////////////////////////////////////////////////////////////////////////// + + /** + * 默认方式表示的系统当前日期,具体格式:年-月-日 时:分 + * + * @return 默认日期按“年-月-日 时:分“格式显示 + */ + public static String formatTime() { + return time_sdf.format(getCalendar().getTime()); + } + + /** + * 指定毫秒数表示日期的默认显示,具体格式:年-月-日 时:分 + * + * @param millis 指定的毫秒数 + * @return 指定毫秒数表示日期按“年-月-日 时:分“格式显示 + */ + public static String formatTime(long millis) { + return time_sdf.format(new Date(millis)); + } + + /** + * 指定日期的默认显示,具体格式:年-月-日 时:分 + * + * @param cal 指定的日期 + * @return 指定日期按“年-月-日 时:分“格式显示 + */ + public static String formatTime(Calendar cal) { + return time_sdf.format(cal.getTime()); + } + + /** + * 指定日期的默认显示,具体格式:年-月-日 时:分 + * + * @param date 指定的日期 + * @return 指定日期按“年-月-日 时:分“格式显示 + */ + public static String formatTime(Date date) { + return time_sdf.format(date); + } + + // //////////////////////////////////////////////////////////////////////////// + // formatShortTime + // 将日期按照一定的格式转化为字符串 + // //////////////////////////////////////////////////////////////////////////// + + /** + * 默认方式表示的系统当前日期,具体格式:时:分 + * + * @return 默认日期按“时:分“格式显示 + */ + public static String formatShortTime() { + return short_time_sdf.format(getCalendar().getTime()); + } + + /** + * 指定毫秒数表示日期的默认显示,具体格式:时:分 + * + * @param millis 指定的毫秒数 + * @return 指定毫秒数表示日期按“时:分“格式显示 + */ + public static String formatShortTime(long millis) { + return short_time_sdf.format(new Date(millis)); + } + + /** + * 指定日期的默认显示,具体格式:时:分 + * + * @param cal 指定的日期 + * @return 指定日期按“时:分“格式显示 + */ + public static String formatShortTime(Calendar cal) { + return short_time_sdf.format(cal.getTime()); + } + + /** + * 指定日期的默认显示,具体格式:时:分 + * + * @param date 指定的日期 + * @return 指定日期按“时:分“格式显示 + */ + public static String formatShortTime(Date date) { + return short_time_sdf.format(date); + } + + // //////////////////////////////////////////////////////////////////////////// + // parseDate + // parseCalendar + // parseTimestamp + // 将字符串按照一定的格式转化为日期或时间 + // //////////////////////////////////////////////////////////////////////////// + + /** + * 根据指定的格式将字符串转换成Date 如输入:2003-11-19 11:20:20将按照这个转成时间 + * + * @param src 将要转换的原始字符窜 + * @param pattern 转换的匹配格式 + * @return 如果转换成功则返回转换后的日期 + * @throws ParseException + * @throws ParseException + */ + public static Date parseDate(String src, String pattern) + throws ParseException { + return getSDFormat(pattern).parse(src); + + } + + /** + * 根据指定的格式将字符串转换成Date 如输入:2003-11-19 11:20:20将按照这个转成时间 + * + * @param src 将要转换的原始字符窜 + * @param pattern 转换的匹配格式 + * @return 如果转换成功则返回转换后的日期 + * @throws ParseException + * @throws ParseException + */ + public static Calendar parseCalendar(String src, String pattern) + throws ParseException { + + Date date = parseDate(src, pattern); + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + return cal; + } + + public static String formatAddDate(String src, String pattern, int amount) + throws ParseException { + Calendar cal; + cal = parseCalendar(src, pattern); + cal.add(Calendar.DATE, amount); + return formatDate(cal); + } + + /** + * 根据指定的格式将字符串转换成Date 如输入:2003-11-19 11:20:20将按照这个转成时间 + * + * @param src 将要转换的原始字符窜 + * @param pattern 转换的匹配格式 + * @return 如果转换成功则返回转换后的时间戳 + * @throws ParseException + * @throws ParseException + */ + public static Timestamp parseTimestamp(String src, String pattern) + throws ParseException { + Date date = parseDate(src, pattern); + return new Timestamp(date.getTime()); + } + + // //////////////////////////////////////////////////////////////////////////// + // dateDiff + // 计算两个日期之间的差值 + // //////////////////////////////////////////////////////////////////////////// + + /** + * 计算两个时间之间的差值,根据标志的不同而不同 + * + * @param flag 计算标志,表示按照年/月/日/时/分/秒等计算 + * @param calSrc 减数 + * @param calDes 被减数 + * @return 两个日期之间的差值 + */ + public static int dateDiff(char flag, Calendar calSrc, Calendar calDes) { + + long millisDiff = getMillis(calSrc) - getMillis(calDes); + + if (flag == 'y') { + return (calSrc.get(calSrc.YEAR) - calDes.get(calDes.YEAR)); + } + /*月*/ + if (flag == 'M') { + return (calSrc.get(calSrc.MONTH) - calDes.get(calDes.MONTH)); + } + //这里的一天是指60*60*24这个毫秒数 + if (flag == 'd') { + return (int) (millisDiff / DAY_IN_MILLIS); + } + //这里的一天是指天文学上面的一天 + if (flag == 'D') { + return (calSrc.get(calSrc.DAY_OF_YEAR) - calDes.get(calDes.DAY_OF_YEAR)); + } + + if (flag == 'h') { + return (int) (millisDiff / HOUR_IN_MILLIS); + } + + if (flag == 'm') { + return (int) (millisDiff / MINUTE_IN_MILLIS); + } + + if (flag == 's') { + return (int) (millisDiff / SECOND_IN_MILLIS); + } + + return 0; + } + + /** + * 计算两个时间之间的差值,根据标志的不同而不同 + * + * @param flag 计算标志,表示按照年/月/日/时/分/秒等计算 + * @param start 开始日期 + * @param end 结束日期 + * @return 两个日期之间的差值 + */ + public static int dateDiff(char flag, Date start, Date end) { + Calendar s = date2Calendar(start); + Calendar e = date2Calendar(end); + return dateDiff(flag, e, s); + } + + /** + * 计算两个时间之间相差的天数 + * + * @param start 开始日期 + * @param end 结束日期 + */ + public static int dayDiff(Date start, Date end) { + return dateDiff('d', start, end); + } + + /** + * String类型 转换为Date, + * 如果参数长度为10 转换格式”yyyy-MM-dd“ + * 如果参数长度为19 转换格式”yyyy-MM-dd HH:mm:ss“ + * * @param text + * String类型的时间值 + */ + public void setAsText(String text) throws IllegalArgumentException { + if (StringUtils.hasText(text)) { + try { + if (text.indexOf(":") == -1 && text.length() == 10) { + setValue(this.date_sdf.parse(text)); + } else if (text.indexOf(":") > 0 && text.length() == 19) { + setValue(this.datetimeFormat.parse(text)); + } else { + throw new IllegalArgumentException( + "Could not parse date, date format is error "); + } + } catch (ParseException ex) { + IllegalArgumentException iae = new IllegalArgumentException( + "Could not parse date: " + ex.getMessage()); + iae.initCause(ex); + throw iae; + } + } else { + setValue(null); + } + } + + public static int getYear() { + GregorianCalendar calendar = new GregorianCalendar(); + calendar.setTime(getDate()); + return calendar.get(Calendar.YEAR); + } + + public static int getHour() { + GregorianCalendar calendar = new GregorianCalendar(); + calendar.setTime(getDate()); + return calendar.get(Calendar.HOUR_OF_DAY); + } + + public static int getMinute() { + GregorianCalendar calendar = new GregorianCalendar(); + calendar.setTime(getDate()); + return calendar.get(Calendar.MINUTE); + } + + public static int getYear(Date date) { + GregorianCalendar calendar = new GregorianCalendar(); + calendar.setTime(date); + return calendar.get(Calendar.YEAR); + } + + /** + * 获取date当天的开始时间 + * + * @return Date + */ + public static Date getDayStartTime(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + Date start = calendar.getTime(); + return start; + } + + /** + * 获取date当天的开始时间 + * + * @return String + */ + public static String getDayStartTimeByString(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return sdf.format(getDayStartTime(date)); + } + + /** + * 获取date当天的结束时间 + * + * @return + */ + public static Date getDayEndTime(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + Date start = calendar.getTime(); + calendar.add(Calendar.DAY_OF_MONTH, 1); + calendar.add(Calendar.SECOND, -1); + Date end = calendar.getTime(); + return end; + } + + /** + * 获取Date当天的结束时间 + * + * @return String + */ + public static String getDayEndTimeByString(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return sdf.format(getDayEndTime(date)); + } + + /** + * 向前推算时间 + * + * @param date 基础时间,以此时间为基础开始推算 + * @param days 向前推算天数 + * @return 推算结果 + */ + public static Date getDateBeforeByDay(Date date, int days) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - days); + return calendar.getTime(); + } + + /** + * 向后推算时间 + * + * @param date 基础时间,以此时间为基础开始推算 + * @param days 向后推算天数 + * @return 推算结果 + */ + public static Date getDateAfterByDay(Date date, int days) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) + days); + return calendar.getTime(); + } + + /** + * 向后推算事件 + * + * @param date + * @param minutes + * @return + */ + public static Date getDateAfterByMinutes(Date date, int minutes) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.MINUTE, calendar.get(Calendar.MINUTE) + minutes); + return calendar.getTime(); + } + + /** + * 向前推算事件 + * + * @param date + * @param minutes + * @return + */ + public static Date getDateBeforeMyMinutes(Date date, int minutes) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.MINUTE, calendar.get(Calendar.MINUTE) - minutes); + return calendar.getTime(); + } + + /** + * 向前推算时间 + * + * @param date 基础时间,以此时间为基础开始推算 + * @param months 向前推算月份数 + * @return + */ + public static Date getDateBeforeByMonth(Date date, int months) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.MONTH, -months); + return calendar.getTime(); + } + + /** + * 向后推算时间 + * + * @param date 基础时间,以此时间为基础开始推算 + * @param months 向后推算月份数 + * @return + */ + public static Date getDateAfterByMonth(Date date, int months) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.MONTH, months); + return calendar.getTime(); + } + + /** + * 向前推算时间 + * + * @param date 基础时间, 以此时间为基础时间开始推算 + * @param hours 向前推算的小时数 + * @param minutes 向前推算的分钟数 + * @return + */ + public static Date getDateBeforeByHoursAndMinutes(Date date, int hours, int minutes) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - hours); + calendar.set(Calendar.MINUTE, calendar.get(calendar.MINUTE) - minutes); + return calendar.getTime(); + } + + /** + * 向后推算时间 + * + * @param date 基础时间,以此时间为基础时间开始推算 + * @param hours 向后推算的小时数 + * @param minutes 向后推算的分钟数 + * @return + */ + public static Date getDateAfterByHoursAndMinutes(Date date, int hours, int minutes) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.HOUR_OF_DAY, hours); + calendar.add(Calendar.MINUTE, minutes); + return calendar.getTime(); + } + + /** + * date2Calendar + * + * @param date + * @return + */ + public static Calendar date2Calendar(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + return calendar; + } + + /** + * calendar2Date + * + * @param calendar + * @return + */ + public static Date calendar2Date(Calendar calendar) { + Date date = calendar.getTime(); + return date; + } + + /** + * 获取当前月份 + * + * @return + */ + public static int getCurrentMonth() { + Calendar calendar = Calendar.getInstance(); + calendar.setTimeInMillis(System.currentTimeMillis()); + return calendar.get(calendar.MONTH) + 1; + } + + /** + * 获取时间月份 + * + * @param date + * @return + */ + public static int getMonthByDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + return calendar.get(calendar.MONTH) + 1; + } + + /** + * 获取当前是哪一天 + * + * @return + */ + public static int getCurrentDay() { + Calendar calendar = Calendar.getInstance(); + calendar.setTimeInMillis(System.currentTimeMillis()); + return calendar.get(calendar.DAY_OF_MONTH); + } + + /** + * 获取当前date中的号数 + * + * @param date + * @return + */ + public static int getCurrentDayByDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + return calendar.get(calendar.DAY_OF_MONTH); + } + + /** + * 获取当前年 + * + * @return + */ + public static int getCurrentYear() { + Calendar calendar = Calendar.getInstance(); + calendar.setTimeInMillis(System.currentTimeMillis()); + return calendar.get(calendar.YEAR); + } + + /** + * 获取Date对应的Month的第一天 + * + * @param date + * @return + */ + public static String getMonthFirstDayByDate(Date date) { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.add(Calendar.MONTH, 0); + c.set(Calendar.DAY_OF_MONTH, 1);//设置为1号,当前日期既为本月第一天 + return format.format(c.getTime()); + + } + + /** + * 获取Date对应的Month的最后一天 + * + * @param date + * @return + */ + public static String getMonthLastDayByDate(Date date) { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + Calendar cale = Calendar.getInstance(); + cale.setTime(date); + cale.set(Calendar.DAY_OF_MONTH, 0);//设置为1号,当前日期既为本月第一天 + return format.format(cale.getTime()); + } + + /** + * 计算是否为平年闰年 + * + * @param year + * @return + */ + public static Boolean isLeapYear(int year) { + if (year % 100 == 0) { + if (year % 400 == 0) { + return true; + } + } else { + if (year % 4 == 0) { + return true; + } + } + return false; + } + + public static int getLastDayOfMonth(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + final int lastDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); + return lastDay; + } + + /** + * 将12:00这种格式的时间转换为javaDate类型时间,其中的年月日为当前时间的年月日 + * + * @param dateStr + * @return + */ + public static Date hourAndMinuteStr2Date(String dateStr) { + int year = getCurrentYear(); + int month = getCurrentMonth(); + int day = getCurrentDay(); + dateStr = year + "-" + month + "-" + day + " " + dateStr; + Date date = str2Date(dateStr, new SimpleDateFormat("yyyy-MM-dd HH:mm")); + return date; + } + + /** + * 根据传入的Date,将12:00这种格式的时间转换为javaDate类型时间,其中的年月日为date对应的年月日 + * + * @param dateStr + * @param date + * @return + */ + public static Date hourAndMinuteStr2Date(String dateStr, Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + int year = calendar.get(Calendar.YEAR); + int month = calendar.get(Calendar.MONTH) + 1; + int day = calendar.get(Calendar.DAY_OF_MONTH); + dateStr = year + "-" + month + "-" + day + " " + dateStr; + Date resultDate = str2Date(dateStr, new SimpleDateFormat("yyyy-MM-dd HH:mm")); + return resultDate; + } + + /** + * 获取时间中的小时和分钟 如23:12 + * + * @param date + * @return 23:12 + */ + public static String getDateHourAndMinuteStr(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + String hour = calendar.get(Calendar.HOUR_OF_DAY) + ""; + String minute = calendar.get(Calendar.MINUTE) + ""; + if (hour.length() == 1) { + hour = "0" + hour; + } + if (minute.length() == 1) { + minute = "0" + minute; + } + return hour + ":" + minute; + } + + /** + * 获取和东八区对应的时区差 如果返回结果小于0,说明所在的时区低于东八区,反之高于东八区 + * + * @param dateArea + * @return mapd的key分别为hour和minute分别对应相差的小时和分钟数 + */ + public static Map getDateAreaDiff(String dateArea) { + /*判断时区*/ + int hoursDiff = 0; //相差的小时数,如果为负数,表示时间慢于北京时间,反之快于北京时间 + int minutesDiff = 0; //相差的分钟数,如果为负数,表示时间慢于北京时间,反之快于北京时间 + if (dateArea.contains("-")) { //如果为西时区,东时区快于西时区 + dateArea = dateArea.replace("-", ""); + double timeDiff = (Double.parseDouble(dateArea) / 100) + 8; //相差的时间 + String timeDiffStr = timeDiff + ""; + if (Double.toString(timeDiff).contains(".")) { //如果为非整数小时差 + String[] timeSplits = timeDiffStr.split("\\."); + hoursDiff = 0 - Integer.parseInt(timeSplits[0]); + minutesDiff = 0 - Integer.parseInt(timeSplits[1]); + } else { + hoursDiff = 0 - (int) timeDiff; //相差整数小时数 + } + } else { //为东时区 + dateArea = dateArea.replace("+", ""); + if (Double.parseDouble(dateArea) / 100 - 8 > 0) { //如果所在时区大于东八区 + double timeDiff = (Double.parseDouble(dateArea) / 100) - 8; //相差的时间 + String timeDiffStr = timeDiff + ""; + if (timeDiffStr.contains(".")) { //如果相差为非整数小时差 + String[] timeSplits = timeDiffStr.split("\\."); + hoursDiff = Integer.parseInt(timeSplits[0]); + minutesDiff = Integer.parseInt(timeSplits[1]); + } else { //相差为整数小时差 + hoursDiff = (int) timeDiff; + } + } else { //如果所在的时区低于东八区 + String currentDateArea = Double.toString(Double.parseDouble(dateArea) / 100); + if (currentDateArea.contains(".")) { //如果所在的时区不为整数时区 + /*以60进制计算时间差*/ + String[] splits = currentDateArea.split("\\."); + int currentDate = 60 * Integer.parseInt(splits[0]) + (int) (Double.parseDouble(splits[1])); + int BeiJingDate = 8 * 60; + int dateDiff = currentDate - BeiJingDate; //获取相差分钟数 + hoursDiff = dateDiff / 60; + minutesDiff = dateDiff % 60; + } else { //如果所在的时区为整数时区 + double timeDiff = Double.parseDouble(currentDateArea); //相差的时间 + hoursDiff = (int) timeDiff; + } + } + } + Map map = new HashMap(); + map.put("hour", hoursDiff); + map.put("minute", minutesDiff); + return map; + } + + /** + * 格式化字符串形式日期 + * + * @param date + * @param yyyyMMdd + * @return + */ + public static String formatDateStr(String date, SimpleDateFormat yyyyMMdd) { + try { + Date parse = yyyyMMdd.parse(date); + return yyyyMMdd.format(parse); + } catch (ParseException e) { + return null; + } + } + + public static long getFirstDayNextNextWeek() { + Calendar calc = Calendar.getInstance(); + //设置一周的第一天是星期一 + calc.setFirstDayOfWeek(Calendar.MONDAY); + //在今天的基础上加一周 + calc.add(Calendar.WEEK_OF_YEAR, 1); + //获取当前设置的一周第一天 + int initDay = calc.getFirstDayOfWeek();// 每个星期的第一天根据locale不同而不同 + //下周的第一天 + calc.set(Calendar.DAY_OF_WEEK, initDay); + // 下下周的第一天(+7) + calc.add(Calendar.DAY_OF_MONTH, 7); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateStr = sdf.format(calc.getTime()); + dateStr += " 00:00:00"; + Long time = calc.getTimeInMillis(); + try { + Date date = datetimeFormat.parse(dateStr); + time = date.getTime(); + } catch (ParseException e) { + e.printStackTrace(); + } + return time; + } + + /** + * 通过年份计算年龄 + * + * @param birthday + * @return + */ + public static int getAgeByYear(Date birthday) { + if (birthday == null) { + return 0; + } + Date now = new Date(System.currentTimeMillis()); + SimpleDateFormat yyyy = new SimpleDateFormat("yyyy"); + String birthYear = yyyy.format(birthday); + String nowYear = yyyy.format(now); + return Integer.parseInt(nowYear) - Integer.parseInt(birthYear); + + } + + public static int getAge(Date birthDay) { +// long now = System.currentTimeMillis(); +// long birth = birthDay.getTime(); +// return (int)((now-birth)/(long)365*24*60*60*1000); + Calendar cal = Calendar.getInstance(); + if (cal.before(birthDay)) { //出生日期晚于当前时间,无法计算 + throw new IllegalArgumentException( + "The birthDay is before Now.It's unbelievable!"); + } + int yearNow = cal.get(Calendar.YEAR); //当前年份 + int monthNow = cal.get(Calendar.MONTH); //当前月份 + int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期 + cal.setTime(birthDay); + int yearBirth = cal.get(Calendar.YEAR); + int monthBirth = cal.get(Calendar.MONTH); + int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH); + int age = yearNow - yearBirth; //计算整岁数 + if (monthNow <= monthBirth) { + if (monthNow == monthBirth) { + if (dayOfMonthNow < dayOfMonthBirth) { + age--;//当前日期在生日之前,年龄减一 + } + } else { + age--;//当前月份在生日之前,年龄减一 + } + } + return age; + } + + /*public Date getDateByLocal(Locale locale) { + new Date() + }*/ + + /** + * 获取一天开始时间 eg 00:00:00 + * + * @param date + * @return + */ + public static Date getDayBegin(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + return calendar.getTime(); + } + + /** + * 获取一天结束时间 eg 23:59:59 + * + * @param date + * @return + */ + public static Date getDayEnd(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 23); + calendar.set(Calendar.MINUTE, 59); + calendar.set(Calendar.SECOND, 59); + return calendar.getTime(); + } + + public static void main(String[] args) throws ParseException { + System.out.println(DateUtils.getMonthLastDayByDate(new Date(2017 - 1900, 2, 1))); + } +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/util/EnumUtil.java b/face-common/src/main/java/com/dkha/common/util/EnumUtil.java new file mode 100644 index 0000000..6525fa9 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/EnumUtil.java @@ -0,0 +1,186 @@ +package com.dkha.common.util; + + + +import java.lang.reflect.Field; +import java.util.*; +import java.util.stream.Collectors; + +/** + * Created by Bray.ye on 2016/12/22 16:54. + */ +public class EnumUtil { + + private final static String KEY = "code"; + private final static String VALUE = "name"; + //权重,用于排序 + private final static String WEIGHT = "weight"; + + /** + * 枚举转map + * @param enumClazz + * @param + * @return + */ + public final static > Map toMap(Class enumClazz) { + Map map = new HashMap<>(); + try { + Field code_ = enumClazz.getDeclaredField(KEY); + Field name_ = enumClazz.getDeclaredField(VALUE); + code_.setAccessible(true); + name_.setAccessible(true); + EnumSet xes = EnumSet.allOf(enumClazz); + map = xes.stream().collect(Collectors.toMap( + x -> { + String code = null; + try { + code = (String) code_.get(x); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + return code; + }, + x -> { + String name = null; + try { + name = (String) name_.get(x); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + return name; + } + )); + /* for (X x : xes) { + String code = (String) code_.get(x); + String name = (String) name_.get(x); + map.put(code, name); + //System.out.println(code + ", " +name); + }*/ + } catch (Exception e) { + e.printStackTrace(); + } + return map; + } + + + /** + * 枚举转map(根绝权重weight排序, 排升序) + * @param enumClazz + * @param + * @return + */ + public final static > Map toMapSortByWeight(Class enumClazz) { + //用于保存有序结果集 + List sortList = new ArrayList<>(); + Map resultMap = new LinkedHashMap<>(); + try { + Field code_ = enumClazz.getDeclaredField(KEY); + Field name_ = enumClazz.getDeclaredField(VALUE); + Field weight_ = enumClazz.getDeclaredField(WEIGHT); + code_.setAccessible(true); + name_.setAccessible(true); + EnumSet xes = EnumSet.allOf(enumClazz); + for (X x : xes) { + InnerSortDS innerSortDS = new InnerSortDS(); + innerSortDS.setCode((String) code_.get(x)); + innerSortDS.setName((String) name_.get(x)); + innerSortDS.setWeight((int) weight_.get(x)); + sortList.add(innerSortDS); + } + } catch (Exception e) { + e.printStackTrace(); + } + if (sortList != null && sortList.size() > 0) { + int listLength = sortList.size(); + InnerSortDS innerSortDSTemp; + //冒泡排降序 + for (int i = 0; i < listLength - 1; i++) { + for (int j = i; j < listLength; j++) { + if (sortList.get(i).getWeight() > sortList.get(j).getWeight()) { + innerSortDSTemp = sortList.get(j); + sortList.set(j, sortList.get(i)); + sortList.set(i, innerSortDSTemp); + } + } + } + + /**遍历排序后的list,并转为map*/ + for (InnerSortDS innerSortDS : sortList) { + resultMap.put(innerSortDS.getCode(), innerSortDS.getName()); + } + } + return resultMap; + } + /** + * 枚举转list + * @param enumClazz + * @param + * @return + */ + public final static > List> toList(Class enumClazz) { + List> list = toMap(enumClazz).entrySet().stream().map(entry -> { + Map map = new HashMap(); + map.put(KEY, entry.getKey()); + map.put(VALUE, entry.getValue()); + return map; + }).collect(Collectors.toList()); + /*List> list = new ArrayList<>(); + for (Map.Entry entry : toMap(enumClazz).entrySet()) { + Map map = new HashMap(); + map.put(KEY, entry.getKey()); + map.put(VALUE, entry.getValue()); + list.add(map); + }*/ + return list; + } + + /** + * 通过code获取name + * @param enumClazz + * @param + * @return + */ + public final static > String getNameByCode(String code, Class enumClazz) { + Map map = toMap(enumClazz); + if (UtilValidate.isNotEmpty(map)) { + return map.get(code); + } + return null; + } + + /** + * 用于排序内部类(数据结构) + */ + static class InnerSortDS { + + private String code; + private String name; + /** 排序权重 */ + private int weight; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getWeight() { + return weight; + } + + public void setWeight(int weight) { + this.weight = weight; + } + } + +} diff --git a/face-common/src/main/java/com/dkha/common/util/ExcelUtils.java b/face-common/src/main/java/com/dkha/common/util/ExcelUtils.java new file mode 100644 index 0000000..1a99b1a --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/ExcelUtils.java @@ -0,0 +1,403 @@ + +package com.dkha.common.util; + + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import com.dkha.common.exception.DkException; +import com.dkha.common.exception.EmployeeException; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.io.ClassPathResource; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import static org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BLANK; + +/** + * excel工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class ExcelUtils { + private static Logger logger = LoggerFactory.getLogger(ExcelUtils.class); + + /** + * 获取workbook对象 + * + * @param multipartFile + * @return + * @throws Exception + */ + public static Workbook getWorkbook(MultipartFile multipartFile) throws Exception { + if (multipartFile.isEmpty()) { + throw new EmployeeException("文件不存在"); + } + if (!multipartFile.getOriginalFilename().endsWith("xls") && !multipartFile.getOriginalFilename().endsWith("xlsx")) { + + throw new EmployeeException("请上传excel文件"); + } + Workbook workbook = null; + InputStream is = multipartFile.getInputStream(); + if (multipartFile.getOriginalFilename().endsWith("xls")) { + workbook = new HSSFWorkbook(is); + } + if (multipartFile.getOriginalFilename().endsWith("xlsx")) { + workbook = new XSSFWorkbook(is); + } + return workbook; + } + + + /** + * Excel导出 + * + * @param response response + * @param fileName 文件名 + * @param list 数据List + * @param pojoClass 对象Class + */ + public static void exportExcel(HttpServletResponse response, String fileName, ArrayList list, + Class pojoClass) throws Exception { + if (StringUtils.isBlank(fileName)) { + //当前日期 + fileName = DateUtils.formatDate(new Date()); + } + Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), pojoClass, list); + write(response, workbook, fileName); + + } + + /** + * 导出excel表头 + * + * @param response + * @param pojo + * @param + */ + public static Workbook downloadTemplate(HttpServletResponse response, Class pojo) throws Exception { + String[] swaggerValues = getSwaggerValue(pojo); + Workbook workbook = new HSSFWorkbook(); + Sheet sheet = workbook.createSheet(); + Row row = sheet.createRow(0); + for (int i = 0; i < swaggerValues.length; i++) { + row.createCell(i).setCellValue(swaggerValues[i]); + } +// //锁定第一行无法修改 +// sheet.createFreezePane(0, 1, 0, 1); + + return workbook; + } + + + /** + * 获取swagger属性值 + * + * @param pojoClass + * @return + * @author hechenggang + */ + public static String[] getSwaggerValue(Class pojoClass) { + Field[] fields = pojoClass.getDeclaredFields(); + Field field; + int length = fields.length; + String[] value = new String[length]; + for (int i = 0; i < length; i++) { + fields[i].setAccessible(true); + } + for (int i = 0; i < length; i++) { + try { + field = pojoClass.getDeclaredField(fields[i].getName()); + ApiModelProperty apiModelProperty = field.getAnnotation(ApiModelProperty.class); + if (apiModelProperty != null) { + value[i] = apiModelProperty.value(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return value; + } + + + /** + * // * Excel导出,先sourceList转换成List,再导出 + * // * + * // * @param response response + * // * @param fileName 文件名 + * // * @param sourceList 原数据List + * // * @param targetClass 目标对象Class + * // + */ +// public static void exportExcelToTarget(HttpServletResponse response, String fileName, Collection sourceList, +// Class targetClass) throws Exception { +// List targetList = new ArrayList<>(sourceList.size()); +// for (Object source : sourceList) { +// Object target = targetClass.newInstance(); +// BeanUtils.copyProperties(source, target); +// targetList.add(target); +// } +// +// exportExcel(response, fileName, targetList, targetClass); +// } + +// public static List readExcel(MultipartFile file, int sheetNo, int startRowNo, int startColNo, int fieldRowNo) +// throws Exception { +// Workbook wb = null; +// String fileName = file.getOriginalFilename(); +// String extString = StringUtils.substringAfterLast(fileName, "."); +// if ("xls".equalsIgnoreCase(extString)) { +// wb = new HSSFWorkbook(file.getInputStream()); +// } else if ("xlsx".equalsIgnoreCase(extString)) { +// wb = new XSSFWorkbook(file.getInputStream()); +// } else { +// throw new Exception("请上传Excel文件!"); +// } +// Map map = null; +// Row row = null; +// Sheet sheet = wb.getSheetAt(sheetNo); +// Row fieldRow = sheet.getRow(fieldRowNo); +// int rowNum = sheet.getPhysicalNumberOfRows(); +// int colNum = fieldRow.getPhysicalNumberOfCells(); +// List datas = new ArrayList(); +// for (int i = startRowNo; i <= rowNum; i++) { +// map = new HashMap(); +// row = sheet.getRow(i); +// for (int j = startColNo; j < colNum; j++) { +// map.put(getCellContent(fieldRow.getCell(j)), getCellContent(row.getCell(j))); +// } +// datas.add(map); +// } +// return datas; +// } +// +// private static String getCellContent(Cell cell) { +// if (null == cell) { +// return null; +// } +// StringBuffer buffer = new StringBuffer(); +// switch (cell.getCellType()) { +// case Cell.CELL_TYPE_NUMERIC: // 数字 +// buffer.append(String.valueOf(cell.getNumericCellValue())); +// break; +// case Cell.CELL_TYPE_STRING: // 字符串 +// buffer.append(cell.getStringCellValue()); +// break; +// case Cell.CELL_TYPE_FORMULA: // 公式 +// buffer.append(cell.getCellFormula()); +// break; +// default: +// return null; +// } +// return buffer.toString(); +// } + + // /** +// * @param map +// * @param obj +// * @return +// * @throws Exception +// */ +// public static Object parseMap2Bean(Map map, Object obj) throws Exception { +// try { +// org.apache.commons.beanutils.BeanUtils.populate(obj, map); +// } catch (Exception e) { +// throw new Exception("转换失败!", e); +// } +// return obj; +// } +// +// /** +// * @param list +// * @param +// * @return +// * @throws Exception +// */ +// public static List parseMap2Bean(List list, Class cla zz) throws Exception { +// List lst = new ArrayList(); +// try { +// for (Map map : list) { +// lst.add(parseMap2Bean(map, clazz.newInstance())); +// } +// } catch (Exception e) { +// throw new Exception("转换失败!", e); +// } +// return lst; +// } + public static void write(HttpServletResponse response, Workbook workbook, String fileName) throws Exception { + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); +// response.setHeader("content-Type", "application/octet-stream"); + if (UtilValidate.isEmpty(fileName)) { + response.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode("模板文件", "UTF-8") + ".xls"); + } else { + response.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls"); + } + response.setContentType("*/*"); + ServletOutputStream out = response.getOutputStream(); + workbook.write(out); + out.flush(); + } + + public static void writeErroData(HttpServletResponse response, List> error, String fileName, Class pojo) throws Exception { + + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); +// response.setHeader("content-Type", "application/octet-stream"); + if (UtilValidate.isEmpty(fileName)) { + response.setHeader("Content-Disposition", + "attachment;filename=" + System.currentTimeMillis() + ".xls"); + } else { + response.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls"); + } + response.setContentType("*/*"); + Workbook workbook = new HSSFWorkbook(); + Sheet sheet = workbook.createSheet(); + //设置表头 + Row firstRow = sheet.createRow(0); + String[] swagger = getSwaggerValue(pojo); + int i = 0; + for (i = 0; i < swagger.length; i++) { + Cell cell = firstRow.createCell(i); + cell.setCellValue(swagger[i]); + } + firstRow.createCell(i).setCellValue("错误原因(修改数据后请删除此列再上传)"); + // + + for (i = 0; i < error.size(); i++) { + Row row = sheet.createRow(i + 1); + List rowList = error.get(i); + for (int j = 0; j < rowList.size(); j++) { + if (rowList.size() > 10) { + if (j == 6 || j == 7) { + double month = Double.parseDouble(rowList.get(j)); + Date date = HSSFDateUtil.getJavaDate(month); + + row.createCell(j).setCellValue(DateUtils.formatDate(date, "yyyy-MM")); + } else { + row.createCell(j).setCellValue(rowList.get(j)); + } + } else { + if (j == 2) { + double month = Double.parseDouble(rowList.get(j)); + Date date = HSSFDateUtil.getJavaDate(month); + + row.createCell(j).setCellValue(DateUtils.formatDate(date, "yyyy-MM")); + } else { + row.createCell(j).setCellValue(rowList.get(j)); + } + } + } + + } + ServletOutputStream out = response.getOutputStream(); + workbook.write(out); + out.flush(); + } + + + public static void downloadTemplate(HttpServletResponse servletResponse, String fileName) throws Exception { + ClassPathResource classPathResource = new ClassPathResource(fileName + ".xls"); + InputStream inputStream = classPathResource.getInputStream(); + servletResponse.setCharacterEncoding("UTF-8"); + servletResponse.setContentType("application/vnd.ms-excel;charset=UTF-8"); +// response.setHeader("content-Type", "application/octet-stream"); + servletResponse.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode("摄像头导入模板", "UTF-8") + ".xls"); + OutputStream out = servletResponse.getOutputStream(); + int length = 0; + byte[] bytes = new byte[1024]; + while ((length = inputStream.read(bytes)) != -1) { + out.write(bytes, 0, length); + } + out.flush(); + out.close(); + inputStream.close(); + } + + /** + * 获取excel文件 + * + * @param multipartFile excel文件 + * @param pojo 转化的实体类 + * @param + * @return + * @throws Exception + */ + public static List readExcel(MultipartFile multipartFile, Class pojo) throws Exception { + Workbook workbook = getWorkbook(multipartFile); + List dataList = new ArrayList<>(); + Sheet sheet = workbook.getSheetAt(0); + //获取实际的行数 + int rowNo = (sheet.getLastRowNum() - sheet.getFirstRowNum()) + 1; + Field[] fields = pojo.getDeclaredFields(); + //从第三行开始读取数据 + for (int i = 2; i < rowNo; i++) { + Row row = sheet.getRow(i); + //校验空行 + if (row == null || row.toString().isEmpty()) { + break; + } + //定义封装数据的实体类 + T t = pojo.newInstance(); + Cell cell = null; + int cellType = 0; + for (int j = 0; j < fields.length; j++) { + try { + cell = row.getCell(j); + cellType = cell.getCellType(); + } catch (NullPointerException e) { + fields[j].set(t, ""); + continue; + } + try { + switch (cellType) { + case Cell.CELL_TYPE_NUMERIC: + if (fields.getClass().getName().equals("String")) { + fields[j].set(t, String.valueOf(cell.getNumericCellValue())); + } + fields[j].set(t, cell.getNumericCellValue()); + break; + case Cell.CELL_TYPE_STRING://字符串类型 + if (cell.getStringCellValue().equals("null")) { + fields[j].set(t, ""); + } else { + fields[j].set(t, cell.getStringCellValue()); + } + break; + case CELL_TYPE_BLANK://空单元格类型 + fields[j].set(t, ""); + break; + } + } catch (Exception e) { + logger.error("数据转换错误"); + } + + } + dataList.add(t); + } + return dataList; + } +} diff --git a/face-common/src/main/java/com/dkha/common/util/HttpContextUtils.java b/face-common/src/main/java/com/dkha/common/util/HttpContextUtils.java new file mode 100644 index 0000000..e971f54 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/HttpContextUtils.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.common.util; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; + +/** + * Http + * + * @author Mark sunlightcs@gmail.com + */ +public class HttpContextUtils { + + public static HttpServletRequest getHttpServletRequest() { + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + if(requestAttributes == null){ + return null; + } + + return ((ServletRequestAttributes) requestAttributes).getRequest(); + } + + public static Map getParameterMap(HttpServletRequest request) { + Enumeration parameters = request.getParameterNames(); + + Map params = new HashMap<>(); + while (parameters.hasMoreElements()) { + String parameter = parameters.nextElement(); + String value = request.getParameter(parameter); + if (StringUtils.isNotBlank(value)) { + params.put(parameter, value); + } + } + + return params; + } + + public static String getDomain(){ + HttpServletRequest request = getHttpServletRequest(); + StringBuffer url = request.getRequestURL(); + return url.delete(url.length() - request.getRequestURI().length(), url.length()).toString(); + } + + public static String getOrigin(){ + HttpServletRequest request = getHttpServletRequest(); + return request.getHeader(HttpHeaders.ORIGIN); + } + + public static String getLanguage() { + //默认语言 + String defaultLanguage = "zh-CN"; + //request + HttpServletRequest request = getHttpServletRequest(); + if(request == null){ + return defaultLanguage; + } + + //请求语言 + defaultLanguage = request.getHeader(HttpHeaders.ACCEPT_LANGUAGE); + + return defaultLanguage; + } +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/util/IdCardUtil.java b/face-common/src/main/java/com/dkha/common/util/IdCardUtil.java new file mode 100644 index 0000000..2471940 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/IdCardUtil.java @@ -0,0 +1,427 @@ +package com.dkha.common.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + *

+ * 身份证合法性校验 + *

+ * + *
+ * --15位身份证号码:第7、8位为出生年份(两位数),第9、10位为出生月份,第11、12位代表出生日期,第15位代表性别,奇数为男,偶数为女。
+ * --18位身份证号码:第7、8、9、10位为出生年份(四位数),第11、第12位为出生月份,第13、14位代表出生日期,第17位代表性别,奇数为男,偶数为女。
+ *    最后一位为校验位
+ * 
+ * + * @author 313921 + */ +public class IdCardUtil { + + private static Logger logger = LoggerFactory.getLogger(IdCardUtil.class); + + /** + *
+     * 省、直辖市代码表:
+     *     11 : 北京  12 : 天津  13 : 河北       14 : 山西  15 : 内蒙古
+     *     21 : 辽宁  22 : 吉林  23 : 黑龙江  31 : 上海  32 : 江苏
+     *     33 : 浙江  34 : 安徽  35 : 福建       36 : 江西  37 : 山东
+     *     41 : 河南  42 : 湖北  43 : 湖南       44 : 广东  45 : 广西      46 : 海南
+     *     50 : 重庆  51 : 四川  52 : 贵州       53 : 云南  54 : 西藏
+     *     61 : 陕西  62 : 甘肃  63 : 青海       64 : 宁夏  65 : 新疆
+     *     71 : 台湾
+     *     81 : 香港  82 : 澳门
+     *     91 : 国外
+     * 
+ */ + private static String[] cityCode = { "11", "12", "13", "14", "15", "21", + "22", "23", "31", "32", "33", "34", "35", "36", "37", "41", "42", + "43", "44", "45", "46", "50", "51", "52", "53", "54", "61", "62", + "63", "64", "65", "71", "81", "82", "91" }; + + /** + * 每位加权因子 + */ + private static int power[] = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, + 8, 4, 2 }; + + /** + * 验证所有的身份证的合法性 + * + * @param idcard + * 身份证 + * @return 合法返回true,否则返回false + */ + public static boolean isValidatedAllIdcard(String idcard) { + if (idcard == null || "".equals(idcard)) { + return false; + } + int s=15; + if (idcard.length() == s) { + return validate15IDCard(idcard); + } + int s1=18; + if(idcard.length()==s1) { + return validate18Idcard(idcard); + } + return false; + + } + + /** + *

+ * 判断18位身份证的合法性 + *

+ * 根据〖中华人民共和国国家标准GB11643-1999〗中有关公民身份号码的规定,公民身份号码是特征组合码,由十七位数字本体码和一位数字校验码组成。 + * 排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码。 + *

+ * 顺序码: 表示在同一地址码所标识的区域范围内,对同年、同月、同 日出生的人编定的顺序号,顺序码的奇数分配给男性,偶数分配 给女性。 + *

+ *

+ * 1.前1、2位数字表示:所在省份的代码; 2.第3、4位数字表示:所在城市的代码; 3.第5、6位数字表示:所在区县的代码; + * 4.第7~14位数字表示:出生年、月、日; 5.第15、16位数字表示:所在地的派出所的代码; + * 6.第17位数字表示性别:奇数表示男性,偶数表示女性; + * 7.第18位数字是校检码:也有的说是个人信息码,一般是随计算机的随机产生,用来检验身份证的正确性。校检码可以是0~9的数字,有时也用x表示。 + *

+ *

+ * 第十八位数字(校验码)的计算方法为: 1.将前面的身份证号码17位数分别乘以不同的系数。从第一位到第十七位的系数分别为:7 9 10 5 8 4 + * 2 1 6 3 7 9 10 5 8 4 2 + *

+ *

+ * 2.将这17位数字和系数相乘的结果相加。 + *

+ *

+ * 3.用加出来和除以11,看余数是多少 + *

+ * 4.余数只可能有0 1 2 3 4 5 6 7 8 9 10这11个数字。其分别对应的最后一位身份证的号码为1 0 X 9 8 7 6 5 4 3 + * 2。 + *

+ * 5.通过上面得知如果余数是2,就会在身份证的第18位数字上出现罗马数字的Ⅹ。如果余数是10,身份证的最后一位号码就是2。 + *

+ * + * @param idcard + * @return + */ + public static boolean validate18Idcard(String idcard) { + if (idcard == null) { + return false; + } + + // 非18位为假 + int s=18; + if (idcard.length() != s) { + logger.error("身份证位数不正确!"); + return false; + } + // 获取前17位 + String idcard17 = idcard.substring(0, 17); + + // 前17位全部为数字 + if (!isDigital(idcard17)) { + return false; + } + + String provinceid = idcard.substring(0, 2); + // 校验省份 + if (!checkProvinceid(provinceid)) { + return false; + } + + // 校验出生日期 + String birthday = idcard.substring(6, 14); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + + try { + Date birthDate = sdf.parse(birthday); + String tmpDate = sdf.format(birthDate); + // 出生年月日不正确 + if (!tmpDate.equals(birthday)) { + return false; + } + + } catch (ParseException e1) { + + return false; + } + + // 获取第18位 + String idcard18Code = idcard.substring(17, 18); + + char c[] = idcard17.toCharArray(); + + int bit[] = converCharToInt(c); + + int sum17 = 0; + + sum17 = getPowerSum(bit); + + // 将和值与11取模得到余数进行校验码判断 + String checkCode = getCheckCodeBySum(sum17); + if (null == checkCode) { + return false; + } + // 将身份证的第18位与算出来的校码进行匹配,不相等就为假 + if (!idcard18Code.equalsIgnoreCase(checkCode)) { + return false; + } + //System.out.println("正确"); + return true; + } + + /** + * 校验15位身份证 + * + *
+     * 只校验省份和出生年月日
+     * 
+ * + * @param idcard + * @return + */ + public static boolean validate15IDCard(String idcard) { + if (idcard == null) { + return false; + } + // 非15位为假 + int s=15; + if (idcard.length() != s) { + return false; + } + + // 15全部为数字 + if (!isDigital(idcard)) { + return false; + } + + String provinceid = idcard.substring(0, 2); + // 校验省份 + if (!checkProvinceid(provinceid)) { + return false; + } + + String birthday = idcard.substring(6, 12); + + SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); + + try { + Date birthDate = sdf.parse(birthday); + String tmpDate = sdf.format(birthDate); + // 身份证日期错误 + if (!tmpDate.equals(birthday)) { + return false; + } + + } catch (ParseException e1) { + + return false; + } + + return true; + } + + /** + * 将15位的身份证转成18位身份证 + * + * @param idcard + * @return + */ + public static String convertIdcarBy15bit(String idcard) { + if (idcard == null) { + return null; + } + + // 非15位身份证 + int s=15; + if (idcard.length() != s) { + return null; + } + + // 15全部为数字 + if (!isDigital(idcard)) { + return null; + } + + String provinceid = idcard.substring(0, 2); + // 校验省份 + if (!checkProvinceid(provinceid)) { + return null; + } + + String birthday = idcard.substring(6, 12); + + SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); + + Date birthdate = null; + try { + birthdate = sdf.parse(birthday); + String tmpDate = sdf.format(birthdate); + // 身份证日期错误 + if (!tmpDate.equals(birthday)) { + return null; + } + + } catch (ParseException e1) { + return null; + } + + Calendar cday = Calendar.getInstance(); + cday.setTime(birthdate); + String year = String.valueOf(cday.get(Calendar.YEAR)); + + String idcard17 = idcard.substring(0, 6) + year + idcard.substring(8); + + char c[] = idcard17.toCharArray(); + String checkCode = ""; + + // 将字符数组转为整型数组 + int bit[] = converCharToInt(c); + + int sum17 = 0; + sum17 = getPowerSum(bit); + + // 获取和值与11取模得到余数进行校验码 + checkCode = getCheckCodeBySum(sum17); + + // 获取不到校验位 + if (null == checkCode) { + return null; + } + // 将前17位与第18位校验码拼接 + idcard17 += checkCode; + return idcard17; + } + + /** + * 校验省份 + * + * @param provinceid + * @return 合法返回TRUE,否则返回FALSE + */ + private static boolean checkProvinceid(String provinceid) { + for (String id : cityCode) { + if (id.equals(provinceid)) { + return true; + } + } + return false; + } + + /** + * 数字验证 + * + * @param str + * @return + */ + private static boolean isDigital(String str) { + return str.matches("^[0-9]*$"); + } + + /** + * 将身份证的每位和对应位的加权因子相乘之后,再得到和值 + * + * @param bit + * @return + */ + private static int getPowerSum(int[] bit) { + + int sum = 0; + + if (power.length != bit.length) { + return sum; + } + + for (int i = 0; i < bit.length; i++) { + for (int j = 0; j < power.length; j++) { + if (i == j) { + sum = sum + bit[i] * power[j]; + } + } + } + return sum; + } + + /** + * 将和值与11取模得到余数进行校验码判断 + * + * @param sum17 + * @return 校验位 + */ + private static String getCheckCodeBySum(int sum17) { + String checkCode = null; + switch (sum17 % 11) { + case 10: + checkCode = "2"; + break; + case 9: + checkCode = "3"; + break; + case 8: + checkCode = "4"; + break; + case 7: + checkCode = "5"; + break; + case 6: + checkCode = "6"; + break; + case 5: + checkCode = "7"; + break; + case 4: + checkCode = "8"; + break; + case 3: + checkCode = "9"; + break; + case 2: + checkCode = "x"; + break; + case 1: + checkCode = "0"; + break; + case 0: + checkCode = "1"; + break; + default: + } + return checkCode; + } + + /** + * 将字符数组转为整型数组 + * + * @param c + * @return + * @throws NumberFormatException + */ + private static int[] converCharToInt(char[] c) throws NumberFormatException { + int[] a = new int[c.length]; + int k = 0; + for (char temp : c) { + a[k++] = Integer.parseInt(String.valueOf(temp)); + } + return a; + } + + + /*public static void main(String[] args) throws Exception { + String idcard15 = "130321860311519"; + String idcard18 = "210102198617083732";// + String idcard="610**************"; + //自己身份证测试 + System.out.println(isValidatedAllIdcard(idcard)); + // 15位身份证 + //System.out.println(isValidatedAllIdcard(idcard15)); + // 18位身份证 + //System.out.println(isValidatedAllIdcard(idcard18)); + // 15位身份证转18位身份证 + //System.out.println(convertIdcarBy15bit(idcard15)); + }*/ +} + diff --git a/face-common/src/main/java/com/dkha/common/util/IntUUID.java b/face-common/src/main/java/com/dkha/common/util/IntUUID.java new file mode 100644 index 0000000..a9c6801 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/IntUUID.java @@ -0,0 +1,40 @@ +package com.dkha.common.util; + +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * @Description 生成32位int UUID + * 14位的当前系统时间(格式为:yyyyMMddHHmmss) + 当前电脑的IP地址的最后两位 + 当前线程的hashCode的前9位 + 7位的随机数 + * @Author Spring + * @Since 2019/8/14 10:53 + */ + +public class IntUUID { + + public static final AtomicInteger shortUUID = new AtomicInteger(0); + + public static int getShortUUID(){ + int current; + int next; + do { + current = shortUUID.get(); + next = current >= 2147483647 ? 0 : current + 1; + } while(!shortUUID.compareAndSet(current, next)); + return next; + } + + /** + * 获取字符串类型UUID + * @return + */ + public static synchronized String getStrUUID() { + return UUID.randomUUID().toString().replaceAll("-", ""); + } + + public static void main(String[] args) { + //System.out.println(IntUUID.getShortUUID()); + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + System.out.println(uuid); + } +} diff --git a/face-common/src/main/java/com/dkha/common/util/IpUtils.java b/face-common/src/main/java/com/dkha/common/util/IpUtils.java new file mode 100644 index 0000000..3801fa7 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/IpUtils.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.common.util; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.http.HttpServletRequest; + +/** + * IP地址 + * @author Spring + */ +public class IpUtils { + private static Logger logger = LoggerFactory.getLogger(IpUtils.class); + + /** + * 获取IP地址 + * + * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址 + * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址 + */ + public static String getIpAddr(HttpServletRequest request) { + String unknown = "unknown"; + String ip = null; + try { + ip = request.getHeader("x-forwarded-for"); + //nginx代理存在的情况下 + if (UtilValidate.isNotEmpty(ip) && ip.contains(",")) { + ip = ip.split(",")[0]; + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (StringUtils.isEmpty(ip) || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + } catch (Exception e) { + logger.error("IPUtils ERROR ", e); + } + + return ip; + } + +} diff --git a/face-common/src/main/java/com/dkha/common/util/JsonUtil.java b/face-common/src/main/java/com/dkha/common/util/JsonUtil.java new file mode 100644 index 0000000..3b555f4 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/JsonUtil.java @@ -0,0 +1,226 @@ +package com.dkha.common.util; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.*; +import lombok.Data; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @Author Spring + * @Since 2019/12/11 14:24 + * @Description 基于jackson 对象序列化反序列化工具 + */ + +public class JsonUtil { + + private static Logger logger = LoggerFactory.getLogger(JsonUtil.class); + + private static ObjectMapper objectMapper = new ObjectMapper(); + + static { + //序列化的时候序列对象的所有属性 + objectMapper.setSerializationInclusion(JsonInclude.Include.ALWAYS); + + // 如果是空对象的时候,不抛异常 + objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + //属性为null的转换--为空的值不参与反序列化 + //objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + // 取消默认转换timestamps对象 + objectMapper.configure(SerializationFeature.WRITE_DATE_KEYS_AS_TIMESTAMPS, false); + // 所有日期统一格式 + objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); + // 忽略 在json字符串中存在, 但是在java对象中不存在对应属性的情况, 防止出错 + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + } + + + public static String obj2String(T obj) { + if (obj == null) { + return null; + } + try { + return obj instanceof String ? (String)obj : objectMapper + .writeValueAsString + (obj); + } catch (Exception e) { + logger.error("Parse object to String error:" + e); + return null; + } + } + + /** + * 返回一个格式化好的字符串, 用于调试 + * @param obj + * @param + * @return + */ + public static String obj2StringPretty(T obj) { + if (obj == null) { + return null; + } + try { + return obj instanceof String ? (String)obj : objectMapper.writerWithDefaultPrettyPrinter() + .writeValueAsString + (obj); + } catch (Exception e) { + logger.error("Parse object to String error:" + e); + return null; + } + } + + /** + * 将字符串转成对象, 单个 + * @param str + * @param clazz + * @param + * @return + */ + public static T string2Obj(String str, Class clazz) { + if (UtilValidate.isEmpty(str) || clazz == null) { + return null; + } + try { + return clazz.equals(String.class) ? (T)str : objectMapper.readValue + (str, clazz); + } catch (IOException e) { + logger.error("Parse String to Object error :" + e); + return null; + } + } + + /** + * 将字符串转换成对象, 集合 + * List userEntityList1 = JsonUtil.string2Obj(str, new TypeReference>() {}); + * @param str + * @param typeReference + * @param + * @return + */ + public static T string2Obj(String str, TypeReference typeReference) { + if (UtilValidate.isEmpty(str) || typeReference == null) { + return null; + } + try { + return (T)(typeReference.getType().equals(String.class) ? (T)str : + objectMapper.readValue + (str, typeReference)); + } catch (IOException e) { + logger.error("Parse String to typeReference Object error :" + e); + return null; + } + } + /** + * 将字符串转换成对象, 集合 + * List sysUserEntityList2 = JsonUtil.string2Obj(str, List.class, SysUserEntity.class); + * @param str + * @param collectionClass + * @param + * @return + */ + public static T string2Obj(String str, Class collectionClass, Class... elementClasses) { + JavaType javaType = objectMapper.getTypeFactory() + .constructParametricType(collectionClass, elementClasses); + try { + return objectMapper.readValue(str, javaType); + } catch (IOException e) { + logger.error("Parse String to Object2 error :" + e); + return null; + } + } + + /** + * 测试代码 + */ + public static void main(String[] args) { + SysUserEntity userEntity = new SysUserEntity(); + userEntity.setUsername("张三"); + userEntity.setCreateTime(new Date()); + System.out.println(JsonUtil.obj2String(userEntity)); + List userEntityList = new ArrayList<>(); + userEntityList.add(userEntity); + System.out.println(JsonUtil.obj2String(userEntityList)); + + String str = "[{\"username\":\"张三\",\"createTime\":\"2019-12-11 14:38:01\"}, {\"username\":\"李四\",\"createTime\":\"2019-10-11 14:38:01\"}]"; + List userEntityList1 = JsonUtil.string2Obj(str, new TypeReference>() { + }); + System.out.println(userEntityList1.toString()); + + List sysUserEntityList2 = JsonUtil.string2Obj(str, List.class, SysUserEntity.class); + System.out.println(sysUserEntityList2.toString()); + + SysUserEntity userEntity1 = JsonUtil.string2Obj("", SysUserEntity.class); + } + + @Data + public static class SysUserEntity { + private static final long serialVersionUID = 1L; + /** + * 用户名 + */ + private String username; + /** + * 密码 + */ + private String password; + /** + * 姓名 + */ + private String realName; + /** + * 头像 + */ + private String headUrl; + /** + * 性别 0:男 1:女 2:保密 + */ + private Integer gender; + /** + * 邮箱 + */ + private String email; + /** + * 手机号 + */ + private String mobile; + /** + * 部门ID + */ + private Long deptId; + /** + * 超级管理员 0:否 1:是 + */ + private Integer superAdmin; + /** + * 状态 0:停用 1:正常 + */ + private Integer status; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + /** + * 部门名称 + */ + @TableField(exist=false) + private String deptName; + + private Date createTime; + } +} diff --git a/face-common/src/main/java/com/dkha/common/util/NameUtil.java b/face-common/src/main/java/com/dkha/common/util/NameUtil.java new file mode 100644 index 0000000..5835399 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/NameUtil.java @@ -0,0 +1,98 @@ +package com.dkha.common.util; + +import com.dkha.common.exception.EmployeeException; + +/** + * @ClassName: + * @Description:(please write your description) + * @author: {开发人的姓名} + * @date: + * @Copyright: 成都电科惠安 + */ +public class NameUtil { + + public static String createAsterisk(int length) { + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < length; i++) { + stringBuffer.append("*"); + } + return stringBuffer.toString(); + } + + public static String getNames(String name) { + if (UtilValidate.isEmpty(name)) { + throw new EmployeeException("不能输入空"); + } + String[] show = name.split("·"); + if (show.length == 2) { + name = show[0] + createAsterisk(show[1].length()); + return name; + } + + return name; + } + + /** + * @param idCardNum 身份证号码 + * @param front 需要显示前几位 + * @param end 需要显示末几位 + * @return + */ + public static String idMask(String idCardNum, int front, int end) { + // 身份证不能为空 + if (UtilValidate.isEmpty(idCardNum)) { + throw new EmployeeException("不能输入空"); + } + // 需要截取的长度不能大于身份证号长度 +// if ((front + end) > idCardNum.length()) { +// throw new EmployeeException("需要截取的长度不能大于身份证号长度"); +// } +// // 需要截取的不能小于0 +// +// if (front < 0 || end < 0) { +// throw new EmployeeException("需要截取的不能小于0"); +// } + // 计算*的数量 + int asteriskCount = idCardNum.length() - (front + end); + StringBuffer asteriskStr = new StringBuffer(); +// for (int i = 0; i < asteriskCount; i++) { + asteriskStr.append("********"); +// } + String regex = "(\\w{" + String.valueOf(front) + "})(\\w+)(\\w{" + String.valueOf(end) + "})"; + return idCardNum.replaceAll(regex, "$1" + "********" + "$3"); + } + + + /** + * 正则表达式判断是否是数字: 完美 + * @param str + * @return + */ + public static boolean isNumber(String str){ + String reg = "^[0-9]+(.[0-9]+)?$"; + return str.matches(reg); + } + + /** + * ASCII码 ,不能判断小数点有几个 :1.1.1 也会返回true + * @param str + * @return + */ + public static boolean isNumeric(String str){ + for(int i=str.length();--i>=0;){ + int chr=str.charAt(i); + System.out.println(chr); + if(chr<48 || chr>57) { + if(chr != 46){ + return false; + } + } + } + return true; + } + +// public static void main(String[] args) { +// String id ="513902199202293979E.5"; +// System.out.println(NameUtil.isNumber(id)); +// } +} diff --git a/face-common/src/main/java/com/dkha/common/util/ShieldUtil.java b/face-common/src/main/java/com/dkha/common/util/ShieldUtil.java new file mode 100644 index 0000000..f77fa0a --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/ShieldUtil.java @@ -0,0 +1,56 @@ +package com.dkha.common.util; + +/** + * 身份证号,姓名屏蔽 + */ +public class ShieldUtil { + + /** + * 少数名字屏蔽·后 + * @param name + * @return + */ + public static String getShieldName(String name) { + + if (name != null && name.contains("·")) { + String[] strings = name.split("·"); + char[] c = strings[1].toCharArray(); + for (int i = 0; i < strings[1].toCharArray().length; i++) { + c[i] = '*'; + } + + strings[1] = new String(c); + name = strings[0] + "·" + strings[1]; + } + return name; + + } + + /** + * 身份证号屏蔽出生日期 + * @param idCardNo + * @return + */ + public static String getShieldIdCardNo(String idCardNo) { + if (idCardNo != null && idCardNo.trim().length() != 0) { + char[] c = idCardNo.toCharArray(); + for (int i = 0; i < c.length; i++) { + switch (i) { + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + c[i] = '*'; + break; + } + } + idCardNo = new String(c); + } + return idCardNo; + } + +} diff --git a/face-common/src/main/java/com/dkha/common/util/SpringBeanFactoryUtils.java b/face-common/src/main/java/com/dkha/common/util/SpringBeanFactoryUtils.java new file mode 100644 index 0000000..f7036e8 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/SpringBeanFactoryUtils.java @@ -0,0 +1,28 @@ +package com.dkha.common.util; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * @Author Spring + * @Since 2019/9/21 9:48 + * @Description 用于在Spring框架无法注入的情况下获取对应的Bean + */ +@Component +public class SpringBeanFactoryUtils implements ApplicationContextAware { + + private static ApplicationContext context = null; + + public static T getBean(Class type) { + return context.getBean(type); + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + if (SpringBeanFactoryUtils.context == null) { + SpringBeanFactoryUtils.context = applicationContext; + } + } +} diff --git a/face-common/src/main/java/com/dkha/common/util/SpringContextUtils.java b/face-common/src/main/java/com/dkha/common/util/SpringContextUtils.java new file mode 100644 index 0000000..1efbbfb --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/SpringContextUtils.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.common.util; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * Spring Context 工具类 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class SpringContextUtils implements ApplicationContextAware { + public static ApplicationContext applicationContext; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) + throws BeansException { + SpringContextUtils.applicationContext = applicationContext; + } + + public static Object getBean(String name) { + return applicationContext.getBean(name); + } + + public static T getBean(Class requiredType) { + return applicationContext.getBean(requiredType); + } + + public static T getBean(String name, Class requiredType) { + return applicationContext.getBean(name, requiredType); + } + + public static boolean containsBean(String name) { + return applicationContext.containsBean(name); + } + + public static boolean isSingleton(String name) { + return applicationContext.isSingleton(name); + } + + public static Class getType(String name) { + return applicationContext.getType(name); + } + +} \ No newline at end of file diff --git a/face-common/src/main/java/com/dkha/common/util/TimeUtil.java b/face-common/src/main/java/com/dkha/common/util/TimeUtil.java new file mode 100644 index 0000000..1747843 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/TimeUtil.java @@ -0,0 +1,101 @@ +package com.dkha.common.util; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: TimeUtil + * @Package com.dkha.common.util + * @author: panhui + * @date: 2019/12/10 15:09 + * @Copyright: 成都电科慧安 + */ +public class TimeUtil { + + /** + * 获取今天时间开始的时间 + * + * @return + */ + public static Long toDayStart() { + Date date=new Date(); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + return date.getTime(); + } + /** + * 获取今天时间结束的时间 + * + * @return + */ + public static Long toDayStop() + { + Date date=new Date(); + date.setHours(23); + date.setMinutes(59); + date.setSeconds(59); + return date.getTime(); + } + + /** + * 获取传入时间的开始的时间 + * + * @return + */ + public static Long toDateByTimeStart(String time) { + Date date=exchangeDate(time); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + return date.getTime(); + } + /** + * 获取传入时间结束的时间 + * + * @return + */ + public static Long toDateByTimeStop(String time) + { + Date date=exchangeDate(time); + date.setHours(23); + date.setMinutes(59); + date.setSeconds(59); + return date.getTime(); + } + + /** + * 将时间转换为时间戳 + * @param time + * @return + */ + public static Long exchangeTime(String time) + { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = null; + try { + date = simpleDateFormat.parse(time); + } catch (ParseException e) { + } + return date.getTime(); + } + /** + * 将时间转换为时间戳 + * @param time + * @return + */ + public static Date exchangeDate(String time) + { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = null; + try { + date = simpleDateFormat.parse(time); + } catch (ParseException e) { + } + return date; + } +} diff --git a/face-common/src/main/java/com/dkha/common/util/UUIDBits.java b/face-common/src/main/java/com/dkha/common/util/UUIDBits.java new file mode 100644 index 0000000..241ed87 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/UUIDBits.java @@ -0,0 +1,43 @@ +package com.dkha.common.util; + +import java.util.UUID; + +/** + * All rights 成都电科慧安 + * + * @ClassName: UUIDBits + * @program: dkha-cloud + * @description: + * @author: maming + * @create: 2019/11/18 10:47 + **/ + +public class UUIDBits { + + public static String[] chars = new String[] { "a", "b", "c", "d", "e", "f", + "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", + "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", + "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", + "W", "X", "Y", "Z" }; + + /** + * 生成6位UUID + * @return 6位UUID + */ + public static String getUUIDBits(Integer num) { + StringBuffer shortBuffer = new StringBuffer(); + String uuid = UUID.randomUUID().toString().replace("-", ""); + for (int i = 0; i < num; i++) { + String str = uuid.substring(i * 4, i * 4 + 4); + int x = Integer.parseInt(str, 16); + shortBuffer.append(chars[x % 0x3E]); + } + return shortBuffer.toString(); + } + + public static void main(String[] args) { + System.out.println(getUUIDBits(6)); + } +} + diff --git a/face-common/src/main/java/com/dkha/common/util/UrlUtil.java b/face-common/src/main/java/com/dkha/common/util/UrlUtil.java new file mode 100644 index 0000000..170cab0 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/UrlUtil.java @@ -0,0 +1,109 @@ +package com.dkha.common.util; + +import com.dkha.common.enums.ErrEnum; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.ReturnVO; +import com.dkha.common.result.CommonResult; +import com.google.gson.Gson; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: UrlUtil + * @Package com.dkha.task.util + * @author: panhui + * @date: 2020/1/10 10:46 + * @Copyright: 成都电科慧安 + */ +public class UrlUtil { + /** + * 调用预警的信息 faceserver + * + * @param object + * @return + */ + public static String postData(String warningUrl, Object object, HttpUtil httpUtil, Gson gson) { + try { + CommonResult commonResult = (CommonResult) httpUtil.post(warningUrl, object, CommonResult.class); + if (commonResult.getCode().intValue() != 0 || UtilValidate.isEmpty(commonResult.getData())) { + return null; + } + return gson.toJson(commonResult.getData()); + } catch (Exception e) { + return null; + } + } + + /** + * 调用预警的信息 face-server + * + * @param warningUrl + * @return + */ + public static String getData(String warningUrl, HttpUtil httpUtil, Gson gson) { +// log.error("warningUrl={}",warningUrl); + try { + + CommonResult commonResult = (CommonResult) httpUtil.get(warningUrl, CommonResult.class); + if (commonResult.getCode().intValue() != 0 || UtilValidate.isEmpty(commonResult.getData())) { + return null; + } + return gson.toJson(commonResult.getData()); + } catch (Exception e) { + return null; + } + } + + /** + * 调用 api + * + * @param object + * @return + */ + public static String postApiData(String warningUrl, Object object, HttpUtil httpUtil, Gson gson) { + try { + ReturnVO returnVO = (ReturnVO) httpUtil.post(warningUrl, object, ReturnVO.class); + if (returnVO.getCode().intValue() != 200 || UtilValidate.isEmpty(returnVO.getData())) { + return null; + } + return gson.toJson(returnVO.getData()); + } catch (Exception e) { + return null; + } + } + + + /** + * 调用 api + * + * @param warningUrl + * @return + */ + public static String getApiData(String warningUrl, HttpUtil httpUtil, Gson gson) { +// log.error("warningUrl={}",warningUrl); + try { + + ReturnVO returnVO = (ReturnVO) httpUtil.get(warningUrl, ReturnVO.class); + if (returnVO.getCode().intValue() != 200 || UtilValidate.isEmpty(returnVO.getData())) { + return null; + } + return gson.toJson(returnVO.getData()); + } catch (Exception e) { + return null; + } + } + + public static String getData(String warningUrl, Object object, HttpUtil httpUtil, Gson gson) + { + CommonResult commonResult= (CommonResult) httpUtil.get(warningUrl,object,CommonResult.class); + //为授权 + if (commonResult.getCode().intValue()==ErrEnum.UNAUTHORIZED.getCode()){ + return gson.toJson(401); + } + if(commonResult.getCode().intValue()!=0 || UtilValidate.isEmpty(commonResult.getData())) { + return null; + } + return gson.toJson(commonResult.getData()); + } +} diff --git a/face-common/src/main/java/com/dkha/common/util/UtilValidate.java b/face-common/src/main/java/com/dkha/common/util/UtilValidate.java new file mode 100644 index 0000000..69531f4 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/UtilValidate.java @@ -0,0 +1,144 @@ +package com.dkha.common.util; + +import java.util.Collection; +import java.util.Map; + +/** + * @author Spring + * @date 2017/5/18-11:30 + * @Description: 通用验证工具类 + */ +public class UtilValidate { + + /** + * 验证一个对象是否非空,支持String,Map,Collection等。 + * @param o + * @return + */ + public static boolean isEmpty(Object o){ + return isBaseEmpty(o); + } + + /** + * 验证String是否为空 + * @param s + * @return + */ + public static boolean isEmpty(String s) { + return ((s == null) || (s.length() == 0)); + } + + /** + * 验证数组是否为空 + * @param arrays + * @return + */ + public static boolean isEmpty(Object [] arrays) { + return ((arrays == null) || (arrays.length == 0)); + } + + /** + * 验证一个集合是否为空 + * @param c + * @param + * @return + */ + public static boolean isEmpty(Collection c) { + return ((c == null) || (c.size() == 0)); + } + + /** + * 验证Map集合是否为空 + * @param m + * @param + * @param + * @return + */ + public static boolean isEmpty(Map m) { + return ((m == null) || (m.size() == 0)); + } + + /** + * 验证charsequence是否为空 + * @param c + * @return + */ + public static boolean isEmpty(CharSequence c) { + return ((c == null) || (c.length() == 0)); + } + + /** + * 验证一个对象是否非空,支持String,Map,Collection等。 + * @param o + * @return + */ + public static boolean isNotEmpty(Object o) { + return !isBaseEmpty(o); + } + + /** + * 验证String是否不为空 + * @param s + * @return + */ + public static boolean isNotEmpty(String s) { + return ((s != null) && (s.length() > 0)); + } + + /** + * 验证数组是否为空 + * @param arrays + * @return + */ + public static boolean isNotEmpty(Object [] arrays) { + return ((arrays != null) && (arrays.length > 0)); + } + + /** + * 验证Collection是否不为空 + * @param c + * @param + * @return + */ + public static boolean isNotEmpty(Collection c) { + return ((c != null) && (c.size() > 0)); + } + + /** + * 验证CharSequence是否不能为空 + * @param c + * @return + */ + public static boolean isNotEmpty(CharSequence c) { + return ((c != null) && (c.length() > 0)); + } + + /** + * 基类 + * @param value + * @return + */ + @SuppressWarnings("unchecked") + private static boolean isBaseEmpty(Object value) { + if (value == null) return true; + if (value instanceof String) return UtilValidate.isEmpty((String) value); + if (value instanceof Collection) return UtilValidate.isEmpty((Collection) value); + if (value instanceof Map) return UtilValidate.isEmpty((Map) value); + if (value instanceof CharSequence) return UtilValidate.isEmpty((CharSequence) value); + // These types would flood the log + // Number covers: BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, Short + if (value instanceof Boolean) return false; + if (value instanceof Number) return false; + if (value instanceof Character) return false; + if (value instanceof java.sql.Timestamp) return false; + return false; + } + + /** + * 系统测试方法 + * @param args + */ + public static void main(String[] args) { + System.out.println(UtilValidate.isEmpty("")); + } +} diff --git a/face-common/src/main/java/com/dkha/common/util/excel/ExcelField.java b/face-common/src/main/java/com/dkha/common/util/excel/ExcelField.java new file mode 100644 index 0000000..2918801 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/excel/ExcelField.java @@ -0,0 +1,59 @@ +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.dkha.common.util.excel; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Excel注解定义 + * @author ThinkGem + * @version 2013-03-10 + */ +@Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface ExcelField { + + /** + * 导出字段名(默认调用当前字段的“get”方法,如指定导出字段为对象,请填写“对象名.对象属性”,例:“area.name”、“office.name”) + */ + String value() default ""; + + /** + * 导出字段标题(需要添加批注请用“**”分隔,标题**批注,仅对导出模板有效) + */ + String title(); + + /** + * 字段类型(0:导出导入;1:仅导出;2:仅导入) + */ + int type() default 0; + + /** + * 导出字段对齐方式(0:自动;1:靠左;2:居中;3:靠右) + */ + int align() default 0; + + /** + * 导出字段字段排序(升序) + */ + int sort() default 0; + + /** + * 如果是字典类型,请设置字典的type值 + */ + String dictType() default ""; + + /** + * 反射类型 + */ + Class fieldType() default Class.class; + + /** + * 字段归属组(根据分组导出导入) + */ + int[] groups() default {}; +} diff --git a/face-common/src/main/java/com/dkha/common/util/excel/ImportExcel.java b/face-common/src/main/java/com/dkha/common/util/excel/ImportExcel.java new file mode 100644 index 0000000..ed9cb24 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/excel/ImportExcel.java @@ -0,0 +1,343 @@ +package com.dkha.common.util.excel; + +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.List; + + +/** + * 导入Excel文件(支持“XLS”和“XLSX”格式) + * @author ThinkGem + * @version 2013-03-10 + */ +public class ImportExcel { + + private static Logger log = LoggerFactory.getLogger(ImportExcel.class); + + /** + * 工作薄对象 + */ + private Workbook wb; + + /** + * 工作表对象 + */ + private Sheet sheet; + + /** + * 标题行号 + */ + private int headerNum; + + /** + * 构造函数 + * @param fileName 导入文件,读取第一个工作表 + * @param headerNum 标题行号,数据行号=标题行号+1 + * @throws InvalidFormatException + * @throws IOException + */ + public ImportExcel(String fileName, int headerNum) + throws InvalidFormatException, IOException { + this(new File(fileName), headerNum); + } + + /** + * 构造函数 + * @param file 导入文件对象,读取第一个工作表 + * @param headerNum 标题行号,数据行号=标题行号+1 + * @throws InvalidFormatException + * @throws IOException + */ + public ImportExcel(File file, int headerNum) + throws InvalidFormatException, IOException { + this(file, headerNum, 0); + } + + /** + * 构造函数 + * @param fileName 导入文件 + * @param headerNum 标题行号,数据行号=标题行号+1 + * @param sheetIndex 工作表编号 + * @throws InvalidFormatException + * @throws IOException + */ + public ImportExcel(String fileName, int headerNum, int sheetIndex) + throws InvalidFormatException, IOException { + this(new File(fileName), headerNum, sheetIndex); + } + + /** + * 构造函数 + * @param file 导入文件对象 + * @param headerNum 标题行号,数据行号=标题行号+1 + * @param sheetIndex 工作表编号 + * @throws InvalidFormatException + * @throws IOException + */ + public ImportExcel(File file, int headerNum, int sheetIndex) + throws InvalidFormatException, IOException { + this(file.getName(), new FileInputStream(file), headerNum, sheetIndex); + } + + /** + * 构造函数 + * @param multipartFile 导入文件对象 + * @param headerNum 标题行号,数据行号=标题行号+1 + * @param sheetIndex 工作表编号 + * @throws InvalidFormatException + * @throws IOException + */ + public ImportExcel(MultipartFile multipartFile, int headerNum, int sheetIndex) + throws InvalidFormatException, IOException { + this(multipartFile.getOriginalFilename(), multipartFile.getInputStream(), headerNum, sheetIndex); + } + + /** + * @param fileName 导入文件对象 + * @param is 文件流 + * @param headerNum 标题行号,数据行号=标题行号+1 + * @param sheetIndex 工作表编号 + * @throws InvalidFormatException + * @throws IOException + */ + public ImportExcel(String fileName, InputStream is, int headerNum, int sheetIndex) + throws InvalidFormatException, IOException { + if (StringUtils.isBlank(fileName)){ + throw new RuntimeException("导入文档为空!"); + }else if(fileName.toLowerCase().endsWith("xls")){ + this.wb = new HSSFWorkbook(is); + }else if(fileName.toLowerCase().endsWith("xlsx")){ + this.wb = new XSSFWorkbook(is); + }else{ + throw new RuntimeException("文档格式不正确!"); + } + if (this.wb.getNumberOfSheets() List getDataList(Class cls, int... groups) throws InstantiationException, IllegalAccessException{ + List annotationList = Lists.newArrayList(); + // Get annotation field + Field[] fs = cls.getDeclaredFields(); + for (Field f : fs){ + ExcelField ef = f.getAnnotation(ExcelField.class); + if (ef != null && (ef.type()==0 || ef.type()==2)){ + if (groups!=null && groups.length>0){ + boolean inGroup = false; + for (int g : groups){ + if (inGroup){ + break; + } + for (int efg : ef.groups()){ + if (g == efg){ + inGroup = true; + annotationList.add(new Object[]{ef, f}); + break; + } + } + } + }else{ + annotationList.add(new Object[]{ef, f}); + } + } + } + // Get annotation method + Method[] ms = cls.getDeclaredMethods(); + for (Method m : ms){ + ExcelField ef = m.getAnnotation(ExcelField.class); + if (ef != null && (ef.type()==0 || ef.type()==2)){ + if (groups!=null && groups.length>0){ + boolean inGroup = false; + for (int g : groups){ + if (inGroup){ + break; + } + for (int efg : ef.groups()){ + if (g == efg){ + inGroup = true; + annotationList.add(new Object[]{ef, m}); + break; + } + } + } + }else{ + annotationList.add(new Object[]{ef, m}); + } + } + } + // Field sorting + Collections.sort(annotationList, new Comparator() { + @Override + public int compare(Object[] o1, Object[] o2) { + return new Integer(((ExcelField)o1[0]).sort()).compareTo( + new Integer(((ExcelField)o2[0]).sort())); + }; + }); + log.debug("Import column count:"+annotationList.size()); + // Get excel data + List dataList = Lists.newArrayList(); + //错误数据 + List error = Lists.newArrayList(); + for (int i = this.getDataRowNum(); i < this.getLastDataRowNum(); i++) { + E e = (E)cls.newInstance(); + int column = 0; + Row row = this.getRow(i); + StringBuilder sb = new StringBuilder(); + for (Object[] os : annotationList){ + Object val = this.getCellValue(row, column++); + if (val != null){ + ExcelField ef = (ExcelField)os[0]; + // Get param type and type cast + Class valType = Class.class; + if (os[1] instanceof Field){ + valType = ((Field)os[1]).getType(); + }else if (os[1] instanceof Method){ + Method method = ((Method)os[1]); + if ("get".equals(method.getName().substring(0, 3))){ + valType = method.getReturnType(); + }else if("set".equals(method.getName().substring(0, 3))){ + valType = ((Method)os[1]).getParameterTypes()[0]; + } + } + log.info("Import value type===>导入数据信息: ["+i+","+column+"] " + valType); + try { + if (valType == String.class){ + String s = String.valueOf(val.toString()); + if(StringUtils.endsWith(s, ".0")){ + val = StringUtils.substringBefore(s, ".0"); + }else{ + val = String.valueOf(val.toString()); + } + }else if (valType == Integer.class){ + val = Double.valueOf(val.toString()).intValue(); + }else if (valType == Long.class){ + val = Double.valueOf(val.toString()).longValue(); + }else if (valType == Double.class){ + val = Double.valueOf(val.toString()); + }else if (valType == Float.class){ + val = Float.valueOf(val.toString()); + }else if (valType == Date.class){ + val = DateUtil.getJavaDate((Double)val); + }else{ + if (ef.fieldType() != Class.class){ + val = ef.fieldType().getMethod("getValue", String.class).invoke(null, val.toString()); + }else{ + val = Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(), + "fieldtype."+valType.getSimpleName()+"Type")).getMethod("getValue", String.class).invoke(null, val.toString()); + } + } + } catch (Exception ex) { + log.info("Get cell value ["+i+","+column+"] error: " + ex.toString()); + val=ex.getMessage(); + val = null; +// return error; + } + // set entity value + if (os[1] instanceof Field){ + Reflections.invokeSetter(e, ((Field)os[1]).getName(), val); + }else if (os[1] instanceof Method){ + String mthodName = ((Method)os[1]).getName(); + if ("get".equals(mthodName.substring(0, 3))){ + mthodName = "set"+StringUtils.substringAfter(mthodName, "get"); + } + Reflections.invokeMethod(e, mthodName, new Class[] {valType}, new Object[] {val}); + } + } + sb.append(val+", "); + } + dataList.add(e); + log.debug("Read success"); + } + return dataList; + } + + +} diff --git a/face-common/src/main/java/com/dkha/common/util/excel/Reflections.java b/face-common/src/main/java/com/dkha/common/util/excel/Reflections.java new file mode 100644 index 0000000..01ea016 --- /dev/null +++ b/face-common/src/main/java/com/dkha/common/util/excel/Reflections.java @@ -0,0 +1,299 @@ +/** + * Copyright (c) 2005-2012 springside.org.cn + */ +package com.dkha.common.util.excel; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.Assert; + +import java.lang.reflect.*; + +/** + * 反射工具类. + * 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数. + * @author calvin + * @version 2013-01-15 + */ +@SuppressWarnings("rawtypes") +public class Reflections { + + private static final String SETTER_PREFIX = "set"; + + private static final String GETTER_PREFIX = "get"; + + private static final String CGLIB_CLASS_SEPARATOR = "$$"; + + private static Logger logger = LoggerFactory.getLogger(Reflections.class); + + /** + * 调用Getter方法. + * 支持多级,如:对象名.对象名.方法 + */ + public static Object invokeGetter(Object obj, String propertyName) { + Object object = obj; + for (String name : StringUtils.split(propertyName, ".")){ + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); + object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); + } + return object; + } + + /** + * 调用Setter方法, 仅匹配方法名。 + * 支持多级,如:对象名.对象名.方法 + */ + public static void invokeSetter(Object obj, String propertyName, Object value) { + Object object = obj; + String[] names = StringUtils.split(propertyName, "."); + for (int i=0; i[] parameterTypes, + final Object[] args) { + Method method = getAccessibleMethod(obj, methodName, parameterTypes); + if (method == null) { + throw new IllegalArgumentException("Could not find method [" + methodName + "] on target [" + obj + "]"); + } + + try { + return method.invoke(obj, args); + } catch (Exception e) { + throw convertReflectionExceptionToUnchecked(e); + } + } + + /** + * 直接调用对象方法, 无视private/protected修饰符, + * 用于一次性调用的情况,否则应使用getAccessibleMethodByName()函数获得Method后反复调用. + * 只匹配函数名,如果有多个同名函数调用第一个。 + */ + public static Object invokeMethodByName(final Object obj, final String methodName, final Object[] args) { + Method method = getAccessibleMethodByName(obj, methodName); + if (method == null) { + throw new IllegalArgumentException("Could not find method [" + methodName + "] on target [" + obj + "]"); + } + + try { + return method.invoke(obj, args); + } catch (Exception e) { + throw convertReflectionExceptionToUnchecked(e); + } + } + + /** + * 循环向上转型, 获取对象的DeclaredField, 并强制设置为可访问. + * + * 如向上转型到Object仍无法找到, 返回null. + */ + public static Field getAccessibleField(final Object obj, final String fieldName) { + Validate.notNull(obj, "object can't be null"); + Validate.notBlank(fieldName, "fieldName can't be blank"); + for (Class superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) { + try { + Field field = superClass.getDeclaredField(fieldName); + makeAccessible(field); + return field; + } catch (NoSuchFieldException e) {//NOSONAR + // Field不在当前类定义,继续向上转型 + continue;// new add + } + } + return null; + } + + /** + * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + * 匹配函数名+参数类型。 + * + * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) + */ + public static Method getAccessibleMethod(final Object obj, final String methodName, + final Class... parameterTypes) { + Validate.notNull(obj, "object can't be null"); + Validate.notBlank(methodName, "methodName can't be blank"); + + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) { + try { + Method method = searchType.getDeclaredMethod(methodName, parameterTypes); + makeAccessible(method); + return method; + } catch (NoSuchMethodException e) { + // Method不在当前类定义,继续向上转型 + continue;// new add + } + } + return null; + } + + /** + * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + * 只匹配函数名。 + * + * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) + */ + public static Method getAccessibleMethodByName(final Object obj, final String methodName) { + Validate.notNull(obj, "object can't be null"); + Validate.notBlank(methodName, "methodName can't be blank"); + + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) { + Method[] methods = searchType.getDeclaredMethods(); + for (Method method : methods) { + if (method.getName().equals(methodName)) { + makeAccessible(method); + return method; + } + } + } + return null; + } + + /** + * 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 + */ + public static void makeAccessible(Method method) { + if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) + && !method.isAccessible()) { + method.setAccessible(true); + } + } + + /** + * 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 + */ + public static void makeAccessible(Field field) { + if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) || Modifier + .isFinal(field.getModifiers())) && !field.isAccessible()) { + field.setAccessible(true); + } + } + + /** + * 通过反射, 获得Class定义中声明的泛型参数的类型, 注意泛型必须定义在父类处 + * 如无法找到, 返回Object.class. + * eg. + * public UserDao extends HibernateDao + * + * @param clazz The class to introspect + * @return the first generic declaration, or Object.class if cannot be determined + */ + @SuppressWarnings("unchecked") + public static Class getClassGenricType(final Class clazz) { + return getClassGenricType(clazz, 0); + } + + /** + * 通过反射, 获得Class定义中声明的父类的泛型参数的类型. + * 如无法找到, 返回Object.class. + * + * 如public UserDao extends HibernateDao + * + * @param clazz clazz The class to introspect + * @param index the Index of the generic ddeclaration,start from 0. + * @return the index generic declaration, or Object.class if cannot be determined + */ + public static Class getClassGenricType(final Class clazz, final int index) { + + Type genType = clazz.getGenericSuperclass(); + + if (!(genType instanceof ParameterizedType)) { + logger.warn(clazz.getSimpleName() + "'s superclass not ParameterizedType"); + return Object.class; + } + + Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); + + if (index >= params.length || index < 0) { + logger.warn("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: " + + params.length); + return Object.class; + } + if (!(params[index] instanceof Class)) { + logger.warn(clazz.getSimpleName() + " not set the actual class on superclass generic parameter"); + return Object.class; + } + + return (Class) params[index]; + } + + public static Class getUserClass(Object instance) { + Assert.notNull(instance, "Instance must not be null"); + Class clazz = instance.getClass(); + if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) { + Class superClass = clazz.getSuperclass(); + if (superClass != null && !Object.class.equals(superClass)) { + return superClass; + } + } + return clazz; + + } + + /** + * 将反射时的checked exception转换为unchecked exception. + */ + public static RuntimeException convertReflectionExceptionToUnchecked(Exception e) { + if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException + || e instanceof NoSuchMethodException) { + return new IllegalArgumentException(e); + } else if (e instanceof InvocationTargetException) { + return new RuntimeException(((InvocationTargetException) e).getTargetException()); + } else if (e instanceof RuntimeException) { + return (RuntimeException) e; + } + return new RuntimeException("Unexpected Checked Exception.", e); + } +} diff --git a/face-server/Dockerfile b/face-server/Dockerfile new file mode 100644 index 0000000..187249d --- /dev/null +++ b/face-server/Dockerfile @@ -0,0 +1,8 @@ +FROM centos7/jdk1.8 +#指定工作目录 +WORKDIR /usr/local +RUN touch face.log +ADD face-server-1.0-SNAPSHOT.jar face-server-1.0-SNAPSHOT.jar +#指定暴露的端口号 +EXPOSE 8899 +ENTRYPOINT java -jar face-server-1.0-SNAPSHOT.jar > face.log 2>&1 \ No newline at end of file diff --git a/face-server/pom.xml b/face-server/pom.xml new file mode 100644 index 0000000..350248a --- /dev/null +++ b/face-server/pom.xml @@ -0,0 +1,194 @@ + + + + face-application + com.dkha + 1.0-SNAPSHOT + + 4.0.0 + + face-server + + + + com.dkha + face-common + ${project.version} + + + org.apache.mina + mina-core + 2.1.3 + + + org.springframework.boot + spring-boot-starter-websocket + + + + org.springframework + springloaded + + + org.springframework.boot + spring-boot-devtools + true + true + + + + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + com.github.axet + kaptcha + + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + + com.baomidou + mybatis-plus-boot-starter + + + com.baomidou + mybatis-plus-generator + + + + + org.freemarker + freemarker + + + mysql + mysql-connector-java + + + org.projectlombok + lombok + + + com.alibaba + druid-spring-boot-starter + + + org.springframework.boot + spring-boot-starter-data-redis + + + redis.clients + jedis + + + + + io.minio + minio + + + com.alibaba + fastjson + + + io.netty + netty-all + + + org.apache.shiro + shiro-core + + + org.apache.shiro + shiro-spring + + + com.github.axet + kaptcha + + + + cn.afterturn + easypoi-base + + + cn.afterturn + easypoi-web + + + cn.afterturn + easypoi-annotation + + + org.aspectj + aspectjrt + + + org.apache.commons + commons-lang3 + + + com.sun.mail + javax.mail + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-starter-aop + + + + org.springframework.boot + spring-boot-starter-web + + + org.bytedeco + javacv + 1.4.3 + + + org.bytedeco.javacpp-presets + opencv + 3.4.3-1.4.3 + windows-x86_64 + + + + + org.bytedeco.javacpp-presets + ffmpeg-platform + 4.0.2-1.4.3 + + + + + + org.springframework.boot + spring-boot-maven-plugin + + com.dkha.server.FaceServerApplication + + + + + diff --git a/face-server/src/main/java/com/dkha/server/FaceServerApplication.java b/face-server/src/main/java/com/dkha/server/FaceServerApplication.java new file mode 100644 index 0000000..12e40ca --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/FaceServerApplication.java @@ -0,0 +1,50 @@ +package com.dkha.server; + +import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor; +import com.dkha.server.common.handler.MyMetaObjectHandler; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.annotation.EnableScheduling; + +import java.net.InetSocketAddress; + + +@SpringBootApplication(exclude = { + org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class},scanBasePackages = {"com.dkha.common", "com.dkha.server"}) +@MapperScan("com.dkha.server.mappers") +@MapperScan("com.dkha.server.system.modules.log.dao") +@MapperScan("com.dkha.server.system.modules.sys.dao") +@EnableScheduling +public class FaceServerApplication { + public static void main(String[] args) { + SpringApplication springApplication = new SpringApplication(FaceServerApplication.class); + ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args); + //解决WebSocket不能注入的问题 + } + + /** + * mybatis-plus自动注入插件 + * + * @return + */ + @Bean + public MyMetaObjectHandler createMyMetaObjectHandler() { + return new MyMetaObjectHandler(); + } + + + /** + * mybatis-plus执行效率插件 + * @return + */ + //@Bean + // 设置 dev test 环境开启 + //@Profile({"dev"}) + public PerformanceInterceptor performanceInterceptor() { + return new PerformanceInterceptor(); + } + +} diff --git a/face-server/src/main/java/com/dkha/server/annotation/NoRepeatSubmitAnnotation.java b/face-server/src/main/java/com/dkha/server/annotation/NoRepeatSubmitAnnotation.java new file mode 100644 index 0000000..9c3d386 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/annotation/NoRepeatSubmitAnnotation.java @@ -0,0 +1,29 @@ +package com.dkha.server.annotation; + +import java.lang.annotation.*; +import java.util.concurrent.TimeUnit; + +/** + * @version V1.0 + * @Description: 对需要防止重复提交的页面添加该注解 + * @Title: 防止重复提交 + * @author: huangyugang + * @date: 2019/12/23 13:58 + * @Copyright: 成都电科慧安 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface NoRepeatSubmitAnnotation { + /** key前缀 */ + String prefix() default ""; + + /** 过期秒数,默认为5秒 */ + int expire() default 5; + + /** 超时时间单位,默认为秒 */ + TimeUnit timeUnit() default TimeUnit.SECONDS; + + /** Key的分隔符(默认 :) */ + String delimiter() default ":"; +} diff --git a/face-server/src/main/java/com/dkha/server/aspect/RepeatSubmitAspect.java b/face-server/src/main/java/com/dkha/server/aspect/RepeatSubmitAspect.java new file mode 100644 index 0000000..54a366c --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/aspect/RepeatSubmitAspect.java @@ -0,0 +1,93 @@ +package com.dkha.server.aspect; + +import com.dkha.common.exception.DkException; +import com.dkha.common.result.CommonResult; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.annotation.NoRepeatSubmitAnnotation; +import com.dkha.server.system.modules.security.user.SecurityUser; +import lombok.extern.slf4j.Slf4j; +import org.apache.catalina.manager.util.SessionUtils; +import org.apache.commons.lang3.StringUtils; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.script.DefaultRedisScript; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.servlet.HandlerInterceptor; + +import javax.servlet.http.HttpServletRequest; +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.Objects; +import java.util.UUID; + +/** + * @version V1.0 + * @Description: 防止重复提交的切面 + * @Title: + * @author: huangyugang + * @date: 2019/12/23 14:01 + * @Copyright: 成都电科慧安 + */ +@Aspect +@Component +@Slf4j +public class RepeatSubmitAspect { + + /** lua */ + private static final String RELEASE_LOCK_LUA_SCRIPT = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end"; + + @Autowired + private RedisTemplate redisTemplate; + + @Pointcut("@annotation(com.dkha.server.annotation.NoRepeatSubmitAnnotation)") + public void pointCut(){} + + @Around("pointCut()") + public Object around(ProceedingJoinPoint joinPoint) throws Throwable{ + log.info("接口幂等性验证:"); + // 可以根据业务获取用户唯一的个人信息,例如手机号码 + if(UtilValidate.isEmpty(SecurityUser.getUserId())) + { + throw new DkException(SystemCode.TOKEN_ERROR); + } + String phone = SecurityUser.getUserId().toString(); + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); + NoRepeatSubmitAnnotation cacheLock = method.getAnnotation(NoRepeatSubmitAnnotation.class); + String prefix = cacheLock.prefix(); + if (StringUtils.isBlank(prefix)){ + throw new DkException("CacheLock prefix can't be null"); + } + // 拼接 key + String delimiter = cacheLock.delimiter(); + StringBuilder sb = new StringBuilder(); + sb.append(prefix).append(delimiter).append(phone); + final String lockKey = sb.toString(); + final String UUID = java.util.UUID.randomUUID().toString(); + try { + // 获取锁 + boolean success = redisTemplate.opsForValue().setIfAbsent(lockKey,UUID,cacheLock.expire(),cacheLock.timeUnit()); + if (!success){ + + throw new DkException("请勿重复提交"); + } + Object result= joinPoint.proceed(); + return result; + }finally { + // 最后记得释放锁 + DefaultRedisScript redisScript = new DefaultRedisScript<>(RELEASE_LOCK_LUA_SCRIPT,Long.class); + Long result = redisTemplate.execute(redisScript, Collections.singletonList(lockKey),UUID); + } + + } + +} diff --git a/face-server/src/main/java/com/dkha/server/aspect/portraitThread.java b/face-server/src/main/java/com/dkha/server/aspect/portraitThread.java new file mode 100644 index 0000000..467e640 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/aspect/portraitThread.java @@ -0,0 +1,41 @@ +package com.dkha.server.aspect; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: portraitThread + * @Package com.dkha.server.aspect + * @author: yangjun + * @date: 2019/12/27 16:48 + * @Copyright: 成都电科慧安 + */ +public class portraitThread implements Runnable{ + + /** + * 线程名称 + */ + private String threadName; + + /** + * 构造函数 + * + * @param threadName 线程名称 + */ + public portraitThread(String threadName) { + this.threadName = threadName; + } + + @Override + public void run() { + for (int i = 0; i < 100; i++) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("--->>>"+"开始执行"+i); + } + + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/common/config/InitStartDateConfig.java b/face-server/src/main/java/com/dkha/server/common/config/InitStartDateConfig.java new file mode 100644 index 0000000..b4f1714 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/common/config/InitStartDateConfig.java @@ -0,0 +1,32 @@ +package com.dkha.server.common.config; + +import com.dkha.common.util.UtilValidate; +import org.springframework.context.annotation.Bean; + +import java.util.Date; + +/** + * @version V1.0 + * @Description: TODO(系统启动创建一个时间) + * All rights 成都电科慧安 + * @Title: InitStartDateConfig + * @Package com.dkha.server.common.config + * @author: panhui + * @date: 2019/12/15 9:02 + * @Copyright: 成都电科慧安 + */ +public class InitStartDateConfig { + + public static Date initDate; + + static + { + if(UtilValidate.isEmpty(initDate)) + { + initDate=new Date(); + initDate.setHours(0); + initDate.setMinutes(0); + initDate.setSeconds(0); + } + } +} diff --git a/face-server/src/main/java/com/dkha/server/common/config/SwaggerConfig.java b/face-server/src/main/java/com/dkha/server/common/config/SwaggerConfig.java new file mode 100644 index 0000000..bbc5b26 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/common/config/SwaggerConfig.java @@ -0,0 +1,64 @@ +package com.dkha.server.common.config; + +import com.dkha.server.system.common.constant.Constant; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.List; + +import static com.google.common.collect.Lists.newArrayList; + +/** + * Swagger配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + + @Value("${swagger.show}") + private boolean isShow; + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .enable(isShow) + .apiInfo(apiInfo()) + .select() + //加了ApiOperation注解的类,生成接口文档 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + //包下的类,生成接口文档 + //.apis(RequestHandlerSelectors.basePackage("io.renren.modules.job.controller")) + .paths(PathSelectors.any()) + .build() + .directModelSubstitute(java.util.Date.class, String.class) + .securitySchemes(security()); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("face server") + .description("faceServer api文档") + .version("V1.0") + .build(); + } + + + private List security() { + return newArrayList( + new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header") + ); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/common/exception/DkExceptionHandler.java b/face-server/src/main/java/com/dkha/server/common/exception/DkExceptionHandler.java new file mode 100644 index 0000000..8c836df --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/common/exception/DkExceptionHandler.java @@ -0,0 +1,69 @@ +package com.dkha.server.common.exception; + +import com.dkha.common.exception.DkAuthorityException; +import com.dkha.common.exception.DkException; +import com.dkha.common.result.CommonResult; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.server.system.common.utils.Result; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import javax.servlet.http.HttpServletRequest; + +/** + * @Author Spring + * @Since 2019/11/11 16:42 + * @Description 全局异常处理类--用于非系统异常处理 + * 系统异常全局异常处理类 + */ +@RestControllerAdvice +public class DkExceptionHandler extends CommonResult { + + private static final Logger logger = LoggerFactory.getLogger(DkExceptionHandler.class); + + /** + * Dk自定义异常全局处理 + * + * @param ex + * @return + */ + @ExceptionHandler(DkException.class) + public CommonResult handleDkException(DkException ex, HttpServletRequest request) { + logger.error(ex.getMessage(), ex); + return failResult(ex.getMsg()); + } + + /** + * 参数校验异常处理 + * + * @param ex + * @return + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public CommonResult handleDkException(MethodArgumentNotValidException ex) { + logger.error(ex.getMessage(), ex); + return failResult(ex.getBindingResult().getFieldError().getDefaultMessage()); + + } + + /** + * 权限异常拦截--主要用于拦截token + * + * @param ex + * @return + */ + @ExceptionHandler(DkAuthorityException.class) + public CommonResult handleAuthorityException(DkAuthorityException ex) { + logger.error(ex.getMessage(), ex); + return failResult(SystemCode.TOKEN_ERROR.des); + } + + @ExceptionHandler(Exception.class) + public CommonResult handleException(Exception ex,HttpServletRequest request) { + logger.error(ex.getMessage(), ex); + return failResult(SystemCode.HANDLER_FAILED.des); + } +} diff --git a/face-server/src/main/java/com/dkha/server/common/handler/MyMetaObjectHandler.java b/face-server/src/main/java/com/dkha/server/common/handler/MyMetaObjectHandler.java new file mode 100644 index 0000000..7880a1d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/common/handler/MyMetaObjectHandler.java @@ -0,0 +1,43 @@ +package com.dkha.server.common.handler; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.dkha.common.enums.YNEnums; +import com.dkha.server.system.modules.security.user.SecurityUser; +import org.apache.ibatis.reflection.MetaObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Date; + +/** + * 公共字段自动填充处理类 + */ +public class MyMetaObjectHandler implements MetaObjectHandler { + private static final Logger LOGGER = LoggerFactory.getLogger(MyMetaObjectHandler.class); + + + @Override + public void insertFill(MetaObject metaObject) { + + /** + * Ps:此处不能用下划线表示数据库字段,要使用驼峰命名 + */ + + Object isValidData = this.getFieldValByName( + "isValid", metaObject); + if (isValidData == null) { + this.setFieldValByName("isValid", YNEnums.YES.code, metaObject); + } + this.setFieldValByName("createTime", new Date(), metaObject); + this.setFieldValByName("createBy", String.valueOf(0L), metaObject); + this.setFieldValByName("updateTime", new Date(), metaObject); + this.setFieldValByName("updateBy", String.valueOf(0L), metaObject); + } + + @Override + public void updateFill(MetaObject metaObject) { + this.setUpdateFieldValByName("updateTime", new Date(), metaObject); + this.setUpdateFieldValByName("updateBy", String.valueOf(0L), metaObject); + } +} + diff --git a/face-server/src/main/java/com/dkha/server/controllers/CameraController.java b/face-server/src/main/java/com/dkha/server/controllers/CameraController.java new file mode 100644 index 0000000..69d8f51 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/controllers/CameraController.java @@ -0,0 +1,227 @@ +package com.dkha.server.controllers; + +import com.dkha.common.exception.DkException; +import com.dkha.common.page.PageParam; +import com.dkha.common.result.CommonResult; +import com.dkha.common.util.ExcelUtils; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.annotation.NoRepeatSubmitAnnotation; +import com.dkha.server.modules.entities.FaceCameraEntity; +import com.dkha.server.modules.entities.faceCamera.FaceCameraExcel; +import com.dkha.server.modules.entities.faceCamera.FaceCameraInfo; +import com.dkha.server.modules.entities.faceCamera.InsertFaceCamera; +import com.dkha.server.services.FaceCameraService; +import com.dkha.server.system.modules.sys.entity.SysRegionEntity; +import com.dkha.server.system.modules.sys.enums.RegionLevelEnum; +import com.dkha.server.system.modules.sys.enums.RegionTopEnum; +import com.dkha.server.system.modules.sys.service.SysRegionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import static com.dkha.common.systemcode.SystemCode.EXCEL_ERROR_DATA; + +@RestController +@RequestMapping(value = "/camera") +@Api(tags = "摄像头管理") +@Slf4j +public class CameraController extends CommonResult { + + @Resource + private SysRegionService sysRegionService; + + @Resource + private FaceCameraService faceCameraServiceImpl; + + @ApiOperation(value = "摄像头列表") + @PostMapping(value = "/getList") + @RequiresPermissions("camera:list") + public CommonResult getList(@ApiParam(required = true, name = "pageParam", value = "{\n" + + " \"note\": {\n" + + " \"cameraName\": \"摄像头名称\",\n" + + " \"cameraRegion\":\"摄像头区域\",\n" + + " \"cameratLocationtypeId\":\"位置类型\",\n" + + + "\"status\":\"是否运行 Y启动 N未启动\"\n" + + " },\n" + + " \"pageNo\": 1,\n" + + " \"pageSize\": 10,\n" + + " \"sort\": {\n" + + " \n" + + " },\n" + + " \"sex\": \"desc\"\n" + + "}") @RequestBody PageParam pageParam) { + + return successResult(faceCameraServiceImpl.getPage(pageParam)); + } + + @ApiOperation(value = "全部摄像头列表") + @GetMapping(value = "/getAllList") +// @RequiresPermissions("camera:list") + public CommonResult getAllList(String cameraName) { + return successResult(faceCameraServiceImpl.getAll(cameraName)); + } + + + @ApiOperation(value = "查看摄像头信息") + @GetMapping(value = "/findById/{idCamera}") + @RequiresPermissions("camera:info") + public CommonResult findById(@PathVariable("idCamera") long idCamera) { + return successResult(faceCameraServiceImpl.findById(idCamera)); + } + + @PostMapping(value = "/insert") + @ApiOperation(value = "新增摄像头") + @RequiresPermissions("camera:save") + @NoRepeatSubmitAnnotation(prefix = "camera/insert") + public CommonResult insert(@RequestBody @Valid InsertFaceCamera insertFaceCamera) { + try { + faceCameraServiceImpl.insertCamera(insertFaceCamera); + } catch (DkException e) { + return failResult(e.getMessage()); + } catch (Exception e) { + log.error("添加摄像头异常===>", e.getMessage()); + return failResult("操作失败"); + } + return successResult("添加成功"); + } + + +// @ApiOperation(value = "获取摄像头卡口树状图") +// @GetMapping(value = "/getBayonet") +// public CommonResult getBayonet() { +// return successResult(faceCameraServiceImpl.getBayonet(RegionTopEnum.FATHER.value())); +// } + + @ApiOperation(value = "获取摄像头卡口树状图") + @GetMapping(value = "/getBayonet") + public CommonResult getBayonet() { + List regionByLevel = sysRegionService.getRegionByLevel(RegionLevelEnum.ONE.value()); + List>> lists = new ArrayList<>(); + List> results = new ArrayList<>(); + for (SysRegionEntity region:regionByLevel) { + List> bayonet = faceCameraServiceImpl.getBayonet(region.getPid()); + results.add(bayonet.get(0)); + } + return successResult(results); + } + + +// @ApiOperation(value = "获取摄像头区域树状图") +// @GetMapping(value = "/getRegion") +// public CommonResult getRegion() { +// return successResult(faceCameraServiceImpl.getRegion(RegionTopEnum.FATHER.value())); +// } + + @ApiOperation(value = "获取摄像头区域树状图") + @GetMapping(value = "/getRegion") + public CommonResult getRegion() { + List regionByLevel = sysRegionService.getRegionByLevel(RegionLevelEnum.ONE.value()); + List> lists = new ArrayList<>(); + for (SysRegionEntity region:regionByLevel) { + List> mapList = faceCameraServiceImpl.getRegion(region.getPid()); + lists.add(mapList.get(0)); + } + return successResult(lists); + } + + @ApiOperation(value = "获取当前区域下的摄像头") + @GetMapping(value = "/getRegion/{regionId}") + public CommonResult getRegionCamera(@PathVariable("regionId") long regionId) { + return successResult(faceCameraServiceImpl.getCameraByRegionId(regionId)); + } + + @ApiOperation(value = "获取当前区域下尚未布控的摄像头") + @GetMapping(value = "/getRegion/unControl/{regionId}") + public CommonResult getRegionUnControlCamera(@PathVariable("regionId") long regionId) { + return successResult(faceCameraServiceImpl.getRegionUnControlCamera(regionId)); + } + + @ApiOperation(value = "获取当前区域下的所有摄像头") + @GetMapping(value = "/getRegion/all/{regionId}") + public CommonResult getAllRegionCamera(@PathVariable("regionId") long regionId) { + return successResult(faceCameraServiceImpl.getAllCameraByRegionId(regionId)); + } + + @ApiOperation(value = "删除摄像头") + @GetMapping(value = "/delete/{idCamera}") + @RequiresPermissions("camera:del") + public CommonResult delete(@PathVariable("idCamera") long idCamera) { + return successResult(faceCameraServiceImpl.delete(idCamera)); + } + + @ApiOperation(value = "更改摄像头状态") + @GetMapping(value = "/{idCamera}/{status}") + public CommonResult status(@PathVariable("idCamera") long idCamera, @PathVariable("status") boolean status) { + return successResult(faceCameraServiceImpl.status(idCamera, status)); + } + + @ApiOperation(value = "修改摄像头") + @PostMapping(value = "/update") + @RequiresPermissions("camera:update") + public CommonResult update(@RequestBody @Valid FaceCameraInfo faceCameraInfo) { + return successResult(faceCameraServiceImpl.update(faceCameraInfo)); + } + + + @ApiOperation(value = "经纬度查询摄像头信息") + @GetMapping(value = "/findByCoordinate") + public CommonResult findByCoordinate(@ApiParam(name = "经度") @RequestParam(name = "cameraLatitude") String cameraLongitude, + @RequestParam(name = "cameraLatitude") String cameraLatitude) { + FaceCameraEntity faceCameraInfo = faceCameraServiceImpl.findByCoordinate(cameraLongitude, cameraLatitude); + if (UtilValidate.isNotEmpty(faceCameraInfo)) { + return successResult(faceCameraInfo); + } + return failResult("未能查询到该摄像头"); + } + + @GetMapping(value = "/downloadExcel") + @ApiOperation(value = "下载模板") + public void downloadIncomeExcel(HttpServletResponse servletResponse) throws Exception { + ExcelUtils.downloadTemplate(servletResponse, "摄像头导入模板"); + } + + @PostMapping(value = "/import") + @ApiOperation(value = "摄像头导入功能") + public CommonResult importDailyTimeStatisticsExcel(@RequestParam(name = "processFile", required = true) MultipartFile multipartFile, + HttpServletResponse response + ) { + List data = faceCameraServiceImpl.importExcel(multipartFile); + if (UtilValidate.isEmpty(data)) { + return successResult("上传成功"); + } + return failResult(EXCEL_ERROR_DATA.code, "存在错误数据", data); + } +// private CheckTtl checkTtl; +// @GetMapping(value = "/test") +// @ApiOperation(value = "下载模板") +// public void test() { +// Lock lock = new Lock(new ConsulClient(), "lock-key", checkTtl); +// try { +// if (lock.lock(true, 500L, null)) { +// log.info("Thread {} start!", 1); +// // 处理业务逻辑 +// log.info("Thread {} end!", 2); +// }else { +// log.info("Thread {} end!", 3); +// } +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } finally { +// lock.unlock(); +// } +// } + + +} diff --git a/face-server/src/main/java/com/dkha/server/controllers/CompareController.java b/face-server/src/main/java/com/dkha/server/controllers/CompareController.java new file mode 100644 index 0000000..6fc85ae --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/controllers/CompareController.java @@ -0,0 +1,62 @@ +package com.dkha.server.controllers; + +import com.dkha.common.exception.DkException; +import com.dkha.common.modules.vo.facelib.CompareRequestVo; +import com.dkha.common.result.CommonResult; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.services.ICompareService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author Spring + * @Since 2019/12/11 17:05 + * @Description + */ +@RestController +@RequestMapping(value = "/compare") +@Api(tags = "比对相关") +@Slf4j +public class CompareController extends CommonResult { + + @Autowired + private ICompareService compareService; + + @PostMapping(value = "/grouping") + @ApiOperation(value = "分组比对") + @RequiresPermissions("face:group:comparison") + public CommonResult groupingCompare( + @ApiParam(required = true, name = "compareRequestVo", value = "") + @RequestBody CompareRequestVo compareRequestVo) { + return successResult(compareService.groupingCompare(compareRequestVo)); + } + + @PostMapping(value = "/oneToOne") + @ApiOperation(value = "一比一比对") + @RequiresPermissions("face:onetoone:comparison") + public CommonResult oneToOneCompare( + @ApiParam(required = true, name = "compareRequestVo", value = "") + @RequestBody CompareRequestVo compareRequestVo) { + return successResult(compareService.oneToOne(compareRequestVo)); + } + @PostMapping(value = "/oneToOneImage") + @ApiOperation(value = "一比一比对上传 Image") + //@RequiresPermissions("employment:contract:upload") + public CommonResult oneToOneCompareImage1( + @ApiParam(required = true, name = "compareRequestVo", value = "") + @RequestBody CompareRequestVo compareRequestVo) { + if (UtilValidate.isEmpty(compareRequestVo.getUrlList())) { + throw new DkException("请选择需要比对的图片"); + } + String fileName = compareRequestVo.getUrlList().get(0); + return successResult(compareService.setFaceCompare(fileName.substring(fileName.indexOf(",")+1))); + } +} diff --git a/face-server/src/main/java/com/dkha/server/controllers/ControlTaskController.java b/face-server/src/main/java/com/dkha/server/controllers/ControlTaskController.java new file mode 100644 index 0000000..2e8d4b4 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/controllers/ControlTaskController.java @@ -0,0 +1,263 @@ +package com.dkha.server.controllers; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.enums.YNEnums; +import com.dkha.common.exception.DkException; +import com.dkha.common.modules.vo.control.TaskControlVO; +import com.dkha.common.modules.vo.control.VideoControlVo; +import com.dkha.common.modules.vo.facelib.CompareRequestVo; +import com.dkha.common.modules.vo.facelib.FileImageVo; +import com.dkha.common.page.PageParam; +import com.dkha.common.result.CommonResult; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.annotation.NoRepeatSubmitAnnotation; +import com.dkha.server.modules.entities.*; +import com.dkha.server.services.*; +import com.dkha.server.system.common.validator.ValidatorUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.regex.Pattern; + +/** + * @version V1.0 + * @Description: 布控任务控制器 + * @Title: + * @author: huangyugang + * @date: 2019-12-09 10:25 + * @Copyright: 成都电科慧安 + */ +@RestController +@RequestMapping("/control") +@Api(tags = "布控任务管理") +@Slf4j +public class ControlTaskController extends CommonResult { + + @Autowired + IControlTaskService iControlTaskService; + @Autowired + IControlLibraryMidService iControlLibraryMidService; + @Autowired + IControlBayonetMidService iControlBayonetMidService; + @Autowired + private ICompareService compareService; + + @ApiOperation(value = "获取布控任务列表") + @PostMapping(value = "/tasklist") + public CommonResult getTaskList(@ApiParam(required = true, name = "pageParam", value = "{\n" + + " \"note\": {\n" + + " \"taskName\": \"任务名称\",\n" + + " \"createBy\":\"创建人\",\n" + + " \"disposalType\":\" 处置类型-码值视频对比 -1 抓捕类1,监控类2,提示类0 默认选择0\",\n" + + " \"controlType\":\"布控类型-码值 长期布控 0,临时布控 1 默认选择0\",\n" + + " \"isValid\":\"运行中:0 停止运行-1 暂停运行 1\",\n" + + " },\n" + + " \"pageNo\": 1,\n" + + " \"pageSize\": 10,\n" + + "}") @RequestBody PageParam pageParam, BindingResult bindingResult) { + String disposetype= pageParam.getNote().get("disposalType"); + Page controlTask=null; + if(!StringUtils.isEmpty(disposetype)){ + controlTask = iControlTaskService.getList(pageParam,Integer.parseInt(disposetype)); + }else + { + controlTask = iControlTaskService.getList(pageParam,0); + } + return successResult(controlTask); + } + @ApiOperation(value = "获取视频比对布控任务列表") + @PostMapping(value = "/tasklistvideo") + public CommonResult getTaskVideoList(@ApiParam(required = true, name = "pageParam", value = "{\n" + + " \"note\": {\n" + + " \"taskName\": \"任务名称\",\n" + + " \"createBy\":\"创建人\",\n" + + " },\n" + + " \"pageNo\": 1,\n" + + " \"pageSize\": 10,\n" + + "}") @RequestBody PageParam pageParam, BindingResult bindingResult) { + + + Page controlTask = iControlTaskService.getList(pageParam,-1); + + + return successResult(controlTask); + } + + @PostMapping(value = "/inserttask") + @ApiOperation(value = "新增任务") + @NoRepeatSubmitAnnotation(prefix = "insertTask") + public CommonResult insertTask(@ApiParam(required = true, name = "controlTask") @RequestBody @Valid TaskControlVO taskvo , BindingResult bindingResult) { + this.validate(bindingResult); + if (UtilValidate.isEmpty(taskvo)) { + return failResult(SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.des, null); + } + return iControlTaskService.addControlTask(taskvo); + } + + + @PutMapping(value = "/updatetask") + @ApiOperation(value = "修改任务:修改名称,处置类别,备注") + public CommonResult updateTask(@ApiParam(required = true, name = "controlTask") @RequestBody TaskControlVO taskvo ) { + if (UtilValidate.isEmpty(taskvo)) { + return failResult(SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.des, null); + } + return iControlTaskService.updateControlTask(taskvo); + } + + + @DeleteMapping("/deletetask/{taskId}") + @ApiParam(required = true, name = "taskId", value = "") + @ApiOperation(value = "删除布控任务") + public CommonResult deleteTask(@PathVariable(value = "taskId") String taskId) { + if (UtilValidate.isEmpty(taskId)) { + return failResult("布控任务id不能为空!"); + } + return iControlTaskService.deleteControlTask(taskId); + } + + @GetMapping("/viewcontrol/{taskId}") + @ApiParam(required = true, name = "taskId", value = "") + @ApiOperation(value = "查看布控详细信息") + public CommonResult GetControlTaskByID(@PathVariable("taskId") String taskId){ + if(UtilValidate.isEmpty(taskId)) + { + return new CommonResult( null,SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "任务id不能为空!"); + } + ControlTask controlTask= iControlTaskService.getById(taskId); + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("id_control_task", taskId); + List listlibrarymid = iControlLibraryMidService.list(queryWrapper); + Listlistlib=new ArrayList<>(); + if(listlibrarymid!=null&&listlibrarymid.size()>0) { + for (ControlLibraryMid clm : listlibrarymid) { + listlib.add(clm.getIdFactory().toString()); + } + } + List faceCameras = iControlBayonetMidService.selectFaceCameraBytaskID(taskId); + controlTask.setListfacecamera(faceCameras); + controlTask.setLibIds(listlib); + + return successResult(controlTask); + + } + + @GetMapping("/gettaskcamera/{taskno}") + @ApiParam(required = true, name = "taskId", value = "") + @ApiOperation(value = "根据任务获取摄像头列表") + public CommonResult GetCameraListByTaskID(@PathVariable("taskno") String taskno){ + if(UtilValidate.isEmpty(taskno)) + { + return new CommonResult( null,SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "任务id不能为空!"); + } + return iControlTaskService.getCameraListByTaskNO(taskno); + } + + @DeleteMapping("/stopcontrol/{taskId}") + @ApiParam(required = true, name = "taskId", value = "") + @ApiOperation(value = "根据任务ID停止任务") + public CommonResult StopControlByTaskID(@PathVariable("taskId") String taskId){ + if(UtilValidate.isEmpty(taskId)) + { + return new CommonResult( null,SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "任务id不能为空!"); + } + return iControlTaskService.stopControlByTaskID(taskId); + } + + @PostMapping("/suspendcontrol/{taskId}") + @ApiParam(required = true, name = "taskId", value = "") + @ApiOperation(value = "根据任务ID暂停任务") + public CommonResult SuspendByTaskID(@PathVariable("taskId") String taskId){ + if(UtilValidate.isEmpty(taskId)) + { + return new CommonResult( null,SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "任务id不能为空!"); + } + return iControlTaskService.suspendControlByTaskID(taskId); + } + @PostMapping("/resumecontrol/{taskId}") + @ApiParam(required = true, name = "taskId", value = "") + @ApiOperation(value = "根据任务ID恢复任务") + public CommonResult resumeByTaskID(@PathVariable("taskId") String taskId){ + if(UtilValidate.isEmpty(taskId)) + { + return new CommonResult( null,SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "任务id不能为空!"); + } + return iControlTaskService.resumeControlByTaskID(taskId); + } + + @ApiOperation("上传人像附件布控") + @PostMapping("/addtaskfaceFile") + @NoRepeatSubmitAnnotation(prefix = "addtaskfaceFile") + public CommonResult addtaskfaceFile(@RequestParam("file") MultipartFile multipartFile) { + if(multipartFile.isEmpty()){ + return new CommonResult( null,SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "上传文件不能为空!"); + } + return iControlTaskService.addtaskfaceFile(multipartFile); + } + + @PostMapping(value = "/getImage") + @ApiOperation(value = "上传 Image") + public CommonResult oneToOneCompareImage1( + @ApiParam(required = true, name = "compareRequestVo", value = "") + @RequestBody CompareRequestVo compareRequestVo) { + if (UtilValidate.isEmpty(compareRequestVo.getUrlList())) { + throw new DkException("请选择需要比对的图片"); + } + String fileName = compareRequestVo.getUrlList().get(0); + String s = compareService.setFaceCompare(fileName.substring(fileName.indexOf(",") + 1)); + return successResult(iControlTaskService.addtaskfaceFiles(s)); + } + @ApiOperation("上传人像附件布控Base64") + @PostMapping("/addtaskfaceFiles") + @NoRepeatSubmitAnnotation(prefix = "addtaskfaceFiles") + public CommonResult addtaskfaceFiles( @ApiParam(required = true, name = "FileImageVo", value = "") + @RequestBody FileImageVo fileImageVo) { + if(fileImageVo.getUrl().isEmpty()){ + return new CommonResult( null,SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "上传文件不能为空!"); + } + return iControlTaskService.addtaskfaceFiles(fileImageVo.getUrl()); + } + @ApiOperation("添加比对视频文件") + @PostMapping("/addcomparvideoFile") + @NoRepeatSubmitAnnotation(prefix = "addcomparvideoFile") + public CommonResult addvideofaceFile(@ApiParam(required = true, name = "file", value = "视频文件")@RequestParam("file") MultipartFile multipartFile) { + if(multipartFile.isEmpty()){ + return new CommonResult( null,SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "上传文件不能为空!"); + } + + return iControlTaskService.addcomplevideoFile(multipartFile); + } + + @ApiOperation("新增视频对比") + @PostMapping("/insertcmpviedo") + @RequiresPermissions("face:video:comparison") + @NoRepeatSubmitAnnotation(prefix = "insertcmpviedo") + public CommonResult addVideCompare(@ApiParam(required = true, name = "controlVO", value = "") @RequestBody @Valid VideoControlVo controlVO , BindingResult bindingResult) { + + this.validate(bindingResult); + if (UtilValidate.isEmpty(controlVO)) { + return failResult(SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.des, null); + } + return iControlTaskService.addcomplevideoTask(controlVO); + + + } + + + +} diff --git a/face-server/src/main/java/com/dkha/server/controllers/FaceController.java b/face-server/src/main/java/com/dkha/server/controllers/FaceController.java new file mode 100644 index 0000000..2a7ddaf --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/controllers/FaceController.java @@ -0,0 +1,113 @@ +package com.dkha.server.controllers; + +import com.alibaba.fastjson.JSONObject; +import com.dkha.common.exception.DkException; +import com.dkha.common.fileupload.MinioUtil; +import com.dkha.common.page.PageParam; +import com.dkha.common.result.CommonResult; +import com.dkha.common.util.ExcelUtils; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.annotation.NoRepeatSubmitAnnotation; +import com.dkha.server.modules.entities.FaceCameraEntity; +import com.dkha.server.modules.entities.faceCamera.FaceCameraExcel; +import com.dkha.server.modules.entities.faceCamera.FaceCameraInfo; +import com.dkha.server.modules.entities.faceCamera.InsertFaceCamera; +import com.dkha.server.services.FaceCameraService; +import com.dkha.server.system.modules.sys.entity.SysRegionEntity; +import com.dkha.server.system.modules.sys.enums.RegionLevelEnum; +import com.dkha.server.system.modules.sys.service.SysRegionService; +import com.dkha.server.util.RequestUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import sun.misc.BASE64Decoder; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.*; + +import static com.dkha.common.systemcode.SystemCode.EXCEL_ERROR_DATA; + + +@RestController +@RequestMapping("faces") +@Slf4j +public class FaceController extends CommonResult { + @Resource + private MinioUtil minioUtil; + + private Map faceRes = new HashMap<>(); + + private List list = new ArrayList<>(); + public FaceController(){ + FaceResEntity resEntity = new FaceResEntity(); + resEntity.setName("jhx"); + resEntity.setRphoto("http://192.168.60.52:9000/school/face/jhx.jpg"); + faceRes.put("eYJST7eY2mbnjGZvywPfxg==",resEntity); + } + + @RequestMapping("callback") + public String callback(HttpServletRequest request) throws IOException { + try { + String streamText = RequestUtil.getStreamText(request); + System.out.println(streamText); + JSONObject object = JSONObject.parseObject(streamText); + String str = object.get("photo").toString(); + String xsd = object.get("confidence").toString(); + byte[] _byte = new BASE64Decoder().decodeBuffer(str); + InputStream inputStream = new ByteArrayInputStream(_byte); + + String object1 = "http://192.168.60.52:9000/test/"+minioUtil.uploadImage(inputStream,"").getString("path"); + System.out.println(object1); + if( faceRes.get(object.getString("ImageID"))!=null){ + FaceResEntity resEntity = faceRes.get(object.getString("ImageID")); + resEntity.setCphoto(object1); + resEntity.setXsd(xsd.substring(0,5)); + list.add(resEntity); + } + } catch (Exception e) { + e.printStackTrace(); + } + return "ok"; + } + + @GetMapping("list") + public List getList(){ + return list; + } + +/* @GetMapping("one") + public List queryWrapper=new QueryWrapper<>(); + FaceLibrary faceLibrary=new FaceLibrary(); + faceLibrary.setIsValid("Y"); +// faceLibrary.setFactoryType("-1"); + queryWrapper.setEntity(faceLibrary); + queryWrapper.ne("factory_type","-1"); + libNumber=iFaceLibraryService.getBaseMapper().selectCount(queryWrapper); + }catch (Exception e){} + + try + { + //人脸数量 + QueryWrapper queryWrapper=new QueryWrapper<>(); + Portrait portrait=new Portrait(); + portrait.setIsValid("Y"); + queryWrapper.setEntity(portrait); + faceNumber=iPortraitService.getBaseMapper().selectCount(queryWrapper); + }catch (Exception e){} + + try + { + //布控任务数量 + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.ne("disposal_type","-1"); + taskNumber=iControlTaskService.getBaseMapper().selectCount(queryWrapper); + }catch (Exception e){} + + try { + //预警数量 + ApiAlarmVO apiAlarmVO=new ApiAlarmVO(); + PageVO pageVO=new PageVO(); + pageVO.setPageSize(1); + pageVO.setPageNo(1); + apiAlarmVO.setPage(pageVO); + ApiVO warningVO = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARMS_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + if (!UtilValidate.isEmpty(warningVO)) { + if (!UtilValidate.isEmpty(warningVO) && !UtilValidate.isEmpty(warningVO.getData())) { + WarningBayonetReturnVO wvo = gson.fromJson(gson.toJson(warningVO.getData()), WarningBayonetReturnVO.class); + warnNumber=wvo.getPage().getTotal(); + } + } + + }catch (Exception e) + { + log.error("首页展示数据失败:{}",e.getMessage()); + } + Map myMap=new HashMap<>(); + myMap.put("libNumber",libNumber); + myMap.put("faceNumber",faceNumber); + myMap.put("taskNumber",taskNumber); + myMap.put("warnNumber",warnNumber); + myMap.put("daysOfOperation",daysOfOperation); + return successResult(myMap); + } +} diff --git a/face-server/src/main/java/com/dkha/server/controllers/ResourcesController.java b/face-server/src/main/java/com/dkha/server/controllers/ResourcesController.java new file mode 100644 index 0000000..218e0a3 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/controllers/ResourcesController.java @@ -0,0 +1,369 @@ +package com.dkha.server.controllers; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.enums.YNEnums; +import com.dkha.common.exception.DkException; +import com.dkha.common.modules.vo.face.ApiSearchFaceRectVO; +import com.dkha.common.modules.vo.facelib.FileImageVo; +import com.dkha.common.modules.vo.position.PortraitListVo; +import com.dkha.common.page.PageParam; +import com.dkha.common.result.CommonResult; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.IdCardUtil; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.annotation.NoRepeatSubmitAnnotation; +import com.dkha.server.modules.entities.FaceLibrary; +import com.dkha.server.modules.entities.Portrait; +import com.dkha.server.services.IFaceLibraryService; +import com.dkha.server.services.IPortraitService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ClassPathResource; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ResourcesController + * @Package com.dkha.server.controllers + * @author: yangjun + * @date: 2019/12/9 15:49 + * @Copyright: 成都电科慧安 + */ +@RestController +@RequestMapping("/Resources") +@Api(tags="资源管理") +public class ResourcesController extends CommonResult { + public static final Logger logger = LoggerFactory.getLogger(ResourcesController.class); + /** + * 库 + */ + @Autowired + private IFaceLibraryService iFaceLibraryService; + /** + * 人像 + */ + @Autowired + private IPortraitService iPortraitService; + @PostMapping("/faceLib") + @ApiParam(required = true, name = "faceLibrary", value = "") + @ApiOperation(value = "新增库") + @RequiresPermissions("portrait:lib:save") + @NoRepeatSubmitAnnotation(prefix = "Resources/faceLib") + public CommonResult addFaceLibrary(@ApiParam(required = true, name = "faceLibrary", value = "{\n" + + " \"factoryName\": \"库名称\",\n" + + " \"factoryType\": \"库类型\",\n" + + " \"remarks\": \"备注\"\n" + + "}")@RequestBody FaceLibrary faceLibrary){ + if (UtilValidate.isEmpty(faceLibrary.getFactoryName())){ + throw new DkException("库名称不能为空"); + } + faceLibrary.setIsValid(YNEnums.YES.code); + faceLibrary.setCreateTime(new Date()); + faceLibrary.setUpdateTime(new Date()); + FaceLibrary faceLibrar = iFaceLibraryService.addLibrary(faceLibrary); + if(UtilValidate.isEmpty(faceLibrar)) + { + return failResult("添加任性库失败失败"); + } + return successResult(faceLibrar); + } + @PutMapping("/updateLibrary") + @ApiParam(required = true, name = "faceLibrary", value = "") + @ApiOperation(value = "修改库") + @RequiresPermissions("portrait:lib:update") + public CommonResult updateLibrary(@ApiParam(required = true, name = "faceLibrary", value = "{\n" + + " \"idFactory\": \"库id\",\n" + + " \"factoryName\": \"库名称\",\n" + + " \"factoryType\": \"库类型\",\n" + + " \"remarks\": \"备注\"\n" + + "}")@RequestBody FaceLibrary faceLibrary){ + if (UtilValidate.isEmpty(faceLibrary.getIdFactory())){ + throw new DkException("库ID不能为空"); + } + FaceLibrary faceLibrar = iFaceLibraryService.updateLibrary(faceLibrary); + if(UtilValidate.isEmpty(faceLibrar)) + { + return failResult("修改库失败"); + } + return successResult(faceLibrar); + } + @DeleteMapping("/faceLib/{libraryId}") + @ApiParam(required = true, name = "faceLibrary", value = "") + @ApiOperation(value = "删除库") + @RequiresPermissions("portrait:lib:del") + public CommonResult deleteLibrary(@ApiParam(required = true, name = "libraryId", value = "") + @PathVariable(value = "libraryId") Long libraryId){ + if (UtilValidate.isEmpty(libraryId)){ + throw new DkException("库id不能为空"); + } + FaceLibrary faceLibrar; + try { + faceLibrar= iFaceLibraryService.deleteLibrary(libraryId); + }catch (DkException e){ + logger.error(e.getMessage(), e); + return failResult(Integer.valueOf(e.getCode()),e.getMsg(), null); + } catch (Exception e) { + logger.error(e.getMessage(), e); + return failResult(SystemCode.HANDLER_FAILED.des); + } + return successResult(faceLibrar); + } + + /** + * 分页查询 + * @return + */ + @PostMapping("/libraryPage") + @ApiOperation(value = "人像库分页查询") + @RequiresPermissions("portrait:lib:info") + public CommonResult getLibraryPage(@ApiParam(required = true, name = "pageParam", value = "{\n" + + "\t\"pageNo\": \"当前页码\",\n" + + "\t\"pageSize\": \"每页显示数量 默认10\",\n" + + "\t\"note\": {\n" + + "\t\t\"factoryName\": \"库名称\"\n" + + "\t}\n" + + "}")@RequestBody PageParam pageParam){ + Page page = iFaceLibraryService.queryLibrary(pageParam); + return successResult(page); + } + @ApiOperation("上传人像附件") + @PostMapping("/addFile/{libraryId}") + @RequiresPermissions("portrait:save") + //@NoRepeatSubmitAnnotation(prefix = "Resources/addFile") + public CommonResult addFile(@PathVariable("libraryId") String libraryId, @RequestParam("processFile") MultipartFile multipartFile) { + if(UtilValidate.isEmpty(libraryId) ){ + throw new DkException("目标库不能为空"); + } + if(UtilValidate.isEmpty(multipartFile)){ + throw new DkException("请选择图片"); + } + Portrait portrait; + try { + portrait = iPortraitService.addPortrait(libraryId, multipartFile); + }catch (DkException e){ + logger.error(e.getMessage(), e); + return failResult(Integer.valueOf(e.getCode()),e.getMsg(), null); + } catch (Exception e) { + logger.error(e.getMessage(), e); + return failResult(SystemCode.HANDLER_FAILED.des); + } + + return successResult(portrait); + } + + @ApiOperation("布控图片上传人像附件") + @PostMapping("/addpngFile/{libraryId}") + @RequiresPermissions("portrait:save") + public CommonResult addpngFile(@PathVariable("libraryId") String libraryId, @RequestParam("processFile") MultipartFile multipartFile) { + if(UtilValidate.isEmpty(libraryId) ){ + throw new DkException("目标库不能为空"); + } + if(UtilValidate.isEmpty(multipartFile)){ + throw new DkException("请选择图片"); + } + Portrait portrait; + try { + portrait = iPortraitService.addPortraitPng(libraryId, multipartFile); + }catch (DkException e){ + logger.error(e.getMessage(), e); + return failResult(Integer.valueOf(e.getCode()),e.getMsg(), null); + } catch (Exception e) { + logger.error(e.getMessage(), e); + return failResult(SystemCode.HANDLER_FAILED.des); + } + + return successResult(portrait); + } + + @ApiOperation("人像检测") + @PostMapping("/pictureDetection") + //@RequiresPermissions("employment:contract:upload") + public CommonResult pictureDetection(@RequestParam("processFile") MultipartFile multipartFile) { + + if(UtilValidate.isEmpty(multipartFile)){ + throw new DkException("请选择图片"); + } + List apiSearchFaceRectVOS = new ArrayList<>(); + try{ + apiSearchFaceRectVOS = iPortraitService.pictureDetection(multipartFile); + }catch (DkException e){ + logger.error(e.getMessage(), e); + return failResult(Integer.valueOf(e.getCode()),e.getMsg(), null); + } catch (Exception e) { + logger.error(e.getMessage(), e); + return failResult(SystemCode.HANDLER_FAILED.des); + } + return successResult(apiSearchFaceRectVOS); + } + @ApiOperation("批量上传人像Base64") + @PostMapping("/batch/{libraryId}") + //@RequiresPermissions("employment:contract:upload" + public CommonResult addbatch(@PathVariable("libraryId") String libraryId, @RequestBody FileImageVo fileImageVo) { + if(UtilValidate.isEmpty(libraryId) ){ + throw new DkException("目标库不能为空"); + } + List portraits = new ArrayList<>(); + Portrait portrait = null; + /**base64上传到文件服务器的地址*/ + if(UtilValidate.isEmpty(fileImageVo.getUrls())){ + throw new DkException("请选择图片"); + }else{ + try { + if (fileImageVo.getUrls().size() > 0) { + for (String url : + fileImageVo.getUrls()) { + portrait = iPortraitService.addPortraitPngs(libraryId, url); + portraits.add(portrait); + } + } + } catch(Exception e){ + logger.error("批量上传人像异常" + e.getMessage()); + return failResult(e.getMessage()); + } + } + return successResult(portraits); + } + @ApiOperation("批量上传人像") + @PostMapping("/addFiles/{libraryId}") + //@RequiresPermissions("employment:contract:upload" + public CommonResult addFiles(@PathVariable("libraryId") String libraryId, @RequestParam("processFile") MultipartFile[] multipartFile) { + if(UtilValidate.isEmpty(libraryId) ){ + throw new DkException("目标库不能为空"); + } + if(UtilValidate.isEmpty(multipartFile)){ + throw new DkException("请选择图片"); + } + List portraits; + try { + portraits = iPortraitService.addPortraits(libraryId, multipartFile); + } catch (Exception e) { + logger.error("批量上传人像异常"+e.getMessage()); + return failResult(e.getMessage()); + } + return successResult(portraits); + } + + /** + * 人脸信息分页查询 + * @return + */ + @PostMapping("/queryPortrait") + @ApiOperation(value = "人像分页查询") + @RequiresPermissions("portrait:info") + public CommonResult getPortraitVO(@ApiParam(required = true, name = "pageParam", value = "{\n" + + "\t\"pageNo\": \"当前页码\",\n" + + "\t\"pageSize\": \"每页显示数量 默认10\",\n" + + "\t\"note\": {\n" + + "\t\"name\": \"姓名\",\n" + + "\t\"sex\": \"性别\",\n" + + "\t\"libraryId\": \"库id\"\n" + + "\t}\n" + + "}")@RequestBody PageParam pageParam){ + //ReturnVO page = iPortraitService.queryPortrait(pageParam) + Page page = iPortraitService.queryPortrait(pageParam); + return successResult(page); + } + + @PostMapping("/deletePortraits") + @ApiParam(required = true, name = "idPortrait", value = "") + @ApiOperation(value = "批量删除人像信息") + @RequiresPermissions("portrait:del") + public CommonResult deletePortraits(@ApiParam(required = true, name = "idPortrait", value = "") + @RequestBody PortraitListVo idPortrait){ + if (UtilValidate.isEmpty(idPortrait)){ + throw new DkException("人像id不能为空"); + } + List longs = iPortraitService.deletePortraits(idPortrait.getIdPortrait()); + if(UtilValidate.isEmpty(longs)) + { + return failResult("删除人像失败"); + } + return successResult(longs); + } + + @DeleteMapping("/deletePortrait/{idPortrait}") + @ApiParam(required = true, name = "idPortrait", value = "") + @ApiOperation(value = "删除人像信息") + @RequiresPermissions("portrait:del") + public CommonResult deletePortrait(@ApiParam(required = true, name = "idPortrait", value = "") + @PathVariable(value = "idPortrait") Long idPortrait){ + if (UtilValidate.isEmpty(idPortrait)){ + throw new DkException("人像id不能为空"); + } + Long aLong = iPortraitService.deletePortrait(idPortrait); + if(UtilValidate.isEmpty(aLong)) + { + return failResult("删除人像失败"); + } + return successResult(aLong); + } + + @PutMapping("/updatePortrait") + @ApiParam(required = true, name = "portrait", value = "") + @ApiOperation(value = "修改人像信息") + @RequiresPermissions("portrait:update") + public CommonResult updatePortrait(@ApiParam(required = true, name = "portrait", value = "{\n" + + " \"idPortrait\": \"id\",\n" + + " \"idCard\": \"身份证\",\n" + + " \"name\": \"姓名\",\n" + + " \"sex\": \"性别\"\n" + + "}") @RequestBody Portrait portrait){ + if (UtilValidate.isEmpty(portrait.getIdPortrait())){ + throw new DkException("id不能为空"); + } + if (UtilValidate.isNotEmpty(portrait.getIdCard())) { + if (!IdCardUtil.isValidatedAllIdcard(portrait.getIdCard())) { + throw new DkException(SystemCode.IDCARD_ERROR.code,"身份证号码输入不正确"); + } + } + Portrait portrait1 = iPortraitService.updatePortrait(portrait); + if(UtilValidate.isEmpty(portrait1)) + { + return failResult("修改人像失败"); + } + return successResult(portrait1); + } + @GetMapping(value = "/exportProjectTemplate") + @ApiOperation(value = "导出项目管理excel模板", httpMethod = "GET") + public void exportTemplate(HttpServletResponse response) { + + try { + ClassPathResource classPathResource = new ClassPathResource("项目信息导入模板.xlsx"); + InputStream inputStream = classPathResource.getInputStream(); + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); + response.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode("项目信息导入模板", "UTF-8") + ".xlsx"); + OutputStream out = response.getOutputStream(); + int length = 0; + byte[] bytes = new byte[1024]; + while ((length = inputStream.read(bytes)) != -1) { + out.write(bytes, 0, length); + } + out.flush(); + out.close(); + inputStream.close(); + + } catch (IOException e) { + e.printStackTrace(); + } + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/controllers/SearchController.java b/face-server/src/main/java/com/dkha/server/controllers/SearchController.java new file mode 100644 index 0000000..7493953 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/controllers/SearchController.java @@ -0,0 +1,70 @@ +package com.dkha.server.controllers; + +import com.dkha.common.modules.vo.search.SearchRequestVo; +import com.dkha.common.result.CommonResult; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.services.IFaceLibraryService; +import com.dkha.server.services.IFileService; +import com.dkha.server.services.IPortraitService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * @Author Spring + * @Since 2019/12/9 15:32 + * @Description 人脸检索controller + */ +@RestController +@RequestMapping(value = "/search") +@Api(tags = "检索") +@Slf4j +public class SearchController extends CommonResult { + + @Autowired + private IFaceLibraryService faceLibraryService; + @Autowired + private IPortraitService portraitService; + + @GetMapping(value = "/libraries") + @ApiOperation(value = "获取所有的库") + public CommonResult findFaceLibraries() { + return successResult(faceLibraryService.findFaceLibraries()); + } + + + @PostMapping(value = "/search") + @ApiOperation(value = "检索功能") + public CommonResult search( + @ApiParam(required = true, name = "searchRequestVo", value = "{\n" + + "\t\"libIdList\": [\"要检索的人像库Id集合\"],\n" + + "\t\"faceImageRequestList\": [\"需要检索的图片上传后的url地址,注意,只能有一个url地址,此处参数做成集合形式,是为了兼容后续修改\"],\n" + + "\t\"faceApiResultMap\": {\n" + + "\t\t\"后台传输回来,请求的时候,请再次传输到后台\": 0.0\n" + + "\t},\n" + + "\n" + + "\t\"minScore\": \"搜索阀值\",\n" + + "\t\"pageParam\": {\n" + + "\t\t\"pageNo\": 1,\n" + + "\t\t\"pageSize\": 10,\n" + + "\t\t\"note\": {\n" + + "\t\t\t\"search\": \"姓名/身份证号码\",\n" + + "\t\t\t\"sex\": \"性别 0男 1女\"\n" + + "\t\t},\n" + + "\t\t\"sort\": {},\n" + + "\t\t\"sortString\": \"\"\n" + + "\t}\n" + + "}") + @RequestBody SearchRequestVo searchRequestVo) { + return successResult(portraitService.libSearchPage(searchRequestVo)); + } +} diff --git a/face-server/src/main/java/com/dkha/server/controllers/TrackController.java b/face-server/src/main/java/com/dkha/server/controllers/TrackController.java new file mode 100644 index 0000000..19bf7bc --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/controllers/TrackController.java @@ -0,0 +1,286 @@ +package com.dkha.server.controllers; + +import com.dkha.common.enums.ApiUrlEnum; +import com.dkha.common.modules.vo.camera.BayOnetCameraVO; +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.common.modules.vo.camera.PeopleComparableVO; +import com.dkha.common.modules.vo.camera.PeopleVO; +import com.dkha.common.modules.vo.face.ApiFaceSearchReturnVO; +import com.dkha.common.modules.vo.face.ApiFaceSearchVO; +import com.dkha.common.modules.vo.face.FaceTrackVO; +import com.dkha.common.modules.vo.face.PageVO; +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import com.dkha.common.result.CommonResult; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.DateUtils; +import com.dkha.common.util.TimeUtil; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.modules.entities.FaceCameraEntity; +import com.dkha.server.modules.entities.FaceTrackEntity; +import com.dkha.server.services.FaceCameraService; +import com.dkha.server.services.FaceTrackService; +import com.dkha.server.services.IControlBayonetMidService; +import com.dkha.server.services.impl.TrackTaskImpl; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.sun.jndi.toolkit.url.UrlUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: TrackController + * @Package com.dkha.server.controllers + * @author: panhui + * @date: 2020/1/13 18:02 + * @Copyright: 成都电科慧安 + */ +@RestController +@RequestMapping(value = "/track") +@Api(tags = "轨迹分析") +@Slf4j +public class TrackController extends CommonResult { + + + @Autowired + private Gson gson; + + @Autowired + private FaceTrackService faceTrackService; + @Autowired + private FaceCameraService faceCameraService; + + @GetMapping("/people/{idPortrait}") + @ApiOperation(value = "根据人脸id查询当前数据") + public CommonResult getPeopeTrack(@PathVariable("idPortrait") String idPortrait) { + //查询出唯一的数据 + if (UtilValidate.isEmpty(idPortrait)) { + return failResult("参数不能为空"); + } + List peopleVOS = new ArrayList<>(); + String time = new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis()); + List list = trackTask.getRedisPeopleInfo(time, idPortrait); + if (UtilValidate.isNotEmpty(list)) { + peopleVOS.addAll(list); + } + //把数据库中的json转换为实体类数据 + FaceTrackEntity faceTrackEntity = faceTrackService.queryByIdPortrait(idPortrait); + if (UtilValidate.isNotEmpty(faceTrackEntity)) { + List peopleVOList = gson.fromJson(faceTrackEntity.getLinkedData(), new TypeToken>() { + }.getType()); + peopleVOS.addAll(peopleVOList); + } + if (UtilValidate.isEmpty(peopleVOS)) { + return successResult(new ArrayList<>()); + } +// for (PeopleVO peopleVO : peopleVOS) { +// peopleVO.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(peopleVO.getTimestamp())); +// } + return successResult(peopleVOS); + } + + @DeleteMapping("/people/{idPortrait}/{esId}") + @ApiOperation(value = "删除错误的信息") + public CommonResult deletePeopeTrack(@PathVariable("idPortrait") String idPortrait, @PathVariable("esId") String esId) { + //查询出唯一的数据 + if (UtilValidate.isEmpty(idPortrait)) { + return failResult("参数不能为空"); + } + //把数据库中的json转换为实体类数据 + FaceTrackEntity faceTrackEntity = faceTrackService.queryByIdPortrait(idPortrait); + if (UtilValidate.isEmpty(faceTrackEntity)) { + return successResult(null); + } + List peopleVOS = gson.fromJson(faceTrackEntity.getLinkedData(), new TypeToken>() { + }.getType()); + log.error("处理后{}", peopleVOS.size()); + if (UtilValidate.isEmpty(peopleVOS)) { + return successResult(null); + } + Iterator iterator = peopleVOS.iterator(); + while (iterator.hasNext()) { + if (iterator.next().getEsId().equals(esId)) { + iterator.remove(); + } + } + if (peopleVOS.size() > 0) { + faceTrackEntity.setCharacterData(gson.toJson(peopleVOS.get(0))); + } + faceTrackEntity.setLinkedData(gson.toJson(peopleVOS)); + faceTrackService.updateById(faceTrackEntity); + log.error("处理后{}", peopleVOS.size()); + return successResult(SystemCode.DELETE_SUCCESS.des); + } + + + @Autowired + private TrackTaskImpl trackTask; + +// @GetMapping("/people/test") +// @ApiOperation(value = "测试") +// public CommonResult test(String starTime, String stopTime) { +// +// String time = "2020-01-14"; +//// trackTask.setBingDataCamerID(time); +// Date date=new Date(); +// +// date.setDate(date.getDate()-1); +// System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date)); +//// String startTime = "2020-01-01", stopTime = "2020-02-02"; +//// for(int i=0;i<30+1;i++) +//// { +//// +//// } +//// System.out.println(DateUtils.dayDiff(DateUtils.str2Date(starTime, new SimpleDateFormat("yyyy-MM-dd")), DateUtils.str2Date(stopTime, new SimpleDateFormat("yyyy-MM-dd")))); +// return null; +// } + + + @PostMapping("/people/track") + @ApiOperation(value = "获取轨迹信息") + public CommonResult getTrack(@RequestBody FaceTrackVO faceTrackVO) { + + if (UtilValidate.isEmpty(faceTrackVO) || UtilValidate.isEmpty(faceTrackVO.getStartTime()) || UtilValidate.isEmpty(faceTrackVO.getEndTime()) || UtilValidate.isEmpty(faceTrackVO.getUrl()) || UtilValidate.isEmpty(faceTrackVO.getTrajectoryThreshold())) { + return failResult(SystemCode.ParaIsNull); + } + if (UtilValidate.isNotEmpty(faceTrackVO.getTrajectoryThreshold())) { + faceTrackVO.setTrajectoryThreshold(faceTrackVO.getTrajectoryThreshold() / 100); + } + /* { + "endTime": "2020-01-14", + "startTime": "2020-01-14", + "trajectoryThreshold": 80.0, + "url": "http://10.51.10.201:9001/middleware/20200114/camera/1578962105682-886.jpg" + }*/ + + + //判断是否是否今天 + //如果今天就直接读取redis + //如果不是今天就读取历史 + //如果包含今天或者历史就需要把所有数据读取出来分析 +// String nowTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(System.currentTimeMillis()); + String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis()); + List peopleVOS = new ArrayList<>(); + List libList = new ArrayList<>(); + //表示包含今天需要从redis读取 + //读取redis和数据库中所有需要比对的库id +// if (faceTrackVO.getStartTime().equals(nowTime) && faceTrackVO.getEndTime().equals(nowTime)) { +// //只读取redis所有的数据 +// libList = trackTask.getRedisLibId(nowTime); +// } else { + //读取数据库和redis数据 + if (faceTrackVO.getStartTime().equals(nowTime) || faceTrackVO.getEndTime().equals(nowTime)) { + libList = trackTask.getRedisLibId(nowTime); + } + List dbLibList = faceTrackService.findIdFatoryByTime(faceTrackVO); + if (UtilValidate.isNotEmpty(dbLibList)) { + libList.addAll(dbLibList); + } +// } + //进行人脸库比对、 + List compareIds = trackTask.faceCheck(faceTrackVO.getUrl(), libList, faceTrackVO.getTrajectoryThreshold()); + if (UtilValidate.isEmpty(compareIds)) { + return successResult(peopleVOS); + } + //先获取redis里面的数据,因为当天的数据不会放在数据库中 209 + //67 + compareIds.forEach(e -> + { + List peopleVOList = trackTask.getRedisPeopleInfo(nowTime, e); + if (UtilValidate.isNotEmpty(peopleVOList)) { + peopleVOS.addAll(peopleVOList); + } + }); + + //根据id查询数据 + List trackList = faceTrackService.findTrackByFaceId(compareIds); + //获取redis中的人脸数据 211 214 + if (UtilValidate.isNotEmpty(trackList)) { + trackList.forEach(e -> + { + try { + List list = new ArrayList<>(); + if (UtilValidate.isEmpty(e.getLinkedData()) || e.getLinkedData().equals("[]")) { + list = gson.fromJson(e.getCharacterData(), new TypeToken>() { + }.getType()); + } else { + list = gson.fromJson(e.getLinkedData(), new TypeToken>() { + }.getType()); + } + peopleVOS.addAll(list); +// peopleVOS.add(gson.fromJson(e.getLinkedData(), PeopleVO.class)); + } catch (Exception e1) { + e1.printStackTrace(); + System.out.println(e1.getMessage()); + } + }); + } + if (UtilValidate.isEmpty(peopleVOS)) { + return successResult(peopleVOS); + } + //将数据进行清洗,返回最终的人脸轨迹数据。按照时间绑定list list里面的数据如果那个人每更换摄像头 + //轨迹,那个轨迹只有当前一条,如果那人更换摄像头就会加入一条新摄像头里面的轨迹211 + Map> myMap = trackTask.filterPeople(peopleVOS); + if (UtilValidate.isEmpty(myMap)) { + return successResult(new HashMap<>()); + } + //数据筛选 按天进行分组、然后在筛选 +// trackList + List listPop = new ArrayList<>(); + if (UtilValidate.isNotEmpty(myMap)) { + int dayNum = 0; + if (faceTrackVO.getStartTime().equals(nowTime) && faceTrackVO.getEndTime().equals(nowTime)) { + dayNum = 1; + } else { + dayNum = DateUtils.dayDiff(DateUtils.str2Date(faceTrackVO.getStartTime(), new SimpleDateFormat("yyyy-MM-dd")), DateUtils.str2Date(faceTrackVO.getEndTime(), new SimpleDateFormat("yyyy-MM-dd"))); + + } + + for (int i = 0; i < dayNum + 1; i++) { + Date date = DateUtils.str2Date(faceTrackVO.getStartTime(), new SimpleDateFormat("yyyy-MM-dd")); + date.setDate(date.getDate() + i); + String time = new SimpleDateFormat("yyyy-MM-dd").format(date); + if (myMap.containsKey(time)) { + if (UtilValidate.isNotEmpty(myMap.get(time))) { + listPop.addAll(myMap.get(time)); + } + } + } +// } else { +// if (myMap.containsKey(nowTime)) { +// if (UtilValidate.isNotEmpty(myMap.get(nowTime))) { +// listPop.addAll(myMap.get(nowTime)); +// } +// } +// } + } + //根据摄像头id查询对应的摄像头信息 + if (UtilValidate.isNotEmpty(listPop)) { + + for (PeopleComparableVO pc : listPop) { + try { + CameraInfoVO cameraInfoVO = faceCameraService.selectFaceCameraID(pc.getCameraId()); + if (UtilValidate.isNotEmpty(cameraInfoVO)) { + pc.setCameraInfoVO(cameraInfoVO); + } else { + + } + } catch (Exception e) { + + } + } + } + return successResult(listPop); + } + +} diff --git a/face-server/src/main/java/com/dkha/server/controllers/WarningController.java b/face-server/src/main/java/com/dkha/server/controllers/WarningController.java new file mode 100644 index 0000000..71fb7e1 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/controllers/WarningController.java @@ -0,0 +1,705 @@ +package com.dkha.server.controllers; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.enums.ApiUrlEnum; +import com.dkha.common.enums.ErrEnum; +import com.dkha.common.enums.SEXEnums; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.ApiVO; +import com.dkha.common.modules.vo.face.*; +import com.dkha.common.modules.vo.position.PositionVO; +import com.dkha.common.modules.vo.warning.*; +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import com.dkha.common.result.CommonResult; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.Base64ImageUtils; +import com.dkha.common.util.DateUtils; +import com.dkha.common.util.TimeUtil; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.modules.entities.*; +import com.dkha.server.modules.entities.faceCamera.FaceCameraInfo; +import com.dkha.server.services.*; +import com.google.gson.Gson; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.awt.image.BufferedImage; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.*; + +/** + * @version V1.0 + * @Description: TODO(预警查询功能) + * All rights 成都电科慧安 + * @Title: WarningController + * @Package com.dkha.server.controllers + * @author: panhui + * @date: 2019/12/10 9:37 + * @Copyright: 成都电科慧安 + */ +@RestController +@RequestMapping(value = "/warning") +@Api(tags = "预警查询") +@Slf4j +public class WarningController extends CommonResult { + + @Autowired + private HttpUtil httpUtil; + + @Value("${api.server.prefix}") + private String link; + + @Autowired + private Gson gson; + + + @Autowired + private FaceCameraService faceCameraService; + + + @GetMapping("/todayBayonet/{carmeraId}")// {total} + @ApiOperation(value = "今日抓拍") + public CommonResult todayBayonet(@PathVariable("carmeraId") String carmeraId) { + if (UtilValidate.isEmpty(carmeraId)) { + return failResult(SystemCode.ParaIsNull); + } + ApiAlarmVO apiAlarmVO = new ApiAlarmVO(); + apiAlarmVO.setCameraId(carmeraId); + PageVO pageVO = new PageVO(); + pageVO.setPageSize(1); + pageVO.setStartTimestamp(TimeUtil.toDayStart()); + pageVO.setStopTimestamp(TimeUtil.toDayStop()); + apiAlarmVO.setPage(pageVO); + try { + ApiVO warningVO = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARM_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + BayonetReturnVO bayonetReturnVO = new BayonetReturnVO(); + if (!UtilValidate.isEmpty(warningVO) && !UtilValidate.isEmpty(warningVO.getData())) { + WarningBayonetReturnVO wvo = gson.fromJson(gson.toJson(warningVO.getData()), WarningBayonetReturnVO.class); + //因为数据没有 + if (!UtilValidate.isEmpty(wvo.getResult()) && wvo.getResult().size() > 0) { + wvo.getResult().forEach(a -> + { + a.getFaces().forEach(ea -> + { + try { + if (redisUtils.exists(RedisKeys.getCameraSize(a.getCameraId()))) { + BgImageSize bgImageSize = gson.fromJson(redisUtils.get(RedisKeys.getCameraSize(a.getCameraId())).toString(), BgImageSize.class); + PositionVO positionVo = Base64ImageUtils.deelPostion(ea.getFaceRect(), bgImageSize.getBgWidth(), bgImageSize.getBgHeight()); + positionVo.setBgHeight(bgImageSize.getBgWidth()); + positionVo.setBgWidth(bgImageSize.getBgHeight()); + ea.setFaceRect(positionVo); + } else { + BufferedImage bufferedImage = Base64ImageUtils.urlToBufferImage(new URL(a.getFaceBgUrl())); + PositionVO positionVo = Base64ImageUtils.deelPostion(ea.getFaceRect(), bufferedImage.getWidth(), bufferedImage.getHeight()); + positionVo.setBgHeight(bufferedImage.getHeight()); + positionVo.setBgWidth(bufferedImage.getWidth()); + ea.setFaceRect(positionVo); + redisUtils.set(RedisKeys.getCameraSize(a.getCameraId()), gson.toJson(new BgImageSize(a.getCameraId(), bufferedImage.getWidth(), bufferedImage.getHeight()))); + bufferedImage = null; + } + } catch (MalformedURLException e1) { + } + }); + }); + + bayonetReturnVO.setResult(wvo.getResult().get(0)); + bayonetReturnVO.setToDaySnapShot(wvo.getPage().getTotal()); + //累计抓拍 + pageVO.setStartTimestamp(null); + pageVO.setStopTimestamp(null); + //统计总数 + apiAlarmVO.setPage(pageVO); + ApiVO wo = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARM_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + + WarningBayonetReturnVO woVo = gson.fromJson(gson.toJson(wo.getData()), WarningBayonetReturnVO.class); + if (UtilValidate.isEmpty(woVo)) { + bayonetReturnVO.setTotalSnapShot(0L); + } else { + bayonetReturnVO.setTotalSnapShot(woVo.getPage().getTotal()); + } + } else { + bayonetReturnVO.setToDaySnapShot(0L); + bayonetReturnVO.setResult(new AlarmReturnVO()); + } + } + //累计抓拍 + pageVO.setStartTimestamp(null); + pageVO.setStopTimestamp(null); + //统计总数 + apiAlarmVO.setPage(pageVO); + ApiVO wo = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARM_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + WarningBayonetReturnVO wovo = gson.fromJson(gson.toJson(wo.getData()), WarningBayonetReturnVO.class); + if (UtilValidate.isEmpty(wovo)) { + bayonetReturnVO.setTotalSnapShot(0L); + } else { + bayonetReturnVO.setTotalSnapShot(wovo.getPage().getTotal()); + } + return successResult(bayonetReturnVO); + } catch (Exception e) { + e.printStackTrace(); + return failResult("查询异常:" + e.getMessage()); + } + } + + @GetMapping("/todayBayonetBySize/{carmeraId}/{pageSize}")// {total} + @ApiOperation(value = "今日抓拍根據條數返回") + public CommonResult todayBayonet(@PathVariable("carmeraId") String carmeraId, @PathVariable("pageSize") Integer pageSize) { + if (UtilValidate.isEmpty(carmeraId)) { + return failResult(SystemCode.ParaIsNull); + } + + ApiAlarmVO apiAlarmVO = new ApiAlarmVO(); + apiAlarmVO.setCameraId(carmeraId); + PageVO pageVO = new PageVO(); + pageVO.setPageSize(1); + if (UtilValidate.isNotEmpty(pageSize)) { + pageVO.setPageSize(pageSize); + } + pageVO.setStartTimestamp(TimeUtil.toDayStart()); + pageVO.setStopTimestamp(TimeUtil.toDayStop()); + apiAlarmVO.setPage(pageVO); + try { + ApiVO warningVO = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARM_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); +// BayonetReturnVO bayonetReturnVO = new BayonetReturnVO(); + BayoneReturnListVO bayoneReturnListVO = new BayoneReturnListVO(); + if (!UtilValidate.isEmpty(warningVO) && !UtilValidate.isEmpty(warningVO.getData())) { + WarningBayonetReturnVO wvo = gson.fromJson(gson.toJson(warningVO.getData()), WarningBayonetReturnVO.class); + //因为数据没有 + if (!UtilValidate.isEmpty(wvo.getResult()) && wvo.getResult().size() > 0) { + + wvo.getResult().forEach(a -> + { + a.getFaces().forEach(ea -> + { + try { + if (redisUtils.exists(RedisKeys.getCameraSize(a.getCameraId()))) { + BgImageSize bgImageSize = gson.fromJson(redisUtils.get(RedisKeys.getCameraSize(a.getCameraId())).toString(), BgImageSize.class); + PositionVO positionVo = Base64ImageUtils.deelPostion(ea.getFaceRect(), bgImageSize.getBgWidth(), bgImageSize.getBgHeight()); + positionVo.setBgHeight(bgImageSize.getBgWidth()); + positionVo.setBgWidth(bgImageSize.getBgHeight()); + ea.setFaceRect(positionVo); + } else { + BufferedImage bufferedImage = Base64ImageUtils.urlToBufferImage(new URL(a.getFaceBgUrl())); + PositionVO positionVo = Base64ImageUtils.deelPostion(ea.getFaceRect(), bufferedImage.getWidth(), bufferedImage.getHeight()); + positionVo.setBgHeight(bufferedImage.getHeight()); + positionVo.setBgWidth(bufferedImage.getWidth()); + ea.setFaceRect(positionVo); + redisUtils.set(RedisKeys.getCameraSize(a.getCameraId()), gson.toJson(new BgImageSize(a.getCameraId(), bufferedImage.getWidth(), bufferedImage.getHeight()))); + bufferedImage = null; + } + } catch (MalformedURLException e1) { + } + }); + }); + + bayoneReturnListVO.setResult(wvo.getResult()); + bayoneReturnListVO.setToDaySnapShot(wvo.getPage().getTotal()); + //累计抓拍 + pageVO.setStartTimestamp(null); + pageVO.setStopTimestamp(null); + //统计总数 + apiAlarmVO.setPage(pageVO); + ApiVO wo = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARM_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + WarningBayonetReturnVO woVo = gson.fromJson(gson.toJson(wo.getData()), WarningBayonetReturnVO.class); + if (UtilValidate.isEmpty(woVo)) { + bayoneReturnListVO.setTotalSnapShot(0L); + } else { + bayoneReturnListVO.setTotalSnapShot(woVo.getPage().getTotal()); + } + } else { + bayoneReturnListVO.setToDaySnapShot(0L); + bayoneReturnListVO.setResult(new ArrayList<>()); + } + } + //累计抓拍 + pageVO.setStartTimestamp(null); + pageVO.setStopTimestamp(null); + //统计总数 + apiAlarmVO.setPage(pageVO); + ApiVO wo = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARM_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + WarningBayonetReturnVO wovo = gson.fromJson(gson.toJson(wo.getData()), WarningBayonetReturnVO.class); + if (UtilValidate.isEmpty(wovo)) { + bayoneReturnListVO.setTotalSnapShot(0L); + } else { + bayoneReturnListVO.setTotalSnapShot(wovo.getPage().getTotal()); + } + return successResult(bayoneReturnListVO); + } catch (Exception e) { + e.printStackTrace(); + return failResult("查询异常:" + e.getMessage()); + } + } + + + @Autowired + private IControlBayonetMidService iControlBayonetMidService; + + + @ApiOperation(value = "卡口功能-打开卡口页面获取最新布控的一个摄像头id") + @GetMapping("/bayonet") + public CommonResult bayonetIndex() { + //根据es查询当前数据 + ApiAlarmVO apiAlarmVO = new ApiAlarmVO(); + PageVO pageVO = new PageVO(); + pageVO.setPageSize(1); + pageVO.setStartTimestamp(TimeUtil.toDayStart()); + pageVO.setStopTimestamp(TimeUtil.toDayStop()); + apiAlarmVO.setPage(pageVO); + String cameraId = ""; + Map myMap = new HashMap<>(); + try { + ApiVO warningVO = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARM_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + if (!UtilValidate.isEmpty(warningVO) && !UtilValidate.isEmpty(warningVO.getData())) { + WarningBayonetReturnVO wvo = gson.fromJson(gson.toJson(warningVO.getData()), WarningBayonetReturnVO.class); + //因为数据没有 + if (!UtilValidate.isEmpty(wvo.getResult()) && wvo.getResult().size() > 0) { + cameraId = wvo.getResult().get(0).getCameraId(); + } + } + if (UtilValidate.isEmpty(cameraId)) { + ControlBayonetMid controlBayonetMid = iControlBayonetMidService.selectFaceCameraByTime(); + if (UtilValidate.isEmpty(controlBayonetMid)) { + return failResult(SystemCode.NO_DATA.code, SystemCode.NO_DATA.des, null); + } + cameraId = controlBayonetMid.getIdFaceCamera().toString(); + } + FaceCameraInfo faceCameraInfo = faceCameraService.findById(new Long(cameraId)); + myMap.put("camera_region_firstlevel", faceCameraInfo.getCameraRegionFirstlevel()); + myMap.put("cameraId", cameraId); + String name = faceCameraInfo.getCameraName(); + myMap.put("cameraName", (UtilValidate.isEmpty(name)) ? "摄像头" : name + "(摄像头)"); + } catch (Exception e) { + return failResult("查询异常"); + } + return successResult(myMap); + } + + @ApiOperation(value = "卡口功能-查看全部") + @PostMapping("/bayonet") + public CommonResult bayonet(@ApiParam(required = true, name = "apiAlarmVO", value = "{\n" + + " \"cameraId\": \"摄像头id(可以空)\",\n" + + " \"page\": {\n" + + " \"order\": \"排序默认DESC\",\n" + + " \"pageNo\": 0,\n" + + " \"pageSize\": 0,\n" + + " \"startTimestamp\": 抓拍时间开始,\n" + + " \"stopTimestamp\": 抓拍时间结束\n" + + " }\n" + + "}") @RequestBody ApiAlarmVO apiAlarmVO) { + try { +// System.out.println("----------"); + ApiVO warningVO = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARM_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + if (UtilValidate.isEmpty(warningVO) || warningVO.getCode().intValue() == ErrEnum.NOT_FOUND.getCode().intValue()) { + WarningPageVO warningPageVO = new WarningPageVO(); + return successResult(warningPageVO); + } + + if (warningVO.getCode().intValue() != ErrEnum.OK.getCode().intValue()) { + return failResult("服务器返回错误:" + warningVO.getMessage()); + } + WarningBayonetReturnVO wvo = gson.fromJson(gson.toJson(warningVO.getData()), WarningBayonetReturnVO.class); + //因为数据没有 + + if (UtilValidate.isEmpty(wvo) || UtilValidate.isEmpty(wvo.getResult())) { + return successResult(wvo); + } + + try { + wvo.getResult().forEach(a -> + { + //更改为摄像头名称 + FaceCameraInfo faceCameraInfo = faceCameraService.findById(new Long(a.getCameraId())); + String cameraId = a.getCameraId(); + a.setCameraId(cameraId); + a.setCameraName((!UtilValidate.isEmpty(faceCameraInfo) ? faceCameraInfo.getCameraName() : cameraId)); + a.setTimestamp(null); + a.getFaces().forEach(ea -> + { + if (UtilValidate.isEmpty(ea.getFeature())) { + ea.setFeature(new FeatureVO(-1, "")); + } + try { + if (redisUtils.exists(RedisKeys.getCameraSize(a.getCameraId()))) { + BgImageSize bgImageSize = gson.fromJson(redisUtils.get(RedisKeys.getCameraSize(a.getCameraId())).toString(), BgImageSize.class); + PositionVO positionVo = Base64ImageUtils.deelPostion(ea.getFaceRect(), bgImageSize.getBgWidth(), bgImageSize.getBgHeight()); + positionVo.setBgHeight(bgImageSize.getBgWidth()); + positionVo.setBgWidth(bgImageSize.getBgHeight()); + ea.setFaceRect(positionVo); + } else { + BufferedImage bufferedImage = Base64ImageUtils.urlToBufferImage(new URL(a.getFaceBgUrl())); + PositionVO positionVo = Base64ImageUtils.deelPostion(ea.getFaceRect(), bufferedImage.getWidth(), bufferedImage.getHeight()); + positionVo.setBgHeight(bufferedImage.getHeight()); + positionVo.setBgWidth(bufferedImage.getWidth()); + ea.setFaceRect(positionVo); + redisUtils.set(RedisKeys.getCameraSize(a.getCameraId()), gson.toJson(new BgImageSize(a.getCameraId(), bufferedImage.getWidth(), bufferedImage.getHeight()))); + bufferedImage = null; + } + } catch (MalformedURLException e1) { + } + }); + }); + + } catch (Exception ee) { + log.error("卡口功能-查看全部:{}", ee.getMessage()); + } + return successResult(wvo); + } catch (Exception e) { + return failResult("查询异常:" + e.getMessage()); + } + } + + @Autowired + private IControlTaskService iControlTaskService; + + @Autowired + private IPortraitService iPortraitService; + + + @Autowired + private IFaceLibraryService iFaceLibraryService; + + + @Autowired + private RedisUtils redisUtils; + + @ApiOperation(value = "查看-预警信息") + @PostMapping("/alarm") + public CommonResult alarm(@ApiParam(required = true, name = "apiAlarmVO", value = "{\n" + + " \"page\": {\n" + + " \"order\": \"排序 默认DESC(默认可以不填)\",\n" + + " \"pageNo\": 0(默认1可以不填),\n" + + " \"pageSize\": 0(默认10可以不填),\n" + + " \"startTimestamp\": 0(默认可以不填查询所有),\n" + + " \"stopTimestamp\": 0(默认可以不填查询所有)\n" + + " },\n" + + " \"taskIds\": [任务id列表],\n" + + " \"cameraIds\": [摄像头列表],\n" + + " taskType:[任务类别:0 报警任务,1是视频任务不传默认为0]" + + "}") @RequestBody ApiAlarmVO apiAlarmVO) { + try { +// Long time=System.currentTimeMillis(); + List ararmList = new ArrayList<>(); + ApiVO warningVO = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARMS_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + if (UtilValidate.isEmpty(warningVO) || warningVO.getCode().intValue() == ErrEnum.NOT_FOUND.getCode().intValue()) { + Page pages = new Page<>(); + pages.setRecords(ararmList); + pages.setTotal(0); + return successResult(pages); + } + if (warningVO.getCode().intValue() != ErrEnum.OK.getCode().intValue()) { + return failResult("服务器返回错误:" + warningVO.getMessage()); + } + + WarningBayonetReturnVO wvo = gson.fromJson(gson.toJson(warningVO.getData()), WarningBayonetReturnVO.class); + if (UtilValidate.isEmpty(wvo)) { + return failResult("没有查询到数据"); + } + wvo.getResult().forEach(a -> + { +// a.getFaces() 存储时候进行拆分 + if (!UtilValidate.isEmpty(a.getFaces()) && a.getFaces().size() > 0) { + ApiFaceVO apiFaceVO = a.getFaces().get(0); + try { + if (redisUtils.exists(RedisKeys.getCameraSize(a.getCameraId()))) { + BgImageSize bgImageSize = gson.fromJson(redisUtils.get(RedisKeys.getCameraSize(a.getCameraId())).toString(), BgImageSize.class); + PositionVO positionVo = Base64ImageUtils.deelPostion(apiFaceVO.getFaceRect(), bgImageSize.getBgWidth(), bgImageSize.getBgHeight()); + positionVo.setBgHeight(bgImageSize.getBgHeight()); + positionVo.setBgWidth(bgImageSize.getBgWidth()); + apiFaceVO.setFaceRect(positionVo); + } else { + BufferedImage bufferedImage = Base64ImageUtils.urlToBufferImage(new URL(a.getFaceBgUrl())); + PositionVO positionVo = Base64ImageUtils.deelPostion(apiFaceVO.getFaceRect(), bufferedImage.getWidth(), bufferedImage.getHeight()); + positionVo.setBgHeight(bufferedImage.getHeight()); + positionVo.setBgWidth(bufferedImage.getWidth()); + apiFaceVO.setFaceRect(positionVo); + redisUtils.set(RedisKeys.getCameraSize(a.getCameraId()), gson.toJson(new BgImageSize(a.getCameraId(), bufferedImage.getWidth(), bufferedImage.getHeight()))); + bufferedImage = null; + } + } catch (MalformedURLException e1) { + } + + + WarningPageVO warningPageVO = new WarningPageVO(); + //根据任务区查询3 + //测试后期需要删除 TODO +// a.setTaskId("1204968766411169794"); + QueryWrapper queryWrapper = new QueryWrapper<>(); + ControlTask controlTask = new ControlTask(); + controlTask.setTaskNo(a.getTaskId()); + queryWrapper.setEntity(controlTask); + List controlTaskList = iControlTaskService.getBaseMapper().selectList(queryWrapper); + warningPageVO.setTaskId(a.getTaskId()); + if (!UtilValidate.isEmpty(controlTaskList) && controlTaskList.size() >= 1) { + controlTask = controlTaskList.get(0); + warningPageVO.setTaskName(controlTask.getTaskName()); +// warningPageVO.setTaskType(ContralEnums.getTypeByValue(Integer.parseInt(controlTask.getDisposalType())).getMessage()); + warningPageVO.setTaskType(controlTask.getDisposalType()); + } else { + warningPageVO.setTaskName("任务已删除"); + warningPageVO.setTaskType(""); + } + //基本展示信息4-4 + warningPageVO.setBgImg(a.getFaceBgUrl()); + + if (!UtilValidate.isEmpty(apiFaceVO.getCompare()) && apiFaceVO.getCompare().size() > 0) { + ComparisonVO comparisonVO = apiFaceVO.getCompare().get(0); + //库名称和库id0-2 + FaceLibrary faceLibrary = iFaceLibraryService.getBaseMapper().selectById(comparisonVO.getLibraryId()); + warningPageVO.setLibId(comparisonVO.getLibraryId()); + if (!UtilValidate.isEmpty(faceLibrary)) { + warningPageVO.setLibName(faceLibrary.getFactoryName()); + } else { + warningPageVO.setLibName(comparisonVO.getLibraryId()); + } + warningPageVO.setScore(comparisonVO.getHitSimilarity()); + //查询人员信息 5-5 +// comparisonVO.setComparisonFaceId("1204598824872067073"); + Portrait portrait = iPortraitService.getById(comparisonVO.getComparisonFaceId()); + if (!UtilValidate.isEmpty(portrait)) { + if (UtilValidate.isNotEmpty(portrait.getName())) { + warningPageVO.setName(portrait.getName()); + } + if (UtilValidate.isNotEmpty(portrait.getBirthDate())) { + warningPageVO.setAge(DateUtils.getAge(portrait.getBirthDate())); + } + if (UtilValidate.isNotEmpty(portrait.getUrl())) { + warningPageVO.setFaceUrl(portrait.getUrl()); + } + if (UtilValidate.isNotEmpty(portrait.getSex())) { + warningPageVO.setSex(SEXEnums.getTypeByValue(portrait.getSex().toString()).name); + } + if (UtilValidate.isNotEmpty(portrait.getIdCard())) { + warningPageVO.setIdCard(portrait.getIdCard()); + } + } + } else { + warningPageVO.setScore(0.0); + } + warningPageVO.setPositionVO(apiFaceVO.getFaceRect()); + warningPageVO.setTime(a.getDate()); + //查询摄像头信息2-2 + if (!a.getCameraId().toString().equals("0")) { + FaceCameraInfo faceCameraInfo = faceCameraService.findById(new Long(a.getCameraId())); + String cameraId = a.getCameraId(); + warningPageVO.setCameraId(cameraId); + warningPageVO.setCameraRegion((!UtilValidate.isEmpty(faceCameraInfo) ? faceCameraInfo.getCameraName() : cameraId)); + } + ararmList.add(warningPageVO); + } + }); + Page pages = new Page<>(); + pages.setRecords(ararmList); + pages.setTotal(wvo.getPage().getTotal()); + wvo = null; + warningVO = null; +// System.out.println("耗时:"+(System.currentTimeMillis()-time)); + return successResult(pages); + } catch (Exception e) { + e.printStackTrace(); + return failResult("查询异常:" + e.getMessage()); + } + } + + + @ApiOperation(value = "获取全部布控任务中的摄像头信息和最近一条预警信息") + @GetMapping(value = "/getCameraWarningByTask") + public CommonResult findCameraByTask() { + List all = faceCameraService.findCameraByTask(); + if (UtilValidate.isEmpty(all)) { + return successResult(new ArrayList<>()); + } +// CameraWarningVO + List myList = new ArrayList<>(); + all.forEach(e -> + { + CameraWarningVO cameraWarningVO = new CameraWarningVO(); + CameraVO cameraVO = new CameraVO(); + BeanUtils.copyProperties(e, cameraVO); + cameraWarningVO.setCamera(cameraVO); + cameraWarningVO.setWarning(getWarningByCameraId(e)); + myList.add(cameraWarningVO); + }); + return successResult(myList); + } + + /** + * 根據攝像頭获取最新的摄像头id + * + * @param + * @return + */ + private WarningPageVO getWarningByCameraId(FaceCameraEntity faceCameraEntity) { + ApiAlarmVO apiAlarmVO = new ApiAlarmVO(); + PageVO page = new PageVO(); + page.setPageSize(1); + apiAlarmVO.setPage(page); + apiAlarmVO.setCameraIds(Arrays.asList(faceCameraEntity.getIdFaceCamera().toString())); + ApiVO warningVO = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARMS_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); + if (UtilValidate.isEmpty(warningVO) || warningVO.getCode().intValue() == ErrEnum.NOT_FOUND.getCode().intValue()) { + return new WarningPageVO(); + } + if (warningVO.getCode().intValue() != ErrEnum.OK.getCode().intValue()) { + return new WarningPageVO(); + } + WarningBayonetReturnVO wvo = gson.fromJson(gson.toJson(warningVO.getData()), WarningBayonetReturnVO.class); + if (UtilValidate.isEmpty(wvo)) { + return new WarningPageVO(); + } + List ararmList = new ArrayList<>(); + wvo.getResult().forEach(a -> + { + if (!UtilValidate.isEmpty(a.getFaces()) && a.getFaces().size() > 0) { + ApiFaceVO apiFaceVO = a.getFaces().get(0); + try { + if (redisUtils.exists(RedisKeys.getCameraSize(a.getCameraId()))) { + BgImageSize bgImageSize = gson.fromJson(redisUtils.get(RedisKeys.getCameraSize(a.getCameraId())).toString(), BgImageSize.class); + PositionVO positionVo = Base64ImageUtils.deelPostion(apiFaceVO.getFaceRect(), bgImageSize.getBgWidth(), bgImageSize.getBgHeight()); + positionVo.setBgHeight(bgImageSize.getBgWidth()); + positionVo.setBgWidth(bgImageSize.getBgHeight()); + apiFaceVO.setFaceRect(positionVo); + } else { + + Integer width = 1080; + Integer height = 607; + Boolean mark = true; + try { + BufferedImage bufferedImage = Base64ImageUtils.urlToBufferImage(new URL(a.getFaceBgUrl())); + if (UtilValidate.isNotEmpty(bufferedImage)) { + width = bufferedImage.getWidth(); + height = bufferedImage.getHeight(); + } + } catch (Exception e2) { + mark = false; + } + // "{\"cameraId\":\"1211828378753777666\",\"bgWidth\":1080,\"bgHeight\":607}" + PositionVO positionVo = Base64ImageUtils.deelPostion(apiFaceVO.getFaceRect(), width, height); + positionVo.setBgHeight(height); + positionVo.setBgWidth(width); + apiFaceVO.setFaceRect(positionVo); + if (mark) { + redisUtils.set(RedisKeys.getCameraSize(a.getCameraId()), gson.toJson(new BgImageSize(a.getCameraId(), width, height))); + } + } + } catch (Exception e1) { + } + WarningPageVO warningPageVO = new WarningPageVO(); + //根据任务区查询3 + //测试后期需要删除 TODO + QueryWrapper queryWrapper = new QueryWrapper<>(); + ControlTask controlTask = new ControlTask(); + controlTask.setTaskNo(a.getTaskId()); + queryWrapper.setEntity(controlTask); + List controlTaskList = iControlTaskService.getBaseMapper().selectList(queryWrapper); + warningPageVO.setTaskId(a.getTaskId()); + if (!UtilValidate.isEmpty(controlTaskList) && controlTaskList.size() >= 1) { + controlTask = controlTaskList.get(0); + warningPageVO.setTaskName(controlTask.getTaskName()); + warningPageVO.setTaskType(controlTask.getDisposalType()); + } else { + warningPageVO.setTaskName("任务已删除"); + warningPageVO.setTaskType(""); + } + //基本展示信息4-4 + warningPageVO.setBgImg(a.getFaceBgUrl()); + + if (!UtilValidate.isEmpty(apiFaceVO.getCompare()) && apiFaceVO.getCompare().size() > 0) { + ComparisonVO comparisonVO = apiFaceVO.getCompare().get(0); + //库名称和库id0-2 + FaceLibrary faceLibrary = iFaceLibraryService.getBaseMapper().selectById(comparisonVO.getLibraryId()); + warningPageVO.setLibId(comparisonVO.getLibraryId()); + if (!UtilValidate.isEmpty(faceLibrary)) { + warningPageVO.setLibName(faceLibrary.getFactoryName()); + } else { + warningPageVO.setLibName(comparisonVO.getLibraryId()); + } + warningPageVO.setScore(comparisonVO.getHitSimilarity()); + //查询人员信息 5-5 + Portrait portrait = iPortraitService.getById(comparisonVO.getComparisonFaceId()); + if (!UtilValidate.isEmpty(portrait)) { + if (UtilValidate.isNotEmpty(portrait.getName())) { + warningPageVO.setName(portrait.getName()); + } + if (UtilValidate.isNotEmpty(portrait.getBirthDate())) { + warningPageVO.setAge(DateUtils.getAge(portrait.getBirthDate())); + } + if (UtilValidate.isNotEmpty(portrait.getUrl())) { + warningPageVO.setFaceUrl(portrait.getUrl()); + } + if (UtilValidate.isNotEmpty(portrait.getSex())) { + warningPageVO.setSex(SEXEnums.getTypeByValue(portrait.getSex().toString()).name); + } + if (UtilValidate.isNotEmpty(portrait.getIdCard())) { + warningPageVO.setIdCard(portrait.getIdCard()); + } + } + } else { + warningPageVO.setScore(0.0); + } + warningPageVO.setPositionVO(apiFaceVO.getFaceRect()); + warningPageVO.setTime(a.getDate()); + //查询摄像头信息2-2 + if (!a.getCameraId().toString().equals("0")) { + warningPageVO.setCameraId(faceCameraEntity.getIdFaceCamera().toString()); + warningPageVO.setCameraRegion(faceCameraEntity.getCameraName()); + } + ararmList.add(warningPageVO); + } + }); + if (ararmList.size() > 0) { + return ararmList.get(0); + } + return new WarningPageVO(); + } + + + @GetMapping("/taskStatus/{taskId}") + @ApiParam(required = true, name = "taskStatus", value = "") + @ApiOperation(value = "查看任务状态") + public CommonResult CommonResult(@PathVariable("taskId") String taskId) { + if (UtilValidate.isEmpty(taskId)) { + return failResult(SystemCode.ParaIsNull); + } + +// //开发完成够对接 TODO +// ControlTask controlTask = iControlTaskService.getById(taskId); +// if(UtilValidate.isEmpty(controlTask)) +// { +// return failResult("没有找到对应的任务"); +// } + + ApiVO warningVO = (ApiVO) httpUtil.get(link + ApiUrlEnum.ALARMS_STATUS.getUrl() + "/" + taskId, ApiVO.class); + if (UtilValidate.isEmpty(warningVO) || warningVO.getCode() != ErrEnum.OK.getCode().intValue() || UtilValidate.isEmpty(warningVO.getData())) { + return failResult("查询任务状态出错"); + } + Map myMap = gson.fromJson(gson.toJson(warningVO.getData()), Map.class); +// Map myMap=new HashMap(); +// myMap.put("status","STATUS_OVER"); + return successResult(myMap); + } + + @GetMapping("/taskInfo/{carmeraId}") + @ApiParam(required = true, name = "taskName", value = "") + @ApiOperation(value = "根据摄像头id查看任务信息") + public CommonResult taskInfo(@PathVariable("carmeraId") String carmeraId) { + if (UtilValidate.isEmpty(carmeraId)) { + return failResult(SystemCode.ParaIsNull); + } + ControlTask controlTask = iControlTaskService.getTaskInfoByCameraID(carmeraId); + if (UtilValidate.isEmpty(controlTask)) { + return failResult(SystemCode.NO_DATA); + } + return successResult(controlTask); + } + + +} diff --git a/face-server/src/main/java/com/dkha/server/mappers/ControlBayonetMidMapper.java b/face-server/src/main/java/com/dkha/server/mappers/ControlBayonetMidMapper.java new file mode 100644 index 0000000..a107162 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/mappers/ControlBayonetMidMapper.java @@ -0,0 +1,39 @@ +package com.dkha.server.mappers; + +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.server.modules.entities.ControlBayonetMid; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dkha.server.modules.entities.FaceCameraEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *

+ * 布控和摄像头中间表 Mapper 接口 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Mapper +public interface ControlBayonetMidMapper extends BaseMapper { + /** + * 根据任务ID删除任务和摄像头的中间表 + * + * @Return Integer >0成功 + */ + Integer deletetaskandcarmerbytaskid(@Param("taskID") String taskID); + + Integer selectexistByCarmeID(@Param("idcamera") String idcamera); + + Integer updateCarmerValidaStateByTaskID(@Param("taskID") String taskID, @Param("State") String State, @Param("UpdateBy") String UpdateBy); + + List selectFaceCameraBytaskID(@Param("taskID") String taskID); + + List selectFaceCameraBytask(); + + List selectFaceCameraBytaskInfo(); + int getControlByRegion(@Param("regionId") long regionId); +} diff --git a/face-server/src/main/java/com/dkha/server/mappers/ControlLibraryMidMapper.java b/face-server/src/main/java/com/dkha/server/mappers/ControlLibraryMidMapper.java new file mode 100644 index 0000000..2fea96d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/mappers/ControlLibraryMidMapper.java @@ -0,0 +1,25 @@ +package com.dkha.server.mappers; + +import com.dkha.server.modules.entities.ControlLibraryMid; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 布控和库中间表 Mapper 接口 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Mapper +public interface ControlLibraryMidMapper extends BaseMapper { + + /**查看特征库id是否存在或有效*/ + Integer selectexistByLibID(@Param("libid") String libID,@Param("isvalid") String isvalid); + /**根据任务ID删除任务对应的中间特征库*/ + Integer deletetaskLibraryMidbytaskid(@Param("taskID") String taskID); + + Integer selectByLibID(@Param("libid") String libID,@Param("isvalid") String isvalid); +} diff --git a/face-server/src/main/java/com/dkha/server/mappers/ControlTaskMapper.java b/face-server/src/main/java/com/dkha/server/mappers/ControlTaskMapper.java new file mode 100644 index 0000000..cfc094d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/mappers/ControlTaskMapper.java @@ -0,0 +1,46 @@ +package com.dkha.server.mappers; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.server.modules.entities.ControlTask; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dkha.server.modules.entities.FaceCameraEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @version V1.0 + * @Description: 布控任务Mapper 接口 + * @Title: + * @author: huangyugang + * @date: 2019-12-09 10:25 + * @Copyright: 成都电科慧安 + */ +@Mapper +public interface ControlTaskMapper extends BaseMapper { + + List getTaskList(@Param("page") Page page, + @Param("searchParam") Map searchParam); + + List getviedoTaskList(@Param("page") Page page, + @Param("searchParam") Map searchParam); + + List getCameraByTaskID(@Param("taskid") String taskid); + + List getCameraByTaskNo(@Param("taskno") String taskno); + /** + * 根据摄像头的区域ID转换为区域名称 + */ + List getCameraRegionByReginlist(@Param("regionIds") List regionIds); + /** + * 根据任务ID转换库名称 + */ + List getLibRegionBytaskid(@Param("taskid") String taskid); + + + /**根据摄像头id获取任务信息*/ + List getTaskInfoByCameraID(@Param("taskno") String taskno); +} + diff --git a/face-server/src/main/java/com/dkha/server/mappers/FaceCameraDao.java b/face-server/src/main/java/com/dkha/server/mappers/FaceCameraDao.java new file mode 100644 index 0000000..f579c32 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/mappers/FaceCameraDao.java @@ -0,0 +1,48 @@ +package com.dkha.server.mappers; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.server.modules.entities.FaceCameraEntity; +import com.dkha.server.modules.entities.faceCamera.FaceCameraInfo; +import com.dkha.server.modules.entities.faceCamera.FaceCameraList; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 摄像头表 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2019-12-08 + */ +@Mapper +public interface FaceCameraDao extends BaseMapper { + + + List getList(@Param("page") Page page, + @Param("searchParam") Map searchParam, + @Param("cameraRegion") List cameraRegion); + + List> findByRegion(@Param("regionId") String regionId); + + List> getAllCameraByRegionId(@Param("regionIds") List regionIds); + + List> getCameraByRegionId(@Param("regionId") long regionId); + + List> getRegionUnControlCamera(@Param("regionId") long regionId); + + /** + * 判断当前区域及其子区域是否存在布控摄像头 + * @param regionId + * @return + */ + int isCameraInRegion(@Param("regionId") String regionId); + + CameraInfoVO selectFaceCameraID(@Param("idFaceCamera") String idFaceCamera); + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/mappers/FaceCameraMapper.java b/face-server/src/main/java/com/dkha/server/mappers/FaceCameraMapper.java new file mode 100644 index 0000000..981b806 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/mappers/FaceCameraMapper.java @@ -0,0 +1,18 @@ +package com.dkha.server.mappers; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dkha.server.modules.entities.FaceCameraEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 摄像头表 Mapper 接口 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Mapper +public interface FaceCameraMapper extends BaseMapper { + +} diff --git a/face-server/src/main/java/com/dkha/server/mappers/FaceLibraryMapper.java b/face-server/src/main/java/com/dkha/server/mappers/FaceLibraryMapper.java new file mode 100644 index 0000000..945c4cc --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/mappers/FaceLibraryMapper.java @@ -0,0 +1,35 @@ +package com.dkha.server.mappers; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.server.modules.entities.FaceLibrary; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *

+ * 库表 Mapper 接口 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Mapper +public interface FaceLibraryMapper extends BaseMapper { + /** + * Library 分页查询个 + * @param page + * @param factoryName 库名称 + * @return + */ + List getLibraryPage(@Param("page") Page page, @Param("factoryName") String factoryName); + + /** + * 统计库对应的人脸数 + * @param idFactory + * @return + */ + Integer getLibraryCount(@Param("idFactory") Long idFactory); +} diff --git a/face-server/src/main/java/com/dkha/server/mappers/FaceTrackMapper.java b/face-server/src/main/java/com/dkha/server/mappers/FaceTrackMapper.java new file mode 100644 index 0000000..e4c0637 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/mappers/FaceTrackMapper.java @@ -0,0 +1,64 @@ +package com.dkha.server.mappers; + + + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dkha.common.modules.vo.face.FaceTrackVO; +import com.dkha.server.modules.entities.FaceTrackEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +@Mapper +public interface FaceTrackMapper extends BaseMapper { + /** + * 根据摄像头和分组时间查询 + * @param idFaceCamera + * @param packetTime + * @return + */ + List querByidCameraAndTime(@Param("idFaceCamera") Long idFaceCamera, @Param("packetTime") String packetTime); + /** + * 根据摄像头Id和开始,结束时间,人脸ID + * @param faceTrackVO + * @return + */ + List queryByidCamerAndFaceId(@Param("faceTrackVO") FaceTrackVO faceTrackVO); + + /** + * 根據開始時間和結束時間查詢庫id + * @param faceTrackVO + * @return + */ + List findIdFatoryByTime(@Param("faceTrackVO") FaceTrackVO faceTrackVO); + + /** + * 根据图片路径和开始,结束时间 + * @param faceTrackVO + * @return + */ + List queryByurlAndTime(@Param("faceTrackVO") FaceTrackVO faceTrackVO); + /** + * 根据图片路径和开始,结束时间和阈值 + * @param faceTrackVO + * @return + */ + List queryBytrajectoryThreshold(@Param("faceTrackVO")FaceTrackVO faceTrackVO); + + /** + * 根据人脸ID查询 + * @param idPortrait + * @return + */ + FaceTrackEntity queryByIdPortrait(@Param("idPortrait")String idPortrait); + + List findTrackByFaceId(@Param("faceIds") List faceIds); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/mappers/PortraitMapper.java b/face-server/src/main/java/com/dkha/server/mappers/PortraitMapper.java new file mode 100644 index 0000000..3821b2d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/mappers/PortraitMapper.java @@ -0,0 +1,79 @@ +package com.dkha.server.mappers; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.modules.vo.search.SearchPortraitVo; +import com.dkha.server.modules.entities.Portrait; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + *

+ * 人像表 Mapper 接口 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Mapper +public interface PortraitMapper extends BaseMapper { + /** + * 分页查询人像表信息 + * @param page + * @param searchParams + * @return + */ + List queryPage(@Param("page") Page page, @Param("searchParams") Map searchParams); + + /** + * 人脸检索分页获取总的记录数量 + * @param searchParams 检索参数 + * @param faceIdList 人脸Id集合--如果上传图片进行搜索,则该值不能为空 + * @param libraryIdList 库Id集合 + * @return + */ + Integer findSearchPageCount(@Param("searchParams") Map searchParams, @Param("faceIdList") List faceIdList, @Param("libraryIdList") List libraryIdList); + + /** + * 人脸检索获取某一页对应的详细数据 + * @param searchParams 检索参数 + * @param faceIdList 人脸Id集合--如果上传图片进行搜索,则该值不能为空 + * @param libraryIdList 库Id集合 + * @return + */ + List findSearchPageList(@Param("searchParams") Map searchParams, @Param("faceIdList") List faceIdList, @Param("libraryIdList") List libraryIdList); + + /** + * 人脸检索分页--非api调用 + * @param page + * @param searchParams 检索参数 + * @param faceIdList 人脸Id集合--如果上传图片进行搜索,则该值不能为空 + * @param libraryIdList 库Id集合 + * @return + */ + List findSearchPage(@Param("page") Page page, @Param("searchParams") Map searchParams, @Param("faceIdList") List faceIdList, @Param("libraryIdList") List libraryIdList); + + /** + * 根据id查询 + * @param idPortrait + * @return + */ + Portrait queryPortrait(@Param("idPortrait") Long idPortrait); + + /** + * 根据库id查询 + * @param idFactory + * @return + */ + List queryPortraitByFactory(@Param("idFactory") Long idFactory); + + /** + * 根据id删除 + * @param taskID + * @return + */ + Integer deletePortrait(@Param("taskID") Long taskID) ; +} diff --git a/face-server/src/main/java/com/dkha/server/mappers/WarningInformationMapper.java b/face-server/src/main/java/com/dkha/server/mappers/WarningInformationMapper.java new file mode 100644 index 0000000..0635602 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/mappers/WarningInformationMapper.java @@ -0,0 +1,18 @@ +package com.dkha.server.mappers; + +import com.dkha.server.modules.entities.WarningInformation; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 预警信息 Mapper 接口 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Mapper +public interface WarningInformationMapper extends BaseMapper { + +} diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/ControlBayonetMid.java b/face-server/src/main/java/com/dkha/server/modules/entities/ControlBayonetMid.java new file mode 100644 index 0000000..c1bb81d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/ControlBayonetMid.java @@ -0,0 +1,62 @@ +package com.dkha.server.modules.entities; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 布控和摄像头中间表 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="ControlBayonetMid对象", description="布控和摄像头中间表") +public class ControlBayonetMid implements Serializable { + + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "id") + @TableId(value = "id", type = IdType.ID_WORKER) + private Long id; + + @ApiModelProperty(value = "id布控id") + private Long idControlTask; + + @ApiModelProperty(value = "摄像头id") + private Long idFaceCamera; + + @ApiModelProperty(value = "是否有效 Y有效 N无效") + @TableField(fill = FieldFill.INSERT) + private String isValid; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date createTime; + + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createBy; + + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + +} diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/ControlLibraryMid.java b/face-server/src/main/java/com/dkha/server/modules/entities/ControlLibraryMid.java new file mode 100644 index 0000000..5efec47 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/ControlLibraryMid.java @@ -0,0 +1,61 @@ +package com.dkha.server.modules.entities; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 布控和库中间表 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="ControlLibraryMid对象", description="布控和库中间表") +public class ControlLibraryMid implements Serializable { + + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "id") + @TableId(value = "id", type = IdType.ID_WORKER) + private Long id; + + @ApiModelProperty(value = "布控id") + private Long idControlTask; + + @ApiModelProperty(value = "库id") + private Long idFactory; + + @ApiModelProperty(value = "是否有效 Y有效 N无效") + private String isValid; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createBy; + + +} diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/ControlTask.java b/face-server/src/main/java/com/dkha/server/modules/entities/ControlTask.java new file mode 100644 index 0000000..72f80ff --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/ControlTask.java @@ -0,0 +1,121 @@ +package com.dkha.server.modules.entities; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import java.util.List; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +/** + *

+ * 布控任务 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) + +@ApiModel(value="ControlTask对象", description="布控任务") +public class ControlTask implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @TableId(value = "id_control_task", type = IdType.ID_WORKER) + private Long idControlTask; + + @ApiModelProperty(value = "任务名称") + + private String taskName; + + @ApiModelProperty(value = "任务编号") + @TableId(value = "task_no") + private String taskNo; + + @ApiModelProperty(value = "布控对象(id 人像库id 或者上传图片id)") + private String controlObject; + + @ApiModelProperty(value = "处置类型-码值 视频对比 -1 抓捕类1,监控类2,提示类0 默认选择0") + private String disposalType; + + @ApiModelProperty(value = "布控类型-码值 长期布控 0,临时布控 1 默认选择0 ") + private String controlType; + + @ApiModelProperty(value = "布控开始时间") + private Date controlStartTime; + + @ApiModelProperty(value = "布控结束时间") + private Date controlEndTime; + + @ApiModelProperty(value = "布控区域") + private String controlRegion; + + @ApiModelProperty(value = "布控阈值") + private Double controlThreshold; + + @ApiModelProperty(value = "布控状态-码值") + private String controlStatus; + + @ApiModelProperty(value = "接收人员(人员id逗号隔开)") + private String receive; + + @ApiModelProperty(value = "备注信息") + private String remarks; + + @ApiModelProperty(value = "是否有效 Y有效 N无效") + private String isValid; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createBy; + + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + @ApiModelProperty(value = "库列表id") + @TableField(exist=false) + private List libIds; + + @ApiModelProperty(value = "视频布控URL") + private String viedourl; + + @ApiModelProperty(value = "任务库的列表") + @TableField(exist=false) + private String tasklibstr; + + @ApiModelProperty(value = "布控的摄像头ID列表") + @TableField(exist=false) + private List listfacecamera; + + @ApiModelProperty(value = "上传图片布控的url") + private String imgurl; + + @ApiModelProperty(value = "视频布控状态") + @TableField(exist=false) + private String taskstatus; + +} + diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/FaceCameraEntity.java b/face-server/src/main/java/com/dkha/server/modules/entities/FaceCameraEntity.java new file mode 100644 index 0000000..866c83c --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/FaceCameraEntity.java @@ -0,0 +1,171 @@ +package com.dkha.server.modules.entities; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.CommonEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 摄像头表 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2019-12-08 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("face_camera") +public class FaceCameraEntity extends CommonEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + * 分布式全局唯一ID 长整型类型 + */ + @TableId(type = IdType.ID_WORKER, value = "id_face_camera") + @ApiModelProperty(value = "摄像头id") + private Long idFaceCamera; + /** + * 摄像头名称 + */ + @ApiModelProperty(value = "摄像头名称") + private String cameraName; + /** + * 摄像头层级区域-码值 + */ + @ApiModelProperty(value = "摄像头层级区域-码值") + private String cameraRegionFirstlevel; + @ApiModelProperty(value = "摄像头区域-码值") + private String cameraRegion; + + @ApiModelProperty(value = "摄像头层级区域冗余字段") + private String cameraRegionFirstlevelBackUp; + + /** + * 摄像头详细地址 + */ + @ApiModelProperty(value = "摄像头详细地址") + + private String cameraAddress; + /** + * 摄像头经度 + */ + @ApiModelProperty(value = "摄像头经度") + public static final String CAMERA_LONGITUDE="camera_longitude"; + private String cameraLongitude; + /** + * 摄像头纬度 + */ + @ApiModelProperty(value = "摄像头纬度") + public static final String CAMERA_LATITUDE="camera_latitude"; + private String cameraLatitude; + + /** + * 型号名称 + */ + @ApiModelProperty(value = "型号") + private String version; + + /** + * 位置类型-码值 + */ + @ApiModelProperty(value = "位置类型-码值") + private String cameratLocationtypeId; + + @ApiModelProperty(value = "位置类型冗余字段") + + private String cameratLocationtypeIdBackUp; + /** + * 公安机关代码 + */ + @ApiModelProperty(value = "公安机关代码") + + private String publicSecurityCode; + /** + * 公安机关名称 + */ + @ApiModelProperty(value = "公安机关名称") + + private String publicSecurityName; + /** + * 建设单位 + */ + @ApiModelProperty(value = "建设单位") + + private String constructionUnit; + /** + * 管理单位 + */ + @ApiModelProperty(value = "管理单位") + + private String managementUnit; + /** + * 管理人员 + */ + @ApiModelProperty(value = "管理人员") + + private String managementPersonnel; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + + private String contactNumber; + /** + * IP + */ + @ApiModelProperty(value = "IP") + private String ip; + + /** + * 端口 + */ + @ApiModelProperty(value = "端口") + private String port; + + /** + * 用户名 + */ + @ApiModelProperty(value = "用户名") + + private String userName; + /** + * 密码 + */ + @ApiModelProperty(value = "密码") + + private String passwd; + /** + * 品牌 + */ + @ApiModelProperty(value = "品牌") + + private String brand; + + /** + * 品牌 + */ + @ApiModelProperty(value = "品牌id") + private String idBrand; + + /** + * rtsp地址 + */ + @ApiModelProperty(value = "rtsp地址") + + private String rtspUrl; + /** + * 备注信息 + */ + @ApiModelProperty(value = "备注信息") + + private String remarks; + /** + * 是否运行 Y启动 N未启动 + */ + @ApiModelProperty(value = "是否运行,Y启动 N未启动") + private String status; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/FaceLibrary.java b/face-server/src/main/java/com/dkha/server/modules/entities/FaceLibrary.java new file mode 100644 index 0000000..bc53b66 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/FaceLibrary.java @@ -0,0 +1,69 @@ +package com.dkha.server.modules.entities; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + + +/** + *

+ * 库表 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="FaceLibrary对象", description="库表") +public class FaceLibrary implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @TableId(value = "id_factory") + private Long idFactory; + + @ApiModelProperty(value = "库名称") + private String factoryName; + + @ApiModelProperty(value = "库类型-码值") + private String factoryType; + + @ApiModelProperty(value = "备注信息") + protected String remarks; + + @TableField(exist = false) + @ApiModelProperty(value = "图片数量") + private String number; + + @TableField(exist = false) + @ApiModelProperty(value = "类型名称") + private String factoryTypeName; + + @ApiModelProperty(value = "是否有效 Y有效 N无效") + + private String isValid; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + +} diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/FaceTrackEntity.java b/face-server/src/main/java/com/dkha/server/modules/entities/FaceTrackEntity.java new file mode 100644 index 0000000..035e746 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/FaceTrackEntity.java @@ -0,0 +1,84 @@ +package com.dkha.server.modules.entities; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="FaceTrackEntity对象", description="轨迹对象") +@TableName(value = "face_track") +public class FaceTrackEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 轨迹id + */ + @ApiModelProperty(value = "id_face_track") + @TableId(value = "id_face_track", type = IdType.ID_WORKER) + private Long idFaceTrack; + /** + * 人像id + */ + private Long idPortrait; + /** + * 摄像头id + */ + private Long idFaceCamera; + /** + * 库id + */ + private Long idFactory; + /** + * 人物数据 + */ + private String characterData; + /** + * 关联数据 + */ + private String linkedData; + /** + * 分组时间 + */ + private String packetTime; + /** + * 当月数据关联 + */ + private String monthData; + /** + * 轨迹判定阈值 + */ + private Double trajectoryThreshold; + /** + * 创建人 + */ + private String createBy; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新人 + */ + private String updateBy; + /** + * 更新时间 + */ + private Date updateTime; +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/Portrait.java b/face-server/src/main/java/com/dkha/server/modules/entities/Portrait.java new file mode 100644 index 0000000..b9324da --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/Portrait.java @@ -0,0 +1,88 @@ +package com.dkha.server.modules.entities; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 人像表 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="Portrait对象", description="人像表") +public class Portrait implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "人像id") + @TableId(value = "id_portrait") + private Long idPortrait; + + @ApiModelProperty(value = "库id") + private Long idFactory; + + @ApiModelProperty(value = "图片url") + private String url; + + @ApiModelProperty(value = "背景图url") + private String backgroundUrl; + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "性别") + private String sex; + + @ApiModelProperty(value = "出生日期") + + private java.sql.Date birthDate; + + @TableField(exist = false) + @ApiModelProperty(value = "年龄") + private Integer age; + + @ApiModelProperty(value = "身份证") + private String idCard; + + @ApiModelProperty(value = "人脸坐标位置") + private String faceRect; + + @ApiModelProperty(value = "人脸入库id") + @TableField("faceIds") + private String faceIds; + + @ApiModelProperty(value = "人脸特征id") + @TableField("featId") + private String featId; + + @ApiModelProperty(value = "是否有效 Y有效 N无效") + private String isValid; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + +} diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/WarningInformation.java b/face-server/src/main/java/com/dkha/server/modules/entities/WarningInformation.java new file mode 100644 index 0000000..316d121 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/WarningInformation.java @@ -0,0 +1,73 @@ +package com.dkha.server.modules.entities; + +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 预警信息 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="WarningInformation对象", description="预警信息") +public class WarningInformation implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @TableId(value = "id_warning_information", type = IdType.ID_WORKER_STR) + private String idWarningInformation; + + @ApiModelProperty(value = "接收参数") + private String receiveJson; + + @ApiModelProperty(value = "布控任务id") + private String idControlTask; + + @ApiModelProperty(value = "人像id/图片id") + private String idPortrait; + + @ApiModelProperty(value = "预警类型-码值") + private String type; + + @ApiModelProperty(value = "卡口id") + private String idFaceBayonet; + + @ApiModelProperty(value = "比对分数") + private Double score; + + @ApiModelProperty(value = "处理结果类型(1盘查 2抓捕)") + private String processResultType; + + @ApiModelProperty(value = "处理结果") + private String processResult; + + @ApiModelProperty(value = "是否有效 Y有效 N无效") + private String isValid; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + +} diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/FaceCameraExcel.java b/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/FaceCameraExcel.java new file mode 100644 index 0000000..5a49936 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/FaceCameraExcel.java @@ -0,0 +1,60 @@ +package com.dkha.server.modules.entities.faceCamera; + +import com.dkha.common.util.UtilValidate; +import com.dkha.common.util.excel.ExcelField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Data +@ApiModel(description = "摄像头excel") +public class FaceCameraExcel { + @ApiModelProperty(value = "摄像头名称") + @ExcelField(title = "摄像头名称") + public String cameraName; + + @ApiModelProperty(value = "摄像头详细地址") + public String cameraAddress; + + @ApiModelProperty(value = "摄像头经度") + @ExcelField(title = "摄像头坐标经度") + public String cameraLongitude; + + @ApiModelProperty(value = "摄像头纬度") + @ExcelField(title = "摄像头坐标纬度") + public String cameraLatitude; + + @ApiModelProperty(value = "型号") + @ExcelField(title = "摄像头厂家") + public String version; + + + @ApiModelProperty(value = "IP") + @ExcelField(title = "摄像头IP") + public String ip; + + @ApiModelProperty(value = "用户名") + @ExcelField(title = "摄像头用户名") + public String userName; + + @ExcelField(title = "摄像头密码") + @ApiModelProperty(value = "密码") + public String passwd; + + @ApiModelProperty(value = "品牌") + @ExcelField(title = "品牌") + public String brand; + + @ExcelField(title = "品牌") + @ApiModelProperty(value = "rtsp地址") + public String rtspUrl; + @ApiModelProperty(value = "提示信息") + @ExcelField(title = "提示信息") + public String message; + + +} diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/FaceCameraInfo.java b/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/FaceCameraInfo.java new file mode 100644 index 0000000..686d4dc --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/FaceCameraInfo.java @@ -0,0 +1,130 @@ +package com.dkha.server.modules.entities.faceCamera; + +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.modules.sys.entity.SysDictDataEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.apache.commons.lang3.StringUtils; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +//@Data +@ApiModel(description = "查看摄像头信息") +@Getter +@Setter +@NoArgsConstructor +public class FaceCameraInfo { + + @ApiModelProperty(value = "idFaceCamera") + private Long idFaceCamera; + @NotBlank(message = "摄像头名称不能为空") + @ApiModelProperty(value = "摄像头名称") + private String cameraName; + + @ApiModelProperty(value = "摄像头区域-码值") + private String cameraRegionFirstlevel; + + public String getCameraRegionFirstlevel() { + if (UtilValidate.isNotEmpty(cameraRegionFirstlevel)) { + return cameraRegionFirstlevel; + } + + return StringUtils.join(cameraRegionFirstlevelArrays, ','); + } + + @ApiModelProperty(value = "摄像头层级区域冗余字段") + private String cameraRegionFirstlevelBackUp; + @NotNull(message = "摄像头区域不能为空") + @ApiModelProperty(value = "摄像头区域-码值") + private String[] cameraRegionFirstlevelArrays; + + public String[] getCameraRegionFirstlevelArrays() { + if (UtilValidate.isNotEmpty(this.cameraRegionFirstlevelArrays)) { + return this.cameraRegionFirstlevelArrays; + } + + return this.cameraRegionFirstlevel.split(","); + } + + + @ApiModelProperty(value = "摄像头详细地址") + private String cameraAddress; + + @NotBlank(message = "摄像头经度不能为空") + @Min(value = -180,message = "经度不能小于-180") + @Max(value = 180,message = "经度不能大于180") + @ApiModelProperty(value = "摄像头经度") + private String cameraLongitude; + + @NotBlank(message = "摄像头纬度不能为空") + @ApiModelProperty(value = "摄像头纬度") + @Min(value = -90,message = "纬度不能小于-90") + @Max(value = 90,message = "纬度不能大于90") + private String cameraLatitude; +// @NotBlank(message = "位置类型不能为空") +// @ApiModelProperty(value = "位置类型-码值") +// private String cameratLocationtypeId; + + // @ApiModelProperty(value = "公安机关代码") +// private String publicSecurityCode; +// +// @ApiModelProperty(value = "公安机关名称") +// private String publicSecurityName; + @NotBlank(message = "型号不能为空") + @ApiModelProperty(value = "型号") + private String version; + + @ApiModelProperty(value = "品牌id") + private String idBrand; + + // @ApiModelProperty(value = "建设单位") +// private String constructionUnit; +// +// @ApiModelProperty(value = "管理单位") +// private String managementUnit; +// +// @ApiModelProperty(value = "管理人员") +// private String managementPersonnel; +// +// @ApiModelProperty(value = "联系电话") +// private String contactNumber; +// @NotBlank(message = "ip不能为空") + +// @NotBlank(message = "port不能为空") + @ApiModelProperty(value = "端口") + private String port; + + @ApiModelProperty(value = "IP") + private String ip; +// @NotBlank(message = "用户名不能为空") + + @ApiModelProperty(value = "用户名") + private String userName; +// @NotBlank(message = "密码不能为空") + + @ApiModelProperty(value = "密码") + private String passwd; + @NotBlank(message = "品牌不能为空") + + @ApiModelProperty(value = "品牌") + private String brand; + @NotBlank(message = "rtsp地址不能为空") + + @ApiModelProperty(value = "rtsp地址") + private String rtspUrl; + + @ApiModelProperty(value = "备注信息") + private String remarks; + + @ApiModelProperty(value = "是否运行 Y启动 N未启动") + private String status; + +} diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/FaceCameraList.java b/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/FaceCameraList.java new file mode 100644 index 0000000..b2d9b4e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/FaceCameraList.java @@ -0,0 +1,92 @@ +package com.dkha.server.modules.entities.faceCamera; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 摄像头表 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2019-12-08 + */ +@Data +@ApiModel(value = "摄像头列表") +public class FaceCameraList implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "idFaceCamera") + private Long idFaceCamera; + + @ApiModelProperty(value = "摄像头名称") + private String cameraName; + + @ApiModelProperty(value = "摄像头区域-码值") + private String cameraRegionFirstlevel; + @ApiModelProperty(value = "摄像头层级区域冗余字段") + private String cameraRegionFirstlevelBackUp; + + @ApiModelProperty(value = "摄像头详细地址") + private String cameraAddress; + + @ApiModelProperty(value = "摄像头经度") + private String cameraLongitude; + + @ApiModelProperty(value = "摄像头纬度") + private String cameraLatitude; + + @ApiModelProperty(value = "位置类型-码值") + private String cameratLocationtypeId; + @ApiModelProperty(value = "位置类型冗余字段") + + private String cameratLocationtypeIdBackUp; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; +// +// @ApiModelProperty(value = "公安机关代码") +// private String publicSecurityCode; +// +// @ApiModelProperty(value = "公安机关名称") +// private String publicSecurityName; +// +// @ApiModelProperty(value = "建设单位") +// private String constructionUnit; +// +// @ApiModelProperty(value = "管理单位") +// private String managementUnit; +// +// @ApiModelProperty(value = "管理人员") +// private String managementPersonnel; +// +// @ApiModelProperty(value = "联系电话") +// private String contactNumber; +// +// @ApiModelProperty(value = "IP") +// private String ip; +// +// @ApiModelProperty(value = "用户名") +// private String userName; +// +// @ApiModelProperty(value = "密码") +// private String passwd; +// +// @ApiModelProperty(value = "品牌") +// private String brand; +// +// @ApiModelProperty(value = "rtsp地址") +// private String rtspUrl; +// +// @ApiModelProperty(value = "备注信息") +// private String remarks; + + @ApiModelProperty(value = "是否运行 Y启动 N未启动") + private String status; + + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/InsertFaceCamera.java b/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/InsertFaceCamera.java new file mode 100644 index 0000000..769bdaa --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/modules/entities/faceCamera/InsertFaceCamera.java @@ -0,0 +1,102 @@ +package com.dkha.server.modules.entities.faceCamera; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import javax.validation.constraints.*; + +@Data +@ApiModel(description = "新增摄像头") +public class InsertFaceCamera { + @NotBlank(message = "摄像头名称不能为空") + @ApiModelProperty(value = "摄像头名称") + private String cameraName; + + @ApiModelProperty(value = "摄像头区域-码值") + private String cameraRegionFirstlevel; + + public String getCameraRegionFirstlevel() { + StringUtils.join(cameraRegionFirstlevelArrays, ','); + + return StringUtils.join(cameraRegionFirstlevelArrays, ','); + } + + @NotNull(message = "摄像头区域不能为空") + @ApiModelProperty(value = "摄像头区域-码值") + private long[] cameraRegionFirstlevelArrays; + + + @ApiModelProperty(value = "摄像头详细地址") + private String cameraAddress; + + @NotBlank(message = "摄像头经度不能为空") + @Min(value = -180,message = "经度不能小于-180") + @Max(value = 180,message = "经度不能大于180") + @ApiModelProperty(value = "摄像头经度") + private String cameraLongitude; + + @NotBlank(message = "摄像头纬度不能为空") + @Min(value = -90,message = "纬度不能小于-90") + @Max(value = 90,message = "纬度不能大于90") + @ApiModelProperty(value = "摄像头纬度") + private String cameraLatitude; +// +// @NotBlank(message = "位置类型不能为空") +// @ApiModelProperty(value = "位置类型-码值") +// private String cameratLocationtypeId; + +// @ApiModelProperty(value = "公安机关代码") +// private String publicSecurityCode; +// +// @ApiModelProperty(value = "公安机关名称") +// private String publicSecurityName; + +// @ApiModelProperty(value = "建设单位") +// private String constructionUnit; +// +// @ApiModelProperty(value = "管理单位") +// private String managementUnit; +// +// @ApiModelProperty(value = "管理人员") +// private String managementPersonnel; +// @ApiModelProperty(value = "联系电话") +// private String contactNumber; + @NotBlank(message = "ip不能为空") + @ApiModelProperty(value = "IP") + private String ip; + +// @NotBlank(message = "port不能为空") + @ApiModelProperty(value = "端口") + private String port; + +// @NotBlank(message = "用户名不能为空") + @ApiModelProperty(value = "用户名") + private String userName; + +// @NotBlank(message = "密码不能为空") + @ApiModelProperty(value = "密码") + private String passwd; + +// @NotBlank(message = "型号不能为空") + @ApiModelProperty(value = "型号") + private String version; + + @NotBlank(message = "品牌id") + @ApiModelProperty(value = "品牌id") + private String idBrand; + +// @NotBlank(message = "品牌不能为空") + @ApiModelProperty(value = "品牌") + private String brand; + + @NotBlank(message = "rtsp地址不能为空") + @ApiModelProperty(value = "rtsp地址") + private String rtspUrl; + + @ApiModelProperty(value = "备注信息") + private String remarks; + + +} diff --git a/face-server/src/main/java/com/dkha/server/schedule/CheckCameraTimer.java b/face-server/src/main/java/com/dkha/server/schedule/CheckCameraTimer.java new file mode 100644 index 0000000..a276fc5 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/schedule/CheckCameraTimer.java @@ -0,0 +1,68 @@ +package com.dkha.server.schedule; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dkha.common.enums.YNEnums; +import com.dkha.server.modules.entities.FaceCameraEntity; +import com.dkha.server.services.FaceCameraService; +import lombok.extern.slf4j.Slf4j; +import org.bytedeco.javacv.FFmpegFrameGrabber; +import org.bytedeco.javacv.FrameGrabber; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName: CheckCameraTimer + * @Description: + * @author: yanping + * @date: 2020-01-07 10:25:50 + * @Copyright: 成都电科惠安 + */ + +@Slf4j +@Component +public class CheckCameraTimer { + + @Autowired + private FaceCameraService faceCameraService; + + /** + * 检测摄像头是否可用,项目启动10秒后执行,间隔时间为两小时 + */ + @Scheduled(fixedDelay = 1000 * 3600 * 2, initialDelay = 10000) + public void checkCameras() { + List cameras = faceCameraService.list(new QueryWrapper().eq("is_valid", YNEnums.YES.code)); + List updates = new ArrayList<>(); + for (FaceCameraEntity faceCameraEntity : cameras) { + String rtspUrl = faceCameraEntity.getRtspUrl(); + FFmpegFrameGrabber fFmpegFrameGrabber = null; + try { + fFmpegFrameGrabber = new FFmpegFrameGrabber(rtspUrl); + fFmpegFrameGrabber.start(); + fFmpegFrameGrabber.stop(); + faceCameraEntity.setStatus(YNEnums.YES.code); + updates.add(faceCameraEntity); + } catch (FrameGrabber.Exception e) { + log.error(e.getMessage()); + faceCameraEntity.setStatus(YNEnums.NO.code); + updates.add(faceCameraEntity); + continue; + } finally { + + } + + } + if(updates.size() > 0){ + faceCameraService.updateBatchById(updates); + } + + } + + +} diff --git a/face-server/src/main/java/com/dkha/server/services/FaceCameraService.java b/face-server/src/main/java/com/dkha/server/services/FaceCameraService.java new file mode 100644 index 0000000..d392f34 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/FaceCameraService.java @@ -0,0 +1,129 @@ +package com.dkha.server.services; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.common.page.PageParam; +import com.dkha.server.modules.entities.FaceCameraEntity; +import com.dkha.server.modules.entities.faceCamera.FaceCameraExcel; +import com.dkha.server.modules.entities.faceCamera.FaceCameraInfo; +import com.dkha.server.modules.entities.faceCamera.FaceCameraList; +import com.dkha.server.modules.entities.faceCamera.InsertFaceCamera; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; + +/** + * 摄像头表 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2019-12-08 + */ +public interface FaceCameraService extends IService { + /** + * 获取摄像头信息 + * + * @param pageParam + * @return + */ + Page getPage(PageParam pageParam); + + /** + * 获取所有摄像头信息 + * @param cameraName + * @return + */ + List getAll(String cameraName); + + /** + * 新增摄像头 + * @param insertFaceCamera + * @return 条数 + */ + Integer insertCamera(InsertFaceCamera insertFaceCamera); + + /** + * /查看摄像头 + * + * @param idCamera + * @return + */ + FaceCameraInfo findById(long idCamera); + + /** + * 获取摄像头卡口树状图 + * 第一级传0 + * @param id + * @return + */ + List> getBayonet(Long id); + + /** + * 获取摄像头区域树状图 + * + * @return + */ + List> getRegion(Long pid); + + /** + * 获取当前区域下的摄像头 + * @param regionId + * @return + */ + List> getCameraByRegionId(long regionId); + + /** + * 获取当前区域下尚未布控的摄像头 + * @param regionId + * @return + */ + List> getRegionUnControlCamera(long regionId); + + /** + * 获取当前区域下的所有摄像头 + * @param regionId + * @return + */ + List> getAllCameraByRegionId(long regionId); + Integer delete(long camera); + + /** + * 修改摄像头状态 + * @param camera + * @param status + * @return + */ + Integer status(long camera, boolean status); + + /** + * Excel导入 + * @param multipartFile + * @return + * @throws Exception + */ + List importExcel(MultipartFile multipartFile) ; + + /** + * 修改摄像头信息 + * @param faceCameraInfo + * @return + */ + Integer update(FaceCameraInfo faceCameraInfo); + + /** + * 根据任务获取所有布控摄像头信息 + * @return + */ + List findCameraByTask(); + + /** + * 经纬度查询摄像头信息 + * @param cameraLongitude + * @param cameraLatitude + * @return + */ + FaceCameraEntity findByCoordinate(String cameraLongitude,String cameraLatitude); + CameraInfoVO selectFaceCameraID(String idFaceCamera); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/services/FaceTrackService.java b/face-server/src/main/java/com/dkha/server/services/FaceTrackService.java new file mode 100644 index 0000000..f271138 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/FaceTrackService.java @@ -0,0 +1,68 @@ +package com.dkha.server.services; + + + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dkha.common.modules.vo.face.FaceTrackVO; +import com.dkha.server.modules.entities.FaceTrackEntity; + +import java.util.List; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +public interface FaceTrackService extends IService { + /** + * 新增 + * @param faceTrackEntity + * @return + */ + int addFaceTrackEntity(FaceTrackEntity faceTrackEntity); + /** + * 根据摄像头和分组时间查询 + * @param idFaceCamera + * @param packetTime + * @return + */ + List querByidCameraAndTime(Long idFaceCamera, String packetTime); + + /** + * 根据摄像头Id和开始,结束时间,人脸ID + * @param faceTrackVO + * @return + */ + List queryByidCamerAndFaceId(FaceTrackVO faceTrackVO); + + /** + * 根据图片路径和开始,结束时间 + * @param faceTrackVO + * @return + */ + List queryByurlAndTime(FaceTrackVO faceTrackVO); + + /** + * 根據時間獲取庫id + * @param faceTrackVO + * @return + */ + List findIdFatoryByTime(FaceTrackVO faceTrackVO); + + /** + * 根据图片路径和开始,结束时间和阈值 + * @param faceTrackVO + * @return + */ + List queryBytrajectoryThreshold(FaceTrackVO faceTrackVO); + /** + * 根据人脸ID查询 + * @param idPortrait + * @return + */ + FaceTrackEntity queryByIdPortrait(String idPortrait); + + List findTrackByFaceId(List faceIds); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/services/ICompareService.java b/face-server/src/main/java/com/dkha/server/services/ICompareService.java new file mode 100644 index 0000000..657835f --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/ICompareService.java @@ -0,0 +1,35 @@ +package com.dkha.server.services; + + +import com.dkha.common.modules.vo.facelib.CompareRequestVo; +import com.dkha.common.modules.vo.facelib.CompareResultVo; +import com.dkha.common.modules.vo.facelib.OneToOneResultVo; + +/** + * @Author Spring + * @Since 2019/12/11 16:12 + * @Description 比对相关业务 + */ +public interface ICompareService { + + /** + * 分组比对接口 + * @param compareRequestVo + * @return + */ + CompareResultVo groupingCompare(CompareRequestVo compareRequestVo); + + /** + * 一比一接口 + * @param compareRequestVo + * @return + */ + OneToOneResultVo oneToOne(CompareRequestVo compareRequestVo); + + /*** + * 图片上传 bease64 + * @param image + * @return + */ + String setFaceCompare(String image); +} diff --git a/face-server/src/main/java/com/dkha/server/services/IControlBayonetMidService.java b/face-server/src/main/java/com/dkha/server/services/IControlBayonetMidService.java new file mode 100644 index 0000000..5faffdd --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/IControlBayonetMidService.java @@ -0,0 +1,59 @@ +package com.dkha.server.services; + +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.server.modules.entities.ControlBayonetMid; +import com.baomidou.mybatisplus.extension.service.IService; +import com.dkha.server.modules.entities.FaceCameraEntity; + +import java.util.List; + +/** + *

+ * 布控和摄像头中间表 服务类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +public interface IControlBayonetMidService extends IService { + /** + * 根据任务ID删除任务和摄像头的中间表 + */ + Integer deletetaskandcarmerbytaskid(String taskID); + + /** + * 根据摄像头ID判断是否存在任务 + */ + long selectexistByCarmeID(String idcamera); + + /** + * 更新中间库摄像头状态 + */ + Integer updateCarmerValidaStateByTaskID(String taskID, String State, String UpdateBy); + + /** + * 根据任务ID获取摄像头列表 + */ + List selectFaceCameraBytaskID(String taskid); + + /** + * 获取摄像头信息 + * @return + */ + List selectFaceCameraBytask(); + /** + * 获取最新布控的一个摄像头 + */ + ControlBayonetMid selectFaceCameraByTime(); + + /** + * 根据区域获取布控任务 + * + * @param regionId + * @return + */ + int getControlByRegion(long regionId); + + List selectFaceCameraBytaskInfo(); + +} diff --git a/face-server/src/main/java/com/dkha/server/services/IControlLibraryMidService.java b/face-server/src/main/java/com/dkha/server/services/IControlLibraryMidService.java new file mode 100644 index 0000000..e72544e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/IControlLibraryMidService.java @@ -0,0 +1,19 @@ +package com.dkha.server.services; + +import com.dkha.server.mappers.ControlLibraryMidMapper; +import com.dkha.server.modules.entities.ControlLibraryMid; +import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.beans.factory.annotation.Autowired; + +/** + *

+ * 布控和库中间表 服务类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +public interface IControlLibraryMidService extends IService { + + public Integer deletetaskLibraryMidbytaskid(String taskID) ; +} diff --git a/face-server/src/main/java/com/dkha/server/services/IControlTaskService.java b/face-server/src/main/java/com/dkha/server/services/IControlTaskService.java new file mode 100644 index 0000000..2c64566 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/IControlTaskService.java @@ -0,0 +1,54 @@ +package com.dkha.server.services; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.modules.vo.control.TaskControlVO; +import com.dkha.common.modules.vo.control.VideoControlVo; +import com.dkha.common.page.PageParam; +import com.dkha.common.result.CommonResult; +import com.dkha.server.modules.entities.ControlTask; +import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; + +/** + *

+ * 布控任务 服务类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +public interface IControlTaskService extends IService { + + /**查询任务列表*/ + Page getList(PageParam pageParam,Integer videotype); + /**添加任务列表*/ + CommonResult addControlTask(TaskControlVO controlTask); + /**修改任务*/ + CommonResult updateControlTask(TaskControlVO controlTask); + /**删除指定任务*/ + CommonResult deleteControlTask(String taskID); + /**根据任务ID获取摄像头列表*/ + CommonResult getCameraListByTaskID(String taskID); + /**根据任务Num获取摄像头列表*/ + CommonResult getCameraListByTaskNO(String taskNO); + /**根据任务ID停止任务*/ + CommonResult stopControlByTaskID(String taskID); + /**根据任务ID暂停任务*/ + CommonResult suspendControlByTaskID(String taskID); + /**根据任务ID恢复任务*/ + CommonResult resumeControlByTaskID(String taskID); + /**人脸信息添加*/ + CommonResult addtaskfaceFile(MultipartFile multipartFile); + /**人脸信息添加base64*/ + CommonResult addtaskfaceFiles(String url); + /**添加视频文件*/ + CommonResult addcomplevideoFile(MultipartFile multipartFile); + /**添加视频比对任务*/ + CommonResult addcomplevideoTask(VideoControlVo controlVO); + /**根据摄像头的区域ID列表转换为区域字符串*/ + String getCameraRegionStringByRegionstr(String Regionstr); + /**根据任务ID获取库字符串*/ + String getLibRegionBytaskid(String taskID); + /**根据摄像头id获取任务信息*/ + ControlTask getTaskInfoByCameraID(String Camera); +} diff --git a/face-server/src/main/java/com/dkha/server/services/IFaceCameraService.java b/face-server/src/main/java/com/dkha/server/services/IFaceCameraService.java new file mode 100644 index 0000000..045053c --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/IFaceCameraService.java @@ -0,0 +1,16 @@ +package com.dkha.server.services; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dkha.server.modules.entities.FaceCameraEntity; + +/** + *

+ * 摄像头表 服务类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +public interface IFaceCameraService extends IService { + +} diff --git a/face-server/src/main/java/com/dkha/server/services/IFaceLibraryService.java b/face-server/src/main/java/com/dkha/server/services/IFaceLibraryService.java new file mode 100644 index 0000000..841b4f5 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/IFaceLibraryService.java @@ -0,0 +1,52 @@ +package com.dkha.server.services; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.page.PageParam; +import com.dkha.server.modules.entities.FaceLibrary; +import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + *

+ * 库表 服务类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +public interface IFaceLibraryService extends IService { + /** + * 新增库 + * @param faceLibrary + * @return + */ + FaceLibrary addLibrary(FaceLibrary faceLibrary); + + /** + * 删除库 + * @param faceLibrary + * @return + */ + FaceLibrary deleteLibrary(Long faceLibrary); + /** + * 修改库 + * @param faceLibrary + * @return + */ + FaceLibrary updateLibrary(FaceLibrary faceLibrary); + + /** + * 查询 + * @return + */ + Page queryLibrary(PageParam pageParam); + + /** + * 人像库查所有 + * @return + */ + List findFaceLibraries(); +} + diff --git a/face-server/src/main/java/com/dkha/server/services/IFileService.java b/face-server/src/main/java/com/dkha/server/services/IFileService.java new file mode 100644 index 0000000..27cd473 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/IFileService.java @@ -0,0 +1,36 @@ +package com.dkha.server.services; + +import com.dkha.common.modules.vo.cut.CutVo; +import com.dkha.common.modules.vo.upload.ImageUploadResult; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; + +/** + * @Author Spring + * @Since 2019/12/11 15:40 + * @Description 文件上传相关 + */ +public interface IFileService { + + /** + * 多图/单图上传,其中一张图可以多人脸/单人脸 + * @param multipartFiles + * @return + */ + ImageUploadResult uploadMultiFaceImages(MultipartFile[] multipartFiles) throws Exception; + + /** + * 单图上传,其中一张图只能有一张人脸 + * @param multipartFiles + * @return + */ + ImageUploadResult uploadSingleFaceImage(MultipartFile[] multipartFiles) throws Exception; + + /** + * 裁剪图片 + * @param cutVo + * @return + */ + String cutPicture(CutVo cutVo) throws Exception; +} diff --git a/face-server/src/main/java/com/dkha/server/services/IPortraitService.java b/face-server/src/main/java/com/dkha/server/services/IPortraitService.java new file mode 100644 index 0000000..7a8cb0e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/IPortraitService.java @@ -0,0 +1,89 @@ +package com.dkha.server.services; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.modules.vo.face.ApiSearchFaceRectVO; +import com.dkha.common.modules.vo.search.SearchRequestVo; +import com.dkha.common.modules.vo.search.SearchResultVo; +import com.dkha.common.page.PageParam; +import com.dkha.server.modules.entities.Portrait; +import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + *

+ * 人像表 服务类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +public interface IPortraitService extends IService { + /** + * 人脸入库 + * @param multipartFile + * @return + */ + Portrait addPortrait(String libraryId,MultipartFile multipartFile) ; + /** + * 人脸检测 + * @param multipartFile + * @return + */ + List pictureDetection(MultipartFile multipartFile) throws Exception; + /** + * 布控图片人脸入库 + * @param multipartFile + * @return + */ + Portrait addPortraitPng(String libraryId,MultipartFile multipartFile) ; + /** + * 布控图片人脸入库(地址为base64的编码转url) + * @param multipartFile + * @return + */ + Portrait addPortraitPngs(String libraryId,String multipartFile) ; + + + /** + * 人脸批量入库 + * @param files + * @return + */ + List addPortraits(String libraryId,MultipartFile[] files); + /** + * 修改人脸信息 + * @param portrait + * @return + */ + Portrait updatePortrait(Portrait portrait); + + /** + * 删除人脸 + * @param portrait + * @return + */ + Long deletePortrait(Long portrait); + + /** + * 批量删除人脸 + * @param portraitId + * @return + */ + List deletePortraits(List portraitId); + + /** + * 人脸入库 + * @param pageParam + * @return + */ + Page queryPortrait(PageParam pageParam); + + /** + * 人脸库检索----分页 + * @param searchRequestVo 人脸库检索请求Vo + * @return + */ + SearchResultVo libSearchPage(SearchRequestVo searchRequestVo); +} diff --git a/face-server/src/main/java/com/dkha/server/services/IWarningInformationService.java b/face-server/src/main/java/com/dkha/server/services/IWarningInformationService.java new file mode 100644 index 0000000..efd4e89 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/IWarningInformationService.java @@ -0,0 +1,16 @@ +package com.dkha.server.services; + +import com.dkha.server.modules.entities.WarningInformation; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 预警信息 服务类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +public interface IWarningInformationService extends IService { + +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java new file mode 100644 index 0000000..7201fc1 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java @@ -0,0 +1,203 @@ +package com.dkha.server.services.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.dkha.common.enums.ApiUrlEnum; +import com.dkha.common.exception.DkException; +import com.dkha.common.fileupload.MinioUtil; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.ReturnVO; +import com.dkha.common.modules.vo.face.ApiFaceOneSearchFaceVO; +import com.dkha.common.modules.vo.face.ApiFaceOneSearchReturnFaceVO; +import com.dkha.common.modules.vo.face.ApiFaceSearGroupReturnVO; +import com.dkha.common.modules.vo.face.ApiSearchFaceRectVO; +import com.dkha.common.modules.vo.facelib.*; +import com.dkha.common.modules.vo.search.FaceCheckVO; +import com.dkha.common.modules.vo.search.FaceCompareVO; +import com.dkha.common.util.Base64ImageUtils; +import com.dkha.common.util.JsonUtil; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.services.ICompareService; +import com.dkha.server.services.IFileService; +import com.fasterxml.jackson.core.type.TypeReference; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * @Author Spring + * @Since 2019/12/11 16:12 + * @Description 比对相关业务类 + */ +@Component +public class CompareServiceImpl implements ICompareService { + + @Value("${api.group.max}") + private String apiGroupMaxSize; + @Value("${api.server.prefix}") + private String apiServerPrefix; + @Value("${api.group.min}") + private int apiGroupMinSize; + @Autowired + private HttpUtil httpUtil; +// @Autowired +// private Base64ImageUtils base64ImageUtils; + @Autowired + private MinioUtil minioUtil; + @Autowired + private IFileService iFileService; + @Value("${api.server.prefix}") + private String apiRequestPrefix; + /** + * 比对的图片数量 + */ + public static int comparePicSize = 2; + + @Override + public CompareResultVo groupingCompare(CompareRequestVo compareRequestVo) { + if (UtilValidate.isEmpty(compareRequestVo.getUrlList())) { + throw new DkException("请选择需要比对的图片"); + } + if (compareRequestVo.getUrlList().size() < apiGroupMinSize) { + throw new DkException("请至少选择" + apiGroupMinSize + "张图片进行分组"); + } + if (compareRequestVo.getUrlList().size() > Integer.parseInt(apiGroupMaxSize)) { + throw new DkException("最多只支持"+ apiGroupMaxSize +"张图片分组"); + } + //调用sdk进行分组 + FaceCheckVO faceCheckVO = new FaceCheckVO(); + if (UtilValidate.isNotEmpty(compareRequestVo.getMinScore())) { + faceCheckVO.setMinScore(compareRequestVo.getMinScore()); + } + faceCheckVO.setImgs(compareRequestVo.getUrlList()); + String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_GROUP.getUrl(); + ReturnVO returnVO = (ReturnVO)httpUtil.post(apiUrl, faceCheckVO, ReturnVO.class); + List> resultList = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference>>() {}); + //返回结果集 + CompareResultVo compareResultVo = new CompareResultVo(); + if (UtilValidate.isNotEmpty(resultList)) { + for (List apiFaceSearGroupReturnVOList : resultList) { + CompareResultSubVo compareResultSubVo = new CompareResultSubVo(); + //取返回回来的第一张图片作为左侧比对标准 + compareResultSubVo.setResultUrl(apiFaceSearGroupReturnVOList.get(0).getUrl()); + for (int i = 1; i < apiFaceSearGroupReturnVOList.size(); i++) { + CompareResultDetailVo compareResultDetailVo = new CompareResultDetailVo(); + compareResultDetailVo.setScore(apiFaceSearGroupReturnVOList.get(i).getHitSimilarity()); + compareResultDetailVo.setUrl(apiFaceSearGroupReturnVOList.get(i).getUrl()); + compareResultSubVo.getCompareResultSubVoList().add(compareResultDetailVo); + } + compareResultVo.getCompareResultSubVoList().add(compareResultSubVo); + } + } + return compareResultVo; + } + + @Override + public OneToOneResultVo oneToOne(CompareRequestVo compareRequestVo) { + if (UtilValidate.isEmpty(compareRequestVo.getUrlList())) { + throw new DkException("请选择需要比对的图片"); + } + if (compareRequestVo.getUrlList().size() != comparePicSize) { + throw new DkException("请上传1:1比对的两张图片"); + } + String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl(); + FaceCompareVO faceCompareVO = new FaceCompareVO(); + faceCompareVO.setImage1(compareRequestVo.getUrlList().get(0)); + faceCompareVO.setImage2(compareRequestVo.getUrlList().get(1)); + ReturnVO returnVO = (ReturnVO)httpUtil.post(apiUrl, faceCompareVO, ReturnVO.class); + ApiFaceOneSearchReturnFaceVO apiFaceOneSearchReturnFaceVO = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference() {}); + //返回结果集 + OneToOneResultVo oneToOneResultVo = new OneToOneResultVo(); + if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) { + if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) { + for (ApiFaceOneSearchFaceVO apiFaceOneSearchFaceVO : apiFaceOneSearchReturnFaceVO.getFaces()) { + oneToOneResultVo.getUrls().add(apiFaceOneSearchFaceVO.getUrl()); + } + oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity()); + } + } + return oneToOneResultVo; + } + + @Override + public String setFaceCompare(String image) { + JSONObject map1; + try { + map1 = minioUtil.uploadFiles(Base64ImageUtils.BaseToInputStream(image), String.valueOf(getHash() % 500), String.valueOf(getHash()), ".jpg"); + } catch (Exception e) { + e.printStackTrace(); + throw new DkException("文件上传失败"); + } + String imag = map1.getString("url"); + validateSingleFaceImage(imag); + return imag; + + } + + /** + * 返回hash值 + * @return + */ + public int getHash(){ + String uuid = UUID.randomUUID().toString().replaceAll("-",""); + int hash = uuid.hashCode(); + if(hash<0){ + hash = 0-hash; + } + return hash; + } + /** + * 多图/单图上传,其中一张图可以多人脸/单人脸 校验 + * @param image + */ + private void validateSingleFaceImage(String image) { + //人脸检测url + String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl(); + //组装api请求数据 + ReturnVO returnVO; + returnVO = (ReturnVO) httpUtil.post(faceSearchUrl + "?url=" + image, null, ReturnVO.class); + if (returnVO.getCode() != 200) { + throw new DkException(returnVO.getMessage()); + } + //反序列化 + List apiSearchFaceRectVOList = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference>() {}); + if (UtilValidate.isEmpty(apiSearchFaceRectVOList)) { + throw new DkException("当前上传中未检测到人脸,请重新上传"); + } + if (apiSearchFaceRectVOList.size() > 1) { + throw new DkException("当前上传图片检测到多张人脸,请重新上传"); + } + } + //上传图片 + public FaceCompareVO setFaceCompare(String image1,String image2) { + FaceCompareVO faceCompareVO = new FaceCompareVO(); + JSONObject map1; + try { + map1 = minioUtil.uploadFiles(Base64ImageUtils.BaseToInputStream(image1), String.valueOf(getHash() % 500), String.valueOf(getHash()), null); + String imag = map1.getString("url"); + validateSingleFaceImage(imag); + faceCompareVO.setImage1(imag); + } catch (Exception e) { + throw new DkException("文件上传失败"); + } + + JSONObject map2; + try { + map2 = minioUtil.uploadFiles(Base64ImageUtils.BaseToInputStream(image2), String.valueOf(getHash() % 500), String.valueOf(getHash()), null); + String image = map2.getString("url"); + validateSingleFaceImage(image); + faceCompareVO.setImage2(image); + } catch (Exception e) { + throw new DkException("文件上传失败"); + } + + return faceCompareVO; + } +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/ControlBayonetMidServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/ControlBayonetMidServiceImpl.java new file mode 100644 index 0000000..cc72793 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/ControlBayonetMidServiceImpl.java @@ -0,0 +1,72 @@ +package com.dkha.server.services.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.server.modules.entities.ControlBayonetMid; +import com.dkha.server.mappers.ControlBayonetMidMapper; +import com.dkha.server.modules.entities.FaceCameraEntity; +import com.dkha.server.services.IControlBayonetMidService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 布控和摄像头中间表 服务实现类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Service +public class ControlBayonetMidServiceImpl extends ServiceImpl implements IControlBayonetMidService { + + @Autowired + ControlBayonetMidMapper controlBayonetMidMapper; + + @Override + public Integer deletetaskandcarmerbytaskid(String taskID) { + return controlBayonetMidMapper.deletetaskandcarmerbytaskid(taskID); + } + + @Override + public long selectexistByCarmeID(String idcamera) { + long rs = controlBayonetMidMapper.selectexistByCarmeID(idcamera); + return rs; + } + + @Override + public Integer updateCarmerValidaStateByTaskID(String taskID, String State, String UpdateBy) { + return controlBayonetMidMapper.updateCarmerValidaStateByTaskID(taskID, State, UpdateBy); + } + + @Override + public List selectFaceCameraBytaskID(String taskid) { + return controlBayonetMidMapper.selectFaceCameraBytaskID(taskid); + } + + @Override + public List selectFaceCameraBytask() { + return controlBayonetMidMapper.selectFaceCameraBytask(); + } + + @Override + public ControlBayonetMid selectFaceCameraByTime() { + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("is_valid", "Y").orderByDesc("create_time").last("limit 1"); + return controlBayonetMidMapper.selectOne(queryWrapper); + } + + @Override + public int getControlByRegion(long regionId) { + return controlBayonetMidMapper.getControlByRegion(regionId); + } + + @Override + public List selectFaceCameraBytaskInfo() { + return controlBayonetMidMapper.selectFaceCameraBytaskInfo(); + } +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/ControlLibraryMidServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/ControlLibraryMidServiceImpl.java new file mode 100644 index 0000000..d9dbb61 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/ControlLibraryMidServiceImpl.java @@ -0,0 +1,27 @@ +package com.dkha.server.services.impl; + +import com.dkha.server.modules.entities.ControlLibraryMid; +import com.dkha.server.mappers.ControlLibraryMidMapper; +import com.dkha.server.services.IControlLibraryMidService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + *

+ * 布控和库中间表 服务实现类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Service +public class ControlLibraryMidServiceImpl extends ServiceImpl implements IControlLibraryMidService { + @Autowired + ControlLibraryMidMapper controlLibraryMidMapper ; + + @Override + public Integer deletetaskLibraryMidbytaskid(String taskID) { + return controlLibraryMidMapper.deletetaskLibraryMidbytaskid(taskID); + } +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/ControlTaskServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/ControlTaskServiceImpl.java new file mode 100644 index 0000000..4254dbf --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/ControlTaskServiceImpl.java @@ -0,0 +1,734 @@ +package com.dkha.server.services.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dkha.common.enums.*; +import com.dkha.common.fileupload.MinioUtil; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.control.ControlTaskVedioVO; +import com.dkha.common.modules.vo.control.TaskControlVO; +import com.dkha.common.modules.vo.control.VideoControlVo; +import com.dkha.common.modules.vo.face.ControlTaskVO; +import com.dkha.common.page.PageParam; +import com.dkha.common.result.CommonResult; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.mappers.ControlLibraryMidMapper; +import com.dkha.server.mappers.ControlTaskMapper; +import com.dkha.server.mappers.FaceCameraDao; +import com.dkha.server.modules.entities.*; +import com.dkha.server.services.*; +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.*; +import java.util.regex.Pattern; + +/** + *

+ * 布控任务 服务实现类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Service +@Slf4j +public class ControlTaskServiceImpl extends ServiceImpl implements IControlTaskService { + + @Autowired + ControlTaskMapper controlTaskMapper; + @Autowired + FaceCameraDao faceCameraDao; + @Autowired + ControlBayonetMidServiceImpl controlBayonetMidService; + @Autowired + ControlLibraryMidMapper controlLibraryMidMapper; + @Autowired + ControlLibraryMidServiceImpl controlLibraryMidService; + + @Autowired + private IPortraitService iPortraitService; + + @Autowired + private IFaceLibraryService iFaceLibraryService; + @Autowired + private FaceCameraService faceCameraService; + + @Value("${api.server.prefix}") + private String link; + @Value("${videotype}") + private String videoreg = "(mp4|flv|avi|rm|rmvb|wmv)"; + + @Resource + private HttpUtil httpUtil; + + @Autowired + private MinioUtil minioUtil; + + @Override + public Page getList(PageParam pageParam,Integer videotype) { + if (pageParam.getPageNo() < 1) { + pageParam.setPageNo(1); + } + if (pageParam.getPageSize() < 0 || pageParam.getPageSize() > 500) { + pageParam.setPageSize(20); + } + Page page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize()); + //分页查询 + List facetaskLists=null; + if(videotype==-1) { + facetaskLists = controlTaskMapper.getviedoTaskList(page, pageParam.getNote()); + }else + { + facetaskLists = controlTaskMapper.getTaskList(page, pageParam.getNote()); + } + for (ControlTask ct : facetaskLists) { + //生成摄像头列表的区域信息 + ct.setTasklibstr( this.getLibRegionBytaskid(ct.getIdControlTask().toString())); + //摄像头名称 + List faceCameras = controlBayonetMidService.selectFaceCameraBytaskID(ct.getIdControlTask().toString()); + ct.setListfacecamera(faceCameras); + //视频任务列表,需要获取任务状态 + if(-1==videotype){ + try { + ct.setTaskstatus(TaskStatuEnum.STATUS_WORKING.getMessage()); + Map resultMap = (Map) httpUtil.get(link + ApiUrlEnum.ALARMS_STATUS.getUrl() + "/" + ct.getTaskNo(), Map.class); + if (resultMap != null) { + if (ErrEnum.OK.getCode().toString().equalsIgnoreCase(resultMap.get("code").toString())) { + Map data = (Map) resultMap.get("data"); + if (data != null && data.get("status") != null) { + if (TaskStatuEnum.STATUS_OVER.getCode().equalsIgnoreCase(data.get("status").toString())) { + ct.setTaskstatus(TaskStatuEnum.STATUS_OVER.getMessage()); + } + } + } + } + + }catch (Exception ex){ + } + } + } + page.setRecords(facetaskLists); + return page; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult addControlTask(TaskControlVO taskvo) { + + List listcamera = taskvo.getListcamera(); + if(listcamera==null||listcamera.size()==0) { + return new CommonResult(null, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "布控摄像头信息不能为空!"); + } + try { + /*1 校验区域所属的摄像头是否有任务执行 */ + //保存摄像头列表 + List listBayone = new ArrayList<>(); + List listBayonebyUse = new ArrayList<>(); + List camerList = new ArrayList<>(); + //存储摄像头的区域码表 + HashMap cameraRegion=new HashMap<>(); + for (String camerid : listcamera) { + ControlBayonetMid controlBayonetMid = new ControlBayonetMid(); + FaceCameraEntity faceCamera = faceCameraService.getById(camerid); + if (controlBayonetMidService.selectexistByCarmeID(camerid) == 0) { + //依次判断摄像头是否添加到任务中 + controlBayonetMid.setIsValid(YNEnums.YES.code); + controlBayonetMid.setIdFaceCamera(faceCamera.getIdFaceCamera()); + camerList.add(faceCamera.getIdFaceCamera().toString()); + listBayone.add(controlBayonetMid); + cameraRegion.put(faceCamera.getCameraRegionFirstlevel(),1); + } else { + listBayonebyUse.add(faceCamera); + } + } + if (!UtilValidate.isEmpty(listBayonebyUse)) { + return new CommonResult(listBayonebyUse, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "该区域下摄像头有被其他任务使用!"); + } + //保存库列表 + List listbibray = new ArrayList<>(); + List listbibraybyUse = new ArrayList<>(); + List listlibs = taskvo.getLibIds(); + for (String libid : listlibs) { + if (controlLibraryMidMapper.selectexistByLibID(libid, YNEnums.YES.code) > 0) { + ControlLibraryMid clm = new ControlLibraryMid(); + clm.setIdFactory(Long.parseLong(libid.toString())); + clm.setIsValid(YNEnums.YES.code); + listbibray.add(clm); + } else { + listbibraybyUse.add(libid); + } + } + if (!UtilValidate.isEmpty(listbibraybyUse)) { + return new CommonResult(listbibraybyUse, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "该任务存在无效库!"); + } + // 调用平台API接口 + ControlTaskVO ctvo = new ControlTaskVO(); + //任务名称 + String strTaskNo = "00000000"; + ctvo.setName(taskvo.getTaskName()); + ctvo.setThreshold(taskvo.getControlThreshold()); + ctvo.setCameraId(camerList); + ctvo.setLibraryId(taskvo.getLibIds()); + Map resultMap = ( Map) httpUtil.post(link+ApiUrlEnum.TASK_POSTURL.getUrl(), ctvo, Map.class); + if(resultMap!=null){ + if(ErrEnum.OK.getCode().toString().equalsIgnoreCase(resultMap.get("code").toString())) + { + Map data= (Map) resultMap.get("data"); + if(data!=null&&data.get("taskId")!=null){ + strTaskNo=data.get("taskId").toString(); + }else + { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API保存任务信息失败!没有获取到任务编号"); + } + }else { + return new CommonResult(resultMap, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API保存任务信息失败!"); + } + }else { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API保存任务信息失败!"); + } + + ControlTask controlTask = new ControlTask(); + controlTask.setTaskNo(strTaskNo); + BeanUtils.copyProperties(taskvo, controlTask); + //设置任务区域 + controlTask.setControlRegion(this.getCameraRegionStringByCameraList(cameraRegion)); + controlTask.setIsValid(TaskStatusEnum.RUN.code); + //保存任务 + if (this.save(controlTask)) { + for (ControlBayonetMid cbm : listBayone) { + //设置任务编号 + cbm.setIdControlTask(controlTask.getIdControlTask()); + } + for (ControlLibraryMid clm : listbibray) { + //设置任务编号 + clm.setIdControlTask(controlTask.getIdControlTask()); + } + //批量 保存摄像头列表 + controlBayonetMidService.saveBatch(listBayone); + //批量 保存库ID列表 + controlLibraryMidService.saveBatch(listbibray); + return new CommonResult(controlTask.getTaskNo(), SystemCode.HANDLER_SUCCESS.code, SystemCode.HANDLER_SUCCESS.des); + } else { + log.error("任务保存:{}", controlTask.getTaskNo()); + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "保存任务信息失败!"); + } + } catch (Exception ex) { + log.error("保存任务异常:{}", ex.getMessage()); + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "保存任务信息失败!"+ex.getMessage()); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult updateControlTask(TaskControlVO controlTask) { + //根据任务ID查询任务信息 + ControlTask controlOne = this.getById(controlTask.getIdControlTask()); + if (controlOne == null) { + return new CommonResult(null, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "参数异常,非法的任务ID!查询不到有效任务"); + } else { + try { + controlOne.setTaskName(controlTask.getTaskName()); + controlOne.setDisposalType(controlTask.getDisposalType()); + controlOne.setRemarks(controlTask.getRemarks()); + this.updateById(controlOne); + } catch (Exception ex) { + log.error("修改任务异常:{}", ex.getMessage()); + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "修改任务信息失败!"); + } + } + return new CommonResult(controlOne, SystemCode.HANDLER_SUCCESS.code, SystemCode.HANDLER_SUCCESS.des); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult deleteControlTask(String taskID) { + //根据任务ID查询任务信息 + ControlTask controlOne = this.getById(taskID); + if (controlOne == null) { + return new CommonResult(null, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "参数异常,非法的任务ID!"); + } else { + try { + boolean isDeleteApi = false; + //1. 调用平台API接口 + Map resultMap = (Map) httpUtil.delete(link + ApiUrlEnum.TASK_POSTURL.getUrl() + "/" + controlOne.getTaskNo(), Map.class); + if (resultMap != null) { + if(ErrEnum.OK.getCode().toString().equalsIgnoreCase(resultMap.get("code").toString())){ + isDeleteApi=true; + } + } else { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API删除任务信息失败!"); + } + if (isDeleteApi) { + // 删除任务摄像头中间管理库 + controlBayonetMidService.deletetaskandcarmerbytaskid(taskID); + // 删除任务特征库中间管理库 + controlLibraryMidService.deletetaskLibraryMidbytaskid(taskID); + // 删除本地数据库 + this.removeById(taskID); + } else { + return new CommonResult(taskID, SystemCode.DELETE_FAILED.code, "平台API删除任务信息失败"); + } + } catch (Exception ex) { + log.error("删除任务异常:{}", ex.getMessage()); + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "删除任务信息失败!"); + } + } + return new CommonResult(taskID, SystemCode.HANDLER_SUCCESS.code, SystemCode.HANDLER_SUCCESS.des); + } + + @Override + public CommonResult getCameraListByTaskID(String taskID) { + List listfaceCamera = controlTaskMapper.getCameraByTaskID(taskID); + if (listfaceCamera != null) { + return new CommonResult(listfaceCamera, SystemCode.HANDLER_SUCCESS.code, SystemCode.HANDLER_SUCCESS.des); + } else { + return new CommonResult(null, SystemCode.HANDLER_FAILED.code, SystemCode.HANDLER_FAILED.des); + } + } + + @Override + public CommonResult getCameraListByTaskNO(String taskNO) { + List listfaceCamera = controlTaskMapper.getCameraByTaskNo(taskNO); + if (listfaceCamera != null) { + return new CommonResult(listfaceCamera, SystemCode.HANDLER_SUCCESS.code, SystemCode.HANDLER_SUCCESS.des); + } else { + return new CommonResult(null, SystemCode.HANDLER_FAILED.code, SystemCode.HANDLER_FAILED.des); + } + } + /** + * 停止订单信息 调用底层删除任务,本地库修改为停止状态 + * @param taskID + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult stopControlByTaskID(String taskID) { + ControlTask controlOne = this.getById(taskID); + if (controlOne == null) { + return new CommonResult(null, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "参数异常,非法的任务ID!"); + } else { + boolean isDeleteApi = false; + try{ + //1. 调用平台API接口 + Map resultMap = (Map) httpUtil.delete(link + ApiUrlEnum.TASK_POSTURL.getUrl() + "/" + controlOne.getTaskNo(), Map.class); + if (resultMap != null) { + if(ErrEnum.OK.getCode().toString().equalsIgnoreCase(resultMap.get("code").toString())) { + isDeleteApi=true; + } + } else { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API删除任务信息失败!"); + } + if (isDeleteApi) { + // 更新本地数据库的状态为N + controlOne.setIsValid(TaskStatusEnum.STOP.code); + this.updateById(controlOne); + } else { + return new CommonResult(taskID, SystemCode.DELETE_FAILED.code, "平台API删除任务信息失败"); + }} + catch (Exception ex){ + if(log.isErrorEnabled()){ + log.error("停止任务失败"); + } + return new CommonResult(taskID, SystemCode.DELETE_FAILED.code, "停止任务失败"); + } + } + return new CommonResult(taskID, SystemCode.HANDLER_SUCCESS.code, SystemCode.HANDLER_SUCCESS.des); + } + + /** + * 暂停任务 调用底层删除任务,本地库修改为暂停状态 + * @param taskID + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult suspendControlByTaskID(String taskID) { + + ControlTask controlOne = this.getById(taskID); + if (controlOne == null) { + return new CommonResult(null, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "参数异常,非法的任务ID!"); + } else { + boolean isDeleteApi = false; + try{ + //1. 调用平台API接口 + Map resultMap = (Map) httpUtil.delete(link + ApiUrlEnum.TASK_POSTURL.getUrl() + "/" + controlOne.getTaskNo(), Map.class); + if (resultMap != null) { + if(ErrEnum.OK.getCode().toString().equalsIgnoreCase(resultMap.get("code").toString())){ + isDeleteApi=true; + } + } else { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API删除任务信息失败!"); + } + if (isDeleteApi) { + // 更新本地数据库的状态为暂停 + controlOne.setIsValid(TaskStatusEnum.SUSPEND.code); + this.updateById(controlOne); + } else { + return new CommonResult(taskID, SystemCode.DELETE_FAILED.code, "平台API删除任务信息失败"); + }} + catch (Exception ex){ + return new CommonResult(taskID, SystemCode.DELETE_FAILED.code, ex.getMessage()); + } + } + return new CommonResult(taskID, SystemCode.HANDLER_SUCCESS.code, "暂停任务"+controlOne.getTaskName()+"成功"); + + } + + /** + * 恢复任务 调用底层新增任务,本地库修改为运行状态 + * @param taskID + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult resumeControlByTaskID(String taskID) { + //1. 构建任务对象 + ControlTask controlOne = this.getById(taskID); + if (controlOne == null) { + return new CommonResult(null, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "参数异常,非法的任务ID!"); + } else { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("id_control_task", taskID); + //根据任务ID获取摄像头中间库 + List listBayoneMid = controlBayonetMidService.list(queryWrapper); + //获取摄像头 + if (UtilValidate.isEmpty(listBayoneMid)) { + return new CommonResult(controlOne.getTaskName(), SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "恢复任务失败,该任务下没有查询到有效摄像头列表!"); + } + //根据任务ID获取人像中间库 + List listLibMid = controlLibraryMidService.list(queryWrapper); + //获取人像中间库 + if(UtilValidate.isEmpty(listLibMid)) + { + return new CommonResult(controlOne.getTaskName(), SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "恢复任务失败,该任务下没有查询到有效库列表!"); + } + //摄像头列表ID + List listcamera = new ArrayList<>(); + for (ControlBayonetMid cbm : listBayoneMid) { + listcamera.add(cbm.getIdFaceCamera().toString()); + } + //获取人像中间库ID + List listfacelib= new ArrayList<>(); + for (ControlLibraryMid clb : listLibMid) { + listfacelib.add(clb.getIdFactory().toString()); + } + + ControlTaskVO ctvo = new ControlTaskVO(); + ctvo.setName(controlOne.getTaskName()); + ctvo.setThreshold(controlOne.getControlThreshold()); + ctvo.setCameraId(listcamera); + ctvo.setLibraryId(listfacelib); + //恢复新建时把原来的NO重新发送过去 + ctvo.setTaskId(controlOne.getTaskNo()); + try { + //2. 发送任务到API层 + // 调用平台API接口 + String strTaskNo = "000000"; + Map resultMap = (Map) httpUtil.post(link + ApiUrlEnum.TASK_POSTURL.getUrl(), ctvo, Map.class); + if (resultMap != null) { + if(ErrEnum.OK.getCode().toString().equalsIgnoreCase(resultMap.get("code").toString())){ + Map data = (Map) resultMap.get("data"); + if (data != null && data.get("taskId") != null) { + strTaskNo = data.get("taskId").toString(); + } else { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API保存任务信息失败!"); + } + } else { + return new CommonResult(resultMap, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API保存任务信息失败!"); + } + } else { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API保存任务信息失败!"); + } + //3. 更新本地库任务的状态为RUN状态 + controlOne.setTaskNo(strTaskNo); + controlOne.setIsValid(TaskStatusEnum.RUN.code); + this.updateById(controlOne); + }catch (Exception ex){ + if(log.isErrorEnabled()){ + log.error("恢复任务异常{}:{}",controlOne.getTaskName(),ex.getMessage()); + } + } + } + return new CommonResult(taskID, SystemCode.HANDLER_SUCCESS.code, SystemCode.HANDLER_SUCCESS.des); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult addtaskfaceFile(MultipartFile multipartFile) { + FaceLibrary faceLibrary =new FaceLibrary(); + faceLibrary.setIsValid(YNEnums.YES.code); + faceLibrary.setRemarks("任务图片上传临时库"); + Random r= new Random(); + faceLibrary.setFactoryName("任务图片上传库"+r.nextInt()); + faceLibrary.setFactoryType("-1"); + faceLibrary.setCreateTime(new Date()); + faceLibrary.setUpdateTime(new Date()); + faceLibrary.setCreateBy("SYSTASK"); + faceLibrary.setUpdateBy("SYSTASK"); + + FaceLibrary faceLibrar = iFaceLibraryService.addLibrary(faceLibrary); + if(UtilValidate.isEmpty(faceLibrar)) + { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "生成特征库识别!"); + } + //2.添加人脸信息特征 + Portrait portrait; + try { + portrait = iPortraitService.addPortraitPng(faceLibrar.getIdFactory().toString(), multipartFile); + } catch (Exception e) { + log.error("上传人像异常"+e.getMessage()); + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, e.getMessage()); + } + Map result=new HashMap<>(); + result.put("libid",faceLibrar.getIdFactory().toString()); + result.put("url",portrait.getBackgroundUrl()); + return new CommonResult(result,SystemCode.HANDLER_SUCCESS.code,"人像文件上传成功!"); + } + + @Override + public CommonResult addtaskfaceFiles(String url) { + FaceLibrary faceLibrary =new FaceLibrary(); + faceLibrary.setIsValid(YNEnums.YES.code); + faceLibrary.setRemarks("任务图片上传临时库"); + Random r= new Random(); + faceLibrary.setFactoryName("任务图片上传库"+r.nextInt()); + faceLibrary.setFactoryType("-1"); + faceLibrary.setCreateTime(new Date()); + faceLibrary.setUpdateTime(new Date()); + faceLibrary.setCreateBy("SYSTASK"); + faceLibrary.setUpdateBy("SYSTASK"); + + FaceLibrary faceLibrar = iFaceLibraryService.addLibrary(faceLibrary); + if(UtilValidate.isEmpty(faceLibrar)) + { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "生成特征库识别!"); + } + //2.添加人脸信息特征 + Portrait portrait; + try { + portrait = iPortraitService.addPortraitPngs(faceLibrar.getIdFactory().toString(), url); + } catch (Exception e) { + log.error("上传人像异常"+e.getMessage()); + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, e.getMessage()); + } + Map result=new HashMap<>(); + result.put("libid",faceLibrar.getIdFactory().toString()); + result.put("url",portrait.getBackgroundUrl()); + return new CommonResult(result,SystemCode.HANDLER_SUCCESS.code,"人像文件上传成功!"); + } + + @Override + public CommonResult addcomplevideoFile(MultipartFile multipartFile) { + try { + Pattern p = Pattern.compile(videoreg); + boolean boo = p.matcher(multipartFile.getOriginalFilename()).find(); + if (!boo){ + return new CommonResult( null,SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "上传文件必须是视频文件!"); + } + String suffix = multipartFile.getOriginalFilename().substring(multipartFile.getOriginalFilename().lastIndexOf(".")); + String newname= UUID.randomUUID().toString().replace("-","").toLowerCase(); + JSONObject map = minioUtil.uploadFile(multipartFile.getInputStream(),newname, suffix); + return new CommonResult(map, SystemCode.HANDLER_SUCCESS.code,SystemCode.HANDLER_SUCCESS.code.toString() ); + }catch (Exception ex){ + log.error("比对视频文件上传异常:{}",ex.getMessage()); + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, ex.getMessage()); + } + } + + @Override + @Transactional + public CommonResult addcomplevideoTask(VideoControlVo controlVO) { + try { + + List listbibray = new ArrayList<>(); + List listbibraybyUse = new ArrayList<>(); + List listlibs = controlVO.getLibIds(); + for (String libid : listlibs) { + if (controlLibraryMidMapper.selectexistByLibID(libid, YNEnums.YES.code) > 0) { + ControlLibraryMid clm = new ControlLibraryMid(); + clm.setIdFactory(Long.parseLong(libid.toString())); + clm.setIsValid(YNEnums.YES.code); + listbibray.add(clm); + } else { + listbibraybyUse.add(libid); + } + } + if (!UtilValidate.isEmpty(listbibraybyUse)) { + return new CommonResult(listbibraybyUse, SystemCode.ILLEGAL_ARGUMENT_EXCEPTION.code, "该任务存在无效库!"); + } + // 调用平台API接口 + ControlTaskVedioVO ctvo = new ControlTaskVedioVO(); + //任务名称 + String strTaskNo = "00000000"; + ctvo.setName("视频比对任务"); + ctvo.setThreshold(controlVO.getControlThreshold()); + ctvo.setUrl(controlVO.getVideourl()); + ctvo.setLibraryId(controlVO.getLibIds()); + + + Map resultMap = ( Map) httpUtil.post(link+ApiUrlEnum.TASK_VEDIO_POSTURL.getUrl(), ctvo, Map.class); + if(resultMap!=null){ + if(ErrEnum.OK.getCode().toString().equalsIgnoreCase(resultMap.get("code").toString())) + { + Map data= (Map) resultMap.get("data"); + if(data!=null&&data.get("taskId")!=null){ + strTaskNo=data.get("taskId").toString(); + }else + { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API保存视频比对任务信息失败!未获取到任务ID"); + } + }else { + return new CommonResult(resultMap, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API保存视频比对任务信息失败!未获取OK表示"); + } + }else { + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "远程API保存视频比对任务信息失败!Map返回未空"); + } + + ControlTask controlTask = new ControlTask(); + controlTask.setTaskNo(strTaskNo); + BeanUtils.copyProperties(controlVO, controlTask); + controlTask.setIsValid(TaskStatusEnum.RUN.code); + controlTask.setViedourl(controlVO.getVideourl()); + controlTask.setDisposalType("-1"); //视频对比 + controlTask.setControlType("0"); + controlTask.setControlObject("0"); + //保存任务 + if (this.save(controlTask)) { + + for (ControlLibraryMid clm : listbibray) { + //设置任务编号 + clm.setIdControlTask(controlTask.getIdControlTask()); + } + //批量 保存库ID列表 + controlLibraryMidService.saveBatch(listbibray); + return new CommonResult(controlTask.getTaskNo(), SystemCode.HANDLER_SUCCESS.code, SystemCode.HANDLER_SUCCESS.des); + } else { + log.error("任务保存:{}", controlTask.getTaskNo()); + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "保存任务信息失败!"); + } + + } catch (Exception ex) { + log.error("保存任务异常:{}", ex.getMessage()); + return new CommonResult(null, SystemCode.INTERNAL_PROGRAM_ERROR.code, "保存任务信息失败!"+ex.getMessage()); + } + + } + + /** + * 根据任务的区域码表字符串获取区域名称 + * @param regionstr + * @return + */ + @Override + public String getCameraRegionStringByRegionstr(String regionstr) { + + Iterable splits = Splitter.on(",").trimResults().omitEmptyStrings().split(regionstr); + List listregion=new ArrayList<>(); + splits.forEach(region -> listregion.add(Long.parseLong(region))); + if(listregion!=null&&listregion.size()>0){ + List regionnames=controlTaskMapper.getCameraRegionByReginlist(listregion); + return Joiner.on("/").skipNulls().join(regionnames); + } + else{ + return ""; + } + } + + /** + * 根据摄像头列表获取区域的的字符串名称 + * @param cameraRegion + * @return + */ + public String getCameraRegionStringByCameraList(HashMap cameraRegion){ + + if(cameraRegion!=null&&cameraRegion.size()>0) { + List cameralist = new ArrayList<>(); + for (Map.Entry mentry : + cameraRegion.entrySet()) { + cameralist.add(mentry.getKey()); + } + if (cameralist != null && cameralist.size() > 0 && cameralist.size() == 1) { + return getCameraRegionStringByRegionstr(cameralist.get(0)); + } else { + + List list = new ArrayList<>(); + for (String str : cameralist) { + String[] splitarray = str.split(","); + list.add(splitarray); + } + Collections.sort(list, new Comparator() { + @Override + public int compare(String[] o1, String[] o2) { + if (o1.length > o2.length) { + return 1; + } else { + if (o1.length < o2.length) { + { + return -1; + } + } else { + return 0; + } + } + } + }); + + StringBuilder sb = new StringBuilder(); + String[] str = list.get(0); + int count = 0; + for (String[] stra : list) { + if (stra.length == str.length) { + count++; + } + } + if (count >= 2) { + for (int i = 0; i < str.length - 1; i++) { + sb.append(str[i]+","); + } + } else { + for (int i = 0; i < str.length; i++) { + sb.append(str[i]+","); + } + } + return getCameraRegionStringByRegionstr(sb.toString()); + } + } + return ""; + } + + + @Override + public String getLibRegionBytaskid(String taskID) { + + List libsnames=controlTaskMapper.getLibRegionBytaskid(taskID); + if(libsnames!=null){ + return Joiner.on(",").skipNulls().join(libsnames);} + else + {return "";} + + } + + @Override + public ControlTask getTaskInfoByCameraID(String Camera) { + List taskList=controlTaskMapper.getTaskInfoByCameraID(Camera); + if(UtilValidate.isEmpty(taskList) || taskList.size()<=0) + { + return null; + } + return taskList.get(0); + } +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/FaceCameraServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/FaceCameraServiceImpl.java new file mode 100644 index 0000000..3a6e594 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/FaceCameraServiceImpl.java @@ -0,0 +1,478 @@ +package com.dkha.server.services.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dkha.common.enums.ApiUrlEnum; +import com.dkha.common.enums.ErrEnum; +import com.dkha.common.enums.YNEnums; +import com.dkha.common.exception.DkException; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.ApiVO; +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.common.page.PageParam; +import com.dkha.common.util.UtilValidate; +import com.dkha.common.util.excel.ImportExcel; +import com.dkha.server.mappers.FaceCameraDao; +import com.dkha.server.modules.entities.FaceCameraEntity; +import com.dkha.server.modules.entities.faceCamera.FaceCameraExcel; +import com.dkha.server.modules.entities.faceCamera.FaceCameraInfo; +import com.dkha.server.modules.entities.faceCamera.FaceCameraList; +import com.dkha.server.modules.entities.faceCamera.InsertFaceCamera; +import com.dkha.server.services.FaceCameraService; +import com.dkha.server.services.IControlBayonetMidService; +import com.dkha.server.system.modules.sys.dao.SysDictDataDao; +import com.dkha.server.system.modules.sys.dao.SysRegionDao; +import com.dkha.server.system.modules.sys.entity.SysDictDataEntity; +import com.dkha.server.system.modules.sys.entity.SysRegionEntity; +import com.dkha.server.system.modules.sys.enums.RegionTopEnum; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.*; + +/** + * 摄像头表 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2019-12-08 + */ +@Service +public class FaceCameraServiceImpl extends ServiceImpl implements FaceCameraService { + + @Resource + private FaceCameraDao faceCameraDaol; + + @Resource + private HttpUtil httpUtil; + + @Resource + private SysRegionDao sysRegionDao; + @Resource + private SysDictDataDao sysDictDataDao; + @Value("${api.server.prefix}") + private String link; + + @Override + public Page getPage(PageParam pageParam) { + Page page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize()); + //设置模糊查询参数 + Map paramsNote = pageParam.paramsToLike(pageParam.getNote(), "cameraName"); + //分页查询 + List cameraRegion = new ArrayList<>(); + //查询当前区域下的所有摄像头 + if (pageParam.getNote().get("cameraRegion") != null && !"".equals(pageParam.getNote().get("cameraRegion").trim())) { + List> region = sysRegionDao.getRegion1(Long.parseLong(pageParam.getNote().get("cameraRegion"))); + for (Map map : region) { + recursionGetRegion(map); + } + for (Map map : region) { + test(cameraRegion, map); + } + cameraRegion.add(Long.parseLong(pageParam.getNote().get("cameraRegion"))); + } + List faceCameraLists = faceCameraDaol.getList(page, paramsNote, cameraRegion); + + page.setRecords(faceCameraLists); + return page; + } + + @Override + public List getAll(String cameraName) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("is_valid", YNEnums.YES.code); + queryWrapper.like(UtilValidate.isNotEmpty(cameraName), "camera_name", cameraName); + List all = this.list(queryWrapper); + return all; + } + + /** + * 获取当前区域下的所有子区域id + * + * @param cameraRegion + * @param map + */ + public void test(List cameraRegion, Map map) { + if (map.get("children") != null) { + List> children = (List>) map.get("children"); + for (Map map1 : children) { + test(cameraRegion, map1); + } + } + cameraRegion.add((Long) map.get("value")); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public Integer insertCamera(InsertFaceCamera insertFaceCamera) { + if (insertFaceCamera == null) { + throw new DkException("参数为空"); + } + //校验经纬度是否重复 + FaceCameraEntity faceCameraInfo = this.findByCoordinate(insertFaceCamera.getCameraLongitude(), insertFaceCamera.getCameraLatitude()); + if (UtilValidate.isNotEmpty(faceCameraInfo)) { + throw new DkException("摄像头经纬度坐标重复"); + } + //摄像头名称,ip,rtsp地址重复性校验 + FaceCameraEntity nameEntity = baseMapper.selectOne(new QueryWrapper().eq("camera_name", insertFaceCamera.getCameraName().trim()).eq("is_valid", YNEnums.YES.code)); + FaceCameraEntity ipEntity = baseMapper.selectOne(new QueryWrapper().eq("ip", insertFaceCamera.getIp().trim()).eq("is_valid", YNEnums.YES.code)); + FaceCameraEntity rtspUrlEntity = baseMapper.selectOne(new QueryWrapper().eq("rtsp_url", insertFaceCamera.getRtspUrl().trim()).eq("is_valid", YNEnums.YES.code)); + //版本码表关联 + SysDictDataEntity brand = sysDictDataDao.selectById(insertFaceCamera.getIdBrand()); + + if (UtilValidate.isEmpty(brand)) { + throw new DkException("摄像头型号不能为空"); + } + insertFaceCamera.setBrand(brand.getDictLabel()); + + if (nameEntity != null) { + throw new DkException("摄像头名称不能重复"); + } + if (ipEntity != null) { + throw new DkException("摄像头ip不能重复"); + } + if (rtspUrlEntity != null) { + throw new DkException("摄像头rtsp地址不能重复"); + } + Map map = new HashMap(); + map.put("name", insertFaceCamera.getCameraName()); + map.put("url", insertFaceCamera.getRtspUrl()); + ApiVO result = httpUtil.post(link + ApiUrlEnum.CAMERA.getUrl(), map, ApiVO.class); + if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) { + throw new DkException("新增摄像头失败"); + } + FaceCameraEntity faceCameraEntity = new FaceCameraEntity(); + BeanUtils.copyProperties(insertFaceCamera, faceCameraEntity); + faceCameraEntity.setStatus(YNEnums.NO.code); + JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(result.getData())); + faceCameraEntity.setIdFaceCamera(Long.parseLong(jsonObject.getString("carmeraId"))); + String[] regions = faceCameraEntity.getCameraRegionFirstlevel().split(","); + faceCameraEntity.setCameraRegion(regions[regions.length - 1]); + faceCameraEntity.setCameraRegionFirstlevelBackUp(""); + //翻译摄像头区域层级冗余字段 + for (String region : regions) { + SysRegionEntity sysRegionEntity = sysRegionDao.getById(Long.parseLong(region)); + faceCameraEntity.setCameraRegionFirstlevelBackUp(faceCameraEntity.getCameraRegionFirstlevelBackUp() + sysRegionEntity.getName()); + } +// //TODO 摄像头位置类型码值翻译 +// SysDictDataEntity sysDictDataEntity = sysDictDataDao.selectById(faceCameraEntity.getCameratLocationtypeId()); +// faceCameraEntity.setCameratLocationtypeIdBackUp(sysDictDataEntity.getDictLabel()); + + return baseMapper.insert(faceCameraEntity); + } + + @Override + public FaceCameraInfo findById(long idCamera) { + FaceCameraEntity faceCameraEntity = baseMapper.selectById(idCamera); + FaceCameraInfo faceCameraInfo = new FaceCameraInfo(); + if(faceCameraEntity != null){ + BeanUtils.copyProperties(faceCameraEntity, faceCameraInfo); + } + return faceCameraInfo; + + } + + @Override + public List> getAllCameraByRegionId(long regionId) { + + List cameraRegion = new ArrayList<>(); + List> region = sysRegionDao.getRegion1(regionId); + for (Map map : region) { + recursionGetRegion(map); + } + for (Map map : region) { + test(cameraRegion, map); + } + cameraRegion.add(regionId); + + + return baseMapper.getAllCameraByRegionId(cameraRegion); + } + + @Override + public List> getCameraByRegionId(long regionId) { + List> result = baseMapper.getCameraByRegionId(regionId); +// return ConvertUtils.sourceToTarget(baseMapper.selectList(new QueryWrapper() +// .eq("is_valid", YNEnums.YES.code) +// .eq("camera_region", regionId)), FaceCameraInfo.class); + return result; + } + + @Override + public List> getRegionUnControlCamera(long regionId) { + + return baseMapper.getRegionUnControlCamera(regionId); + } + + @Override + public List> getRegion(Long pid) { + /** + * 获取所有第一级摄像头区域 + */ + List> region = sysRegionDao.getRegion1(pid); + //遍历获取所有子级摄像头区域 + for (Map map : region) { + recursionGetRegion(map); + } + return region; + } + + @Override + public List> getBayonet(Long pid) { + List> result = new LinkedList<>(); + + //获取当前id下的区域 + List> region = sysRegionDao.getRegion(pid); + //获取当期区域下的所有有布控任务的摄像头 + List> camera = baseMapper.findByRegion(String.valueOf(pid)); + result.addAll(region); + result.addAll(camera); + List> copyRegion = new ArrayList<>(); + copyRegion.addAll(region); + for (int i = 0; i < copyRegion.size(); i++) { + int count = baseMapper.isCameraInRegion("%" + (Long) copyRegion.get(i).get("id") + "%"); + if (count < 1) { + region.remove(copyRegion.get(i)); + continue; + } + if (copyRegion.get(i).get("type") != null && ((String) copyRegion.get(i).get("type")).endsWith("region")) { + region.get(region.indexOf(copyRegion.get(i))).put("label", region.get(region.indexOf(copyRegion.get(i))).get("label") + "(区域)"); + } + recursionGetBayonet(region.get(i)); + } + for (Map map : camera) { + if (map.get("type") != null && ((String) map.get("type")).endsWith("camera")) { + map.put("label", map.get("label") + "(摄像头)"); + } + } + + return result; + } + + /** + * 递归获取所有摄像头区域 + * + * @param resoure + */ + public void recursionGetRegion(Map resoure) { + long id = resoure.get("value") == null ? RegionTopEnum.FATHER.value() : (Long) resoure.get("value"); + + List> region = sysRegionDao.getRegion1(id); + if (region != null && region.size() != 0) { + for (Map map : region) { + recursionGetRegion(map); + } + resoure.put("children", region); + } + } + + /** + * 递归 获取摄像头区域 + * + * @param resoure + */ + public void recursionGetBayonet(Map resoure) { + long id = resoure.get("id") == null ? RegionTopEnum.FATHER.value() : (Long) resoure.get("id"); + + List> result = new LinkedList<>(); + List> region = sysRegionDao.getRegion(id); + List> copyRegion = new ArrayList<>(); + copyRegion.addAll(region); + List> camera = baseMapper.findByRegion(String.valueOf(id)); + if (region != null && region.size() != 0) { + + for (int i = 0; i < copyRegion.size(); i++) { + int count = baseMapper.isCameraInRegion("%" + (Long) copyRegion.get(i).get("id") + "%"); + if (count < 1) { + region.remove(copyRegion.get(i)); + continue; + } + if (copyRegion.get(i).get("type") != null && ((String) copyRegion.get(i).get("type")).endsWith("region")) { + region.get(region.indexOf(copyRegion.get(i))).put("label", region.get(region.indexOf(copyRegion.get(i))).get("label") + "(区域)"); + } + recursionGetBayonet(copyRegion.get(i)); + } + } + for (Map map : camera) { + if (map.get("type") != null && ((String) map.get("type")).endsWith("camera")) { + map.put("label", map.get("label") + "(摄像头)"); + } + } + result.addAll(region); + result.addAll(camera); + resoure.put("children", result); + + } + + @Transactional(rollbackFor = Exception.class) + @Override + public Integer update(FaceCameraInfo faceCameraInfo) { + FaceCameraEntity faceCameraEntity = baseMapper.selectById(faceCameraInfo.getIdFaceCamera()); + if (faceCameraEntity == null) { + throw new DkException("无此摄像头"); + } + FaceCameraEntity old = this.findByCoordinate(faceCameraInfo.getCameraLongitude(), faceCameraInfo.getCameraLatitude()); + if (UtilValidate.isNotEmpty(old) && !faceCameraEntity.getIdFaceCamera().equals(old.getIdFaceCamera())) { + throw new DkException("摄像头经纬度坐标重复"); + } + FaceCameraEntity nameEntity = baseMapper.selectOne(new QueryWrapper().eq("camera_name", faceCameraInfo.getCameraName().trim()).eq("is_valid", YNEnums.YES.code)); + FaceCameraEntity ipEntity = baseMapper.selectOne(new QueryWrapper().eq("ip", faceCameraInfo.getIp().trim()).eq("is_valid", YNEnums.YES.code)); + FaceCameraEntity rtspUrlEntity = baseMapper.selectOne(new QueryWrapper().eq("rtsp_url", faceCameraInfo.getRtspUrl().trim()).eq("is_valid", YNEnums.YES.code)); + //摄像头名称,ip,rtsp地址重复性校验 + if (nameEntity != null && !nameEntity.getIdFaceCamera().equals(faceCameraInfo.getIdFaceCamera())) { + throw new DkException("摄像头名称不能重复"); + } + if (ipEntity != null && !ipEntity.getIdFaceCamera().equals(faceCameraInfo.getIdFaceCamera())) { + throw new DkException("摄像头ip不能重复"); + } + if (rtspUrlEntity != null && !rtspUrlEntity.getIdFaceCamera().equals(faceCameraInfo.getIdFaceCamera())) { + throw new DkException("摄像头rtsp地址不能重复"); + } + //版本码表关联 + SysDictDataEntity brand = sysDictDataDao.selectById(faceCameraInfo.getIdBrand()); + if (UtilValidate.isNotEmpty(brand)) { + faceCameraEntity.setIdBrand(brand.getDictTypeId().toString()); + faceCameraEntity.setBrand(brand.getDictLabel()); + } else { + throw new DkException("摄像头品牌不能为空"); + } + Map map = new HashMap(0); + //判断是否修改了名称,rtsp + if (!faceCameraEntity.getCameraName().equals(faceCameraInfo.getCameraName()) || + !faceCameraEntity.getRtspUrl().equals(faceCameraInfo.getRtspUrl())) { + map.put("name", faceCameraInfo.getCameraName()); + map.put("url", faceCameraInfo.getRtspUrl()); + map.put("carmeraId", faceCameraInfo.getIdFaceCamera()); + ApiVO result = httpUtil.put(link + ApiUrlEnum.CAMERA.getUrl(), map, ApiVO.class); + if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) { + throw new DkException("修改摄像头失败"); + } + } + BeanUtils.copyProperties(faceCameraInfo, faceCameraEntity); + //摄像头区域类型修改 + faceCameraEntity.setCameraRegionFirstlevel(null); + faceCameraEntity.setCameraRegionFirstlevelBackUp(""); + String[] regionFirstlevelArrays = faceCameraInfo.getCameraRegionFirstlevelArrays(); + faceCameraEntity.setCameraRegion(String.valueOf(regionFirstlevelArrays[regionFirstlevelArrays.length - 1])); + for (String regionId : regionFirstlevelArrays) { + SysRegionEntity sysRegionEntity = sysRegionDao.getById(Long.parseLong(regionId)); + faceCameraEntity.setCameraRegionFirstlevelBackUp(faceCameraEntity.getCameraRegionFirstlevelBackUp() + sysRegionEntity.getName()); + } + faceCameraEntity.setCameraRegionFirstlevel(StringUtils.join(regionFirstlevelArrays, ',')); +// //摄像头位置类型修改 +// SysDictDataEntity sysDictDataEntity = sysDictDataDao.selectById(faceCameraInfo.getCameratLocationtypeId()); +// faceCameraEntity.setCameratLocationtypeIdBackUp(sysDictDataEntity.getDictLabel()); + //TODO 摄像头位置类型码值翻译 + + return baseMapper.updateById(faceCameraEntity); + } + + @Autowired + private IControlBayonetMidService iControlBayonetMidService; + + @Transactional(rollbackFor = Exception.class) + @Override + public List findCameraByTask() { + return iControlBayonetMidService.selectFaceCameraBytask(); + } + + + @Transactional + @Override + public Integer delete(long camera) { + FaceCameraEntity entity = baseMapper.selectById(camera); + if (entity == null) { + throw new DkException("无此摄像头"); + } + + //验证摄像头是否已经布控了任务 + + Long res = iControlBayonetMidService.selectexistByCarmeID(String.valueOf(camera)); + if (res.intValue() > 0) { + throw new DkException("删除摄像头失败,当前摄像头存在布控任务"); + } + + + ApiVO result = httpUtil.delete(link + ApiUrlEnum.CAMERA.getUrl() + "/" + camera, ApiVO.class); + if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) { + throw new DkException("删除摄像头失败"); + } + entity.setIsValid(YNEnums.NO.code); + return baseMapper.updateById(entity); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public Integer status(long camera, boolean status) { + FaceCameraEntity entity = baseMapper.selectById(camera); + if (status) { + entity.setStatus(YNEnums.YES.code); + } else { + entity.setStatus(YNEnums.NO.code); + } + return baseMapper.updateById(entity); + } + + @Override + public List importExcel(MultipartFile multipartFile) { + List errorList = new ArrayList<>(0); + try { + ImportExcel ei = new ImportExcel(multipartFile, 1, 0); + List cameraExcels = ei.getDataList(FaceCameraExcel.class); + + for (FaceCameraExcel faceCameraExcel : cameraExcels) { + //TODO 数据校验空 + if (checkNull(errorList, faceCameraExcel)) { + continue; + } + //码表关联查询 + + } + } catch (InvalidFormatException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + + return errorList; + } + + private boolean checkNull(List error, FaceCameraExcel faceCameraExcel) { + //空值校验 + if (UtilValidate.isEmpty(faceCameraExcel.getIp())) { + faceCameraExcel.setMessage("ip地址不能为空"); + error.add(faceCameraExcel); + return true; + } + + return false; + } + + @Override + public FaceCameraEntity findByCoordinate(String cameraLongitude, String cameraLatitude) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq(FaceCameraEntity.CAMERA_LONGITUDE, cameraLongitude); + queryWrapper.eq(FaceCameraEntity.CAMERA_LATITUDE, cameraLatitude); + FaceCameraEntity faceCameraEntity = baseMapper.selectOne(queryWrapper); + return faceCameraEntity; + } + + @Override + public CameraInfoVO selectFaceCameraID(String idFaceCamera) { + return baseMapper.selectFaceCameraID(idFaceCamera); + } +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/FaceLibraryServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/FaceLibraryServiceImpl.java new file mode 100644 index 0000000..71085db --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/FaceLibraryServiceImpl.java @@ -0,0 +1,179 @@ +package com.dkha.server.services.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.enums.ApiUrlEnum; +import com.dkha.common.enums.YNEnums; +import com.dkha.common.exception.DkException; +import com.dkha.common.fileupload.MinioUtil; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.ApiVO; +import com.dkha.common.modules.vo.dto.FaceLibraryVO; +import com.dkha.common.page.PageParam; +import com.dkha.common.redis.RedisUtils; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.mappers.ControlLibraryMidMapper; +import com.dkha.server.mappers.PortraitMapper; +import com.dkha.server.modules.entities.FaceLibrary; +import com.dkha.server.mappers.FaceLibraryMapper; +import com.dkha.server.modules.entities.Portrait; +import com.dkha.server.services.IFaceLibraryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.gson.Gson; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + *

+ * 库表 服务实现类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Service +public class FaceLibraryServiceImpl extends ServiceImpl implements IFaceLibraryService { + /**库mapper*/ + @Resource + private FaceLibraryMapper faceLibraryMapper; + @Resource + private ControlLibraryMidMapper controlLibraryMidMapper; + @Resource + private PortraitMapper portraitMapper; + + @Value("${api.server.prefix}") + private String link; + @Resource + private HttpUtil httpUtil; + @Autowired + private Gson gson; + @Autowired + private MinioUtil minioUtil; + @Autowired + private RedisUtils redisUtils; + @Value("${api.server.prefix}") + private String apiRequestPrefix; + @Value("${minio.bucketName}") + private String bucketName; + + @Override + @Transactional(rollbackFor = Exception.class) + public FaceLibrary addLibrary(FaceLibrary faceLibrary) { + try { + FaceLibraryVO faceLibraryVO = new FaceLibraryVO(); + faceLibraryVO.setName(faceLibrary.getFactoryName()); + if(UtilValidate.isNotEmpty(faceLibrary.getFactoryType())) { + faceLibraryVO.setType(faceLibrary.getFactoryType()); + } + ApiVO faceLibrary1 = (ApiVO) httpUtil.post(link+ ApiUrlEnum.FACELIB_POSTURL.getUrl(), faceLibraryVO, ApiVO.class); + /**调用API*/ + String json = gson.toJson(faceLibrary1.getData()); + FaceLibraryVO face = gson.fromJson(json, FaceLibraryVO.class); + faceLibrary.setIdFactory(Long.parseLong(face.getLibraryId())); + int insert = faceLibraryMapper.insert(faceLibrary); + if(insert<0){ + throw new DkException("新增库失败"); + } + }catch (Exception e){ + throw new DkException("新增库失败"+e.getMessage()); + } + return faceLibrary; + } + + @Override + public FaceLibrary deleteLibrary(Long libraryId) { + FaceLibrary faceLibrary = new FaceLibrary(); + faceLibrary.setIsValid(YNEnums.NO.code); + faceLibrary.setIdFactory(libraryId); + try { + + ApiVO faceLibrary1 = (ApiVO) httpUtil.delete(link+ ApiUrlEnum.FACELIB_POSTURL.getUrl()+"/"+String.valueOf(libraryId), ApiVO.class); + }catch (Exception e){ + throw new DkException("删除库失败"); + } + /**调用API*/ + Integer integer = controlLibraryMidMapper.selectByLibID(String.valueOf(libraryId), YNEnums.YES.code); + if(integer<=0) { + int count = faceLibraryMapper.deleteById(faceLibrary); + /**删除对应的人像*/ + List portraits = portraitMapper.queryPortraitByFactory(libraryId); + portraitMapper.deletePortrait(libraryId); + if(UtilValidate.isNotEmpty(portraits)){ + for (Portrait p:portraits) { + /**删除文件服务器*/ + try { + minioUtil.removeObject(bucketName,p.getUrl()); + } catch (Exception e) { + log.error(e.getMessage()); + //throw new DkException("文件服务器图片删除失败"); + } + } + } + if (count < 0) { + throw new DkException("删除库失败"); + } + }else{ + throw new DkException(SystemCode.DELETELIB_ERROR.code,"该库有关联的布控信息,不能删除!"); + } + + return faceLibrary; + } + + @Override + public FaceLibrary updateLibrary(FaceLibrary faceLibrary) { + try { + int count = faceLibraryMapper.updateById(faceLibrary); + FaceLibraryVO faceLibraryVO = new FaceLibraryVO(); + faceLibraryVO.setName(faceLibrary.getFactoryName()); + faceLibraryVO.setLibraryId(String.valueOf(faceLibrary.getIdFactory())); + ApiVO face = (ApiVO) httpUtil.put(link+ ApiUrlEnum.FACELIB_POSTURL.getUrl(),faceLibraryVO, ApiVO.class); + if(!face.getMessage().equals("成功")) { + throw new DkException("wy修改库失败"); + } + }catch (Exception e){ + log.error(e.getMessage()); + throw new DkException("修改库失败"); + } + return faceLibrary; + } + + @Override + public Page queryLibrary(PageParam pageParam) { + /**创建page对象*/ + Page page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize()); + /**设置模糊查询参数*/ + Map paramsNote = pageParam.getNote(); + + /**分页查询*/ + List postList = faceLibraryMapper.getLibraryPage(page, paramsNote.get("factoryName")); + if(UtilValidate.isNotEmpty(postList)){ + for (FaceLibrary p: postList) { + Integer libraryCount = faceLibraryMapper.getLibraryCount(p.getIdFactory()); + if(libraryCount>0) { + p.setNumber(String.valueOf(libraryCount)); + }else{ + p.setNumber("0"); + } + } + + } + page.setRecords(postList); + return page; + } + + @Override + public List findFaceLibraries() { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("is_valid", YNEnums.YES.code); + queryWrapper.orderByDesc("create_time"); + return baseMapper.selectList(queryWrapper); + } + +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/FaceTrackServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/FaceTrackServiceImpl.java new file mode 100644 index 0000000..dd8089b --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/FaceTrackServiceImpl.java @@ -0,0 +1,93 @@ +package com.dkha.server.services.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dkha.common.exception.DkException; + +import com.dkha.common.modules.vo.face.FaceTrackVO; +import com.dkha.server.mappers.FaceTrackMapper; +import com.dkha.server.modules.entities.FaceTrackEntity; +import com.dkha.server.services.FaceTrackService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +@Service +public class FaceTrackServiceImpl extends ServiceImpl implements FaceTrackService { + + @Resource + private FaceTrackMapper faceTrackMapper; + @Override + public int addFaceTrackEntity(FaceTrackEntity faceTrackEntity) { + int count; + try{ + count = faceTrackMapper.insert(faceTrackEntity); + }catch (Exception e){ + throw new DkException("新增失败"); + } + return count; + } + + /** + *根据摄像头和分组时间查询 + * @param idFaceCamera + * @param packetTime + * @return + */ + @Override + public List querByidCameraAndTime(Long idFaceCamera, String packetTime) { + return faceTrackMapper.querByidCameraAndTime(idFaceCamera,packetTime); + } + + /** + *根据摄像头Id和开始,结束时间,人脸ID + * @param faceTrackVO + * @return + */ + @Override + public List queryByidCamerAndFaceId(FaceTrackVO faceTrackVO) { + return faceTrackMapper.queryByidCamerAndFaceId(faceTrackVO); + } + + /** + *根据图片路径和开始,结束时间 + * @param faceTrackVO + * @return + */ + @Override + public List queryByurlAndTime(FaceTrackVO faceTrackVO) { + return faceTrackMapper.queryByurlAndTime(faceTrackVO); + } + + @Override + public List findIdFatoryByTime(FaceTrackVO faceTrackVO) { + return faceTrackMapper.findIdFatoryByTime(faceTrackVO); + } + + /** + *根据图片路径和开始,结束时间和阈值 + * @param faceTrackVO + * @return + */ + @Override + public List queryBytrajectoryThreshold(FaceTrackVO faceTrackVO) { + return faceTrackMapper.queryBytrajectoryThreshold(faceTrackVO); + } + + @Override + public List findTrackByFaceId(List faceIds) { + return faceTrackMapper.findTrackByFaceId(faceIds); + } + + @Override + public FaceTrackEntity queryByIdPortrait(String idPortrait) { + return faceTrackMapper.queryByIdPortrait(idPortrait); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/services/impl/FileServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/FileServiceImpl.java new file mode 100644 index 0000000..ae2f160 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/FileServiceImpl.java @@ -0,0 +1,191 @@ +package com.dkha.server.services.impl; + +import com.alibaba.fastjson.JSONObject; +import com.dkha.common.enums.ApiUrlEnum; +import com.dkha.common.exception.DkException; +import com.dkha.common.fileupload.MinioUtil; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.ReturnVO; +import com.dkha.common.modules.vo.cut.CutVo; +import com.dkha.common.modules.vo.face.ApiSearchFaceRectVO; +import com.dkha.common.modules.vo.position.PositionVO; +import com.dkha.common.modules.vo.upload.ImageUploadResult; +import com.dkha.common.util.Base64ImageUtils; +import com.dkha.common.util.IntUUID; +import com.dkha.common.util.JsonUtil; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.services.IFileService; +import com.fasterxml.jackson.core.type.TypeReference; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.web.multipart.MultipartFile; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.net.URL; +import java.util.*; +import java.util.regex.Pattern; + +/** + * @Author Spring + * @Since 2019/12/11 15:41 + * @Description 文件上传相关 + */ +@Component +@Slf4j +public class FileServiceImpl implements IFileService { + + @Value("${api.server.prefix}") + private String apiRequestPrefix; + @Autowired + private HttpUtil httpUtil; + @Autowired + private MinioUtil minioUtil; + @Value("${api.picture.type}") + private String apiPictureType; + + @Override + public ImageUploadResult uploadMultiFaceImages(MultipartFile[] multipartFiles) throws Exception { + if (UtilValidate.isEmpty(multipartFiles)) { + throw new DkException("请上传图片"); + } + List imageUrlList = new ArrayList<>(); + for (MultipartFile file : multipartFiles) { + JSONObject map = minioUtil.uploadFile(file.getInputStream(), this.generateFileName(file.getOriginalFilename()), null); + if (UtilValidate.isNotEmpty(map) && map.get("flag").equals("0")) { + imageUrlList.add(map.get("url").toString()); + } else { + throw new DkException("文件上传异常"); + } + } + return this.validateMultiFaceImages(imageUrlList); + } + + @Override + public ImageUploadResult uploadSingleFaceImage(MultipartFile[] multipartFiles) throws Exception { + if (UtilValidate.isEmpty(multipartFiles)) { + throw new DkException("请上传图片"); + } + if (multipartFiles.length > 1) { + throw new DkException("只能上传单张图片"); + } + + List imageUrlList = new ArrayList<>(); + for (MultipartFile file : multipartFiles) { + //获取文件后缀 + JSONObject map = minioUtil.uploadFile(file.getInputStream(), this.generateFileName(file.getOriginalFilename()) , null); + if (UtilValidate.isNotEmpty(map) && map.get("flag").equals("0")) { + imageUrlList.add(map.get("url").toString()); + } else { + throw new DkException("文件上传异常"); + } + } + this.validateSingleFaceImage(imageUrlList); + ImageUploadResult imageUploadResult = new ImageUploadResult(); + imageUploadResult.setSuccessFiles(imageUrlList.size()); + imageUploadResult.setSuccessFileUrlList(imageUrlList); + return imageUploadResult; + } + + @Override + public String cutPicture(CutVo cutVo) throws Exception { + PositionVO positionVO = new PositionVO(); + positionVO.setH(cutVo.getH()); + positionVO.setW(cutVo.getW()); + positionVO.setX(cutVo.getX()); + positionVO.setY(cutVo.getY()); + BufferedImage bufferedImage = ImageIO.read(new URL(cutVo.getUrl())); +// positionVO = Base64ImageUtils.deelPostion(positionVO, bufferedImage.getWidth(), bufferedImage.getHeight()); + InputStream inputStream = Base64ImageUtils.encodeHeadImage(bufferedImage, positionVO); + String fileName = this.generateFileName(cutVo.getUrl()); + JSONObject map = minioUtil.uploadFile(inputStream, fileName, null); + if (UtilValidate.isNotEmpty(map) && map.get("flag").equals("0")) { + return map.get("url").toString(); + } + throw new DkException("文件上传异常"); + } + + /** + * 单图上传,其中一张图只能有一张人脸 校验 + * @param images 图片路径集合 + */ + private ImageUploadResult validateMultiFaceImages(List images) { + //人脸检测url + String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl(); + //组织返回结果集 + ImageUploadResult imageUploadResult = new ImageUploadResult(); + for (String image : images) { + //组装api请求数据 + ReturnVO returnVO = (ReturnVO) httpUtil.post(faceSearchUrl + "?url=" + image, null, ReturnVO.class); + if (returnVO.getCode() != 200) { + throw new DkException(returnVO.getMessage()); + } + //反序列化 + List apiSearchFaceRectVOList = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference>() {}); + if (UtilValidate.isEmpty(apiSearchFaceRectVOList)) { + throw new DkException("当前上传中未检测到人脸,请重新上传"); + } + //检测成功集合 + List successUrlList = new ArrayList<>(); + for (ApiSearchFaceRectVO apiSearchFaceRectVO : apiSearchFaceRectVOList) { + successUrlList.add(apiSearchFaceRectVO.getUrl()); + } + imageUploadResult.setSuccessFileUrlList(successUrlList); + imageUploadResult.setSuccessFiles(successUrlList.size()); + imageUploadResult.setFailFiles(images.size() - successUrlList.size()); + imageUploadResult.setTotalFiles(images.size()); + } + return imageUploadResult; + } + + /** + * 多图/单图上传,其中一张图可以多人脸/单人脸 校验 + * @param images + */ + private void validateSingleFaceImage(List images) { + //人脸检测url + String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl(); + for (String image : images) { + //组装api请求数据 + ReturnVO returnVO = (ReturnVO) httpUtil.post(faceSearchUrl + "?url=" + image, null, ReturnVO.class); + if (returnVO.getCode() != 200) { + throw new DkException(returnVO.getMessage()); + } + //反序列化 + List apiSearchFaceRectVOList = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference>() {}); + if (UtilValidate.isEmpty(apiSearchFaceRectVOList)) { + throw new DkException("当前上传中未检测到人脸,请重新上传"); + } + if (apiSearchFaceRectVOList.size() > 1) { + throw new DkException("当前上传图片检测到多张人脸,请重新上传"); + } + } + } + + /** + * 生成唯一文件名 + * @param originFileName + * @return + */ + private String generateFileName(String originFileName) { + // todo 迁移到资源文件中 + //当前时间 + long timeMillis = System.currentTimeMillis(); + int shortUUID = IntUUID.getShortUUID(); + if (!originFileName.contains(".")) { + throw new DkException("文件名格式错误"); + } + String[] originalFileNameCompose = originFileName.split("\\."); + //获取原文件后缀 + String originalFileNameSuffix = originalFileNameCompose[originalFileNameCompose.length - 1]; + Pattern p = Pattern.compile(apiPictureType); + boolean flag = p.matcher(originalFileNameSuffix).find(); + if (!flag) { + throw new DkException("请上传.jpg .png .jpeg类型的图片"); + } + return timeMillis + "-" + shortUUID + "." + originalFileNameSuffix; + } +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/PortraitServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/PortraitServiceImpl.java new file mode 100644 index 0000000..952b915 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/PortraitServiceImpl.java @@ -0,0 +1,700 @@ +package com.dkha.server.services.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.enums.ApiUrlEnum; +import com.dkha.common.enums.YNEnums; +import com.dkha.common.exception.DkException; +import com.dkha.common.fileupload.MinioUtil; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.ApiVO; +import com.dkha.common.modules.vo.ReturnVO; +import com.dkha.common.modules.vo.face.*; +import com.dkha.common.modules.vo.search.SearchPortraitVo; +import com.dkha.common.modules.vo.search.SearchRequestVo; +import com.dkha.common.modules.vo.search.SearchResultVo; +import com.dkha.common.page.PageParam; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.DateUtils; +import com.dkha.common.util.IdCardUtil; +import com.dkha.common.util.JsonUtil; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.modules.entities.Portrait; +import com.dkha.server.mappers.PortraitMapper; +import com.dkha.server.services.IPortraitService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.gson.Gson; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Collections; +import java.util.Date; +import java.util.*; + +/** + *

+ * 人像表 服务实现类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Service +public class PortraitServiceImpl extends ServiceImpl implements IPortraitService { + @Autowired + private MinioUtil minioUtil; + + @Resource + private PortraitMapper portraitMapper; + @Value("${api.server.prefix}") + private String link; + @Resource + private HttpUtil httpUtil; + @Autowired + private Gson gson; + @Value("${api.server.prefix}") + private String apiRequestPrefix; + @Value("${api.max.result}") + private String apiMaxResult; + @Value("${minio.bucketName}") + private String bucketName; + + @Override + @Transactional(rollbackFor = Exception.class) + public Portrait addPortrait(String libraryId, MultipartFile multipartFile) { + /**保存数据*/ + Portrait portrait; + String[] identityMessage = new String[2]; + String multipartFileName = multipartFile.getOriginalFilename(); + if (UtilValidate.isNotEmpty(multipartFileName)) { + boolean status = multipartFileName.contains("_"); + if (status) { + String filename = multipartFileName.substring(0, multipartFileName.lastIndexOf(".")); + identityMessage = filename.split("_"); + } else { + throw new DkException(SystemCode.FILE_ERROR.code, multipartFileName + "文件名格式不正确"); + } + } + ImagesVO imageVO = new ImagesVO(); + setimageVO(imageVO, identityMessage); + try { + String card = imageVO.getIdCard(); + int hash = card.hashCode(); + if (hash < 0) { + hash = 0 - hash; + } + JSONObject map = minioUtil.uploadFiles(multipartFile.getInputStream(), String.valueOf(hash % 500), multipartFile.getOriginalFilename(), null); + map.get("url"); + imageVO.setNation(""); + imageVO.setUrl(map.get("url").toString()); + imageVO.setLibraryId(libraryId); + } catch (Exception e) { + throw new DkException(multipartFileName + "文件上传失败"); + } + //imagesVO.setFaces(faces); + /**调用微云新增人像*/ + ApiVO face = (ApiVO) httpUtil.post(link + ApiUrlEnum.FACE_POSTURL.getUrl(), imageVO, ApiVO.class); + String json = gson.toJson(face.getData()); + ImageReturnVO imageReturnVO = null; + if (UtilValidate.isNotEmpty(json)) { + imageReturnVO = gson.fromJson(json, ImageReturnVO.class); + } + if (UtilValidate.isNotEmpty(imageReturnVO)) { + portrait = save(imageReturnVO, imageVO); + } else { + throw new DkException(SystemCode.FACESRH_ERROR.code, face.getMessage()); + } + return portrait; + } + + @Override + public List pictureDetection(MultipartFile multipartFile) throws Exception { + //人脸检测url + String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl(); + //组织返回结果集 + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + int hash = uuid.hashCode(); + if (hash < 0) { + hash = 0 - hash; + } + JSONObject map; + try { + map = minioUtil.uploadFiles(multipartFile.getInputStream(), String.valueOf(hash % 500), uuid, null); + } catch (Exception e) { + throw new DkException(multipartFile.getOriginalFilename() + "文件上传失败"); + } + //组装api请求数据 + ReturnVO returnVO = (ReturnVO) httpUtil.post(faceSearchUrl + "?url=" + map.getString("url"), null, ReturnVO.class); + if (returnVO.getCode() != 200) { + throw new DkException(returnVO.getMessage()); + } + //反序列化 + List apiSearchFaceRectVOList = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference>() { + }); + if (UtilValidate.isEmpty(apiSearchFaceRectVOList)) { + try { + minioUtil.removeObject(bucketName, map.getString("url")); + } catch (Exception e) { + throw new DkException("删除人脸失败"); + } + throw new DkException("当前上传中未检测到人脸,请重新上传"); + } + + return apiSearchFaceRectVOList; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Portrait addPortraitPng(String libraryId, MultipartFile multipartFile) { + /**保存数据*/ + Portrait portrait; + String multipartFileName = multipartFile.getOriginalFilename(); + ImagesVO imageVO = new ImagesVO(); + try { + JSONObject map = minioUtil.uploadFile(multipartFile.getInputStream(), multipartFile.getOriginalFilename(), null); + imageVO.setNation(""); + imageVO.setUrl(map.get("url").toString()); + imageVO.setLibraryId(libraryId); + } catch (Exception e) { + throw new DkException(multipartFileName + "文件上传失败"); + } + //setimageVO(imageVO, s); + //imagesVO.setFaces(faces); + /**调用微云新增人像*/ + ApiVO face = (ApiVO) httpUtil.post(link + ApiUrlEnum.FACE_POSTURL.getUrl(), imageVO, ApiVO.class); + String json = gson.toJson(face.getData()); + ImageReturnVO imageReturnVO = null; + if (UtilValidate.isNotEmpty(json)) { + imageReturnVO = gson.fromJson(json, ImageReturnVO.class); + } + if (UtilValidate.isNotEmpty(imageReturnVO)) { + portrait = save(imageReturnVO, imageVO); + } else { + throw new DkException(SystemCode.FACESRH_ERROR.code, face.getMessage()); + } + return portrait; + } + + @Override + public Portrait addPortraitPngs(String libraryId, String multipartFile) { + /**保存数据*/ + Portrait portrait; + ImagesVO imageVO = new ImagesVO(); + imageVO.setNation(""); + imageVO.setUrl(multipartFile); + imageVO.setLibraryId(libraryId); + /**调用微云新增人像*/ + ApiVO face = (ApiVO) httpUtil.post(link + ApiUrlEnum.FACE_POSTURL.getUrl(), imageVO, ApiVO.class); + String json = gson.toJson(face.getData()); + ImageReturnVO imageReturnVO = null; + if (UtilValidate.isNotEmpty(json)) { + imageReturnVO = gson.fromJson(json, ImageReturnVO.class); + } + if (UtilValidate.isNotEmpty(imageReturnVO)) { + portrait = save(imageReturnVO, imageVO); + } else { + throw new DkException(SystemCode.FACESRH_ERROR.code, face.getMessage()); + } + return portrait; + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public List addPortraits(String libraryId, MultipartFile[] files) { + List list = new ArrayList<>(); + try { + //判断file数组不能为空并且长度大于0 + if (files != null && files.length > 0) { + for (int i = 0; i < files.length; i++) { + JSONObject map = minioUtil.uploadFile(files[i].getInputStream(), files[i].getOriginalFilename(), null); + map.get("path"); + String[] message = new String[4]; + String multipartFileName = files[i].getOriginalFilename(); + if (UtilValidate.isNotEmpty(multipartFileName)) { + String filename = multipartFileName.substring(0, multipartFileName.lastIndexOf(".")); + message = filename.split("_"); + } + /**文件名:身份证_姓名*/ + ImagesVO imageVO = new ImagesVO(); + setimageVO(imageVO, message); + imageVO.setUrl(map.get("url").toString()); + List faces = new ArrayList<>(); + //faces.add(imageVO); + imageVO.setLibraryId(libraryId); + //imagesVO.setFaces(faces); + /**调用微云新增人像*/ + ApiVO face = (ApiVO) httpUtil.post(link + ApiUrlEnum.FACE_POSTURL.getUrl(), imageVO, ApiVO.class); + String json = gson.toJson(face.getData()); + ImageReturnVO imageReturnVO = null; + if (UtilValidate.isNotEmpty(json)) { + imageReturnVO = gson.fromJson(json, ImageReturnVO.class); + } + if (UtilValidate.isNotEmpty(imageReturnVO)) { + Portrait portrait = save(imageReturnVO, imageVO); + list.add(portrait); + } else { + throw new DkException(face.getMessage()); + } + } + } + return list; + /**调用微云新增人像*/ + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + @Override + public Portrait updatePortrait(Portrait portrait) { + try { + if (UtilValidate.isNotEmpty(portrait)) { + ImagesVO imageVO = new ImagesVO(); + setSex(imageVO, portrait.getIdCard()); + portrait.setSex(imageVO.getGender()); + java.sql.Date birthDate = getBirthDate(portrait.getIdCard()); + portrait.setBirthDate(birthDate); + portrait.setAge(DateUtils.getAge(portrait.getBirthDate())); + } + portraitMapper.updateById(portrait); + } catch (Exception e) { + throw new DkException("修改人像失败"); + } + return portrait; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Long deletePortrait(Long idPortrait) { + try { + Portrait portrait = new Portrait(); + portrait.setIdPortrait(idPortrait); + Portrait portrait1 = portraitMapper.queryPortrait(idPortrait); + /**调用API*/ + if (UtilValidate.isNotEmpty(portrait1)) { + /**调用微云删除人像*/ + ApiVO face = (ApiVO) httpUtil.delete(link + ApiUrlEnum.FACE_POSTURL.getUrl() + "/" + portrait1.getIdFactory() + "/" + idPortrait, ApiVO.class); + + if (face.getMessage().equals("成功")) { + minioUtil.removeObject(bucketName, portrait1.getUrl()); + } else { + log.error("wy删除失败"); + } + int i = portraitMapper.deleteById(portrait); + } + } catch (Exception e) { + throw new DkException("删除人像失败"); + } + return idPortrait; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List deletePortraits(List idPortrait) { + try { + if (UtilValidate.isNotEmpty(idPortrait)) { + for (int i = 0; i < idPortrait.size(); i++) { + Portrait portrait1 = portraitMapper.queryPortrait(idPortrait.get(i)); + if (UtilValidate.isEmpty(portrait1)) { + continue; + } + /**调用微云删除人像*/ + ApiVO face = (ApiVO) httpUtil.delete(link + ApiUrlEnum.FACE_POSTURL.getUrl() + "/" + portrait1.getIdFactory() + "/" + portrait1.getIdPortrait(), ApiVO.class); + if (face.getMessage().equals("成功")) { + minioUtil.removeObject(bucketName, portrait1.getUrl()); + } else { + log.error("wy删除失败"); + } + portraitMapper.deleteById(idPortrait.get(i)); + } + } + } catch (Exception e) { + throw new DkException("删除人像失败"); + } + return idPortrait; + } + + @Override + //public ReturnVO queryPortrait(PageParam pageParam) { + public Page queryPortrait(PageParam pageParam) { + /* PagePortraitVO pagePortraitVO = new PagePortraitVO(); + pagePortraitVO.setLibraryId(pageParam.getNote().get("libraryId")); + PageVO pageVO = new PageVO(); + pageVO.setPageNo(pageParam.getPageNo()); + pageVO.setPageSize(pageParam.getPageSize()); + pagePortraitVO.setPage(pageVO); + ReturnVO faceLibrary1 = (ReturnVO) httpUtil.post(link+ ApiUrlEnum.FACELIBS_POSTURL.getUrl(), pagePortraitVO, ReturnVO.class);*/ + /**创建page对象*/ + Page page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize()); + /**设置模糊查询参数*/ + Map paramsNote = pageParam.getNote(); + + /**分页查询*/ + //List postList = portraitMapper.selectPage(page, paramsNote.get("factoryName")); + List postList = portraitMapper.queryPage(page, paramsNote); + if (UtilValidate.isNotEmpty(postList)) { + for (Portrait portrait : postList) { + /**年龄*/ + if (UtilValidate.isNotEmpty(portrait.getBirthDate())) { + portrait.setAge(DateUtils.getAge(portrait.getBirthDate())); + } + } + } + page.setRecords(postList); + return page; + + // return faceLibrary1; + } + + /** + * 获取出生年月 + * + * @param idCard + * @return + */ + public java.sql.Date getBirthDate(String idCard) { + if (null != idCard && !idCard.equals("") && idCard.length() == 18) { + LocalDate date = LocalDate.of(Integer.parseInt(idCard.substring(6, 10)), Integer.parseInt(idCard.substring(10, 12)), Integer.parseInt(idCard.substring(12, 14))); + try { + ZonedDateTime zonedDateTime = date.atStartOfDay(ZoneId.systemDefault()); + return new java.sql.Date(Date.from(zonedDateTime.toInstant()).getTime()); + } catch (Exception e) { + throw new DkException("身份信息有误"); + } + } + return null; + } + + /** + * 保存数据 + * + * @return + */ + public Portrait save(ImageReturnVO imageReturnVO, ImagesVO imageVO) { + Portrait portrait = new Portrait(); + /**id*/ + if (UtilValidate.isNotEmpty(imageReturnVO.getFaceId())) { + portrait.setIdPortrait(Long.parseLong(imageReturnVO.getFaceId())); + } + //人脸ID + if (UtilValidate.isNotEmpty(imageReturnVO.getIdFaceid())) { + portrait.setFeatId(imageReturnVO.getIdFaceid()); + } + if (UtilValidate.isNotEmpty(imageReturnVO.getFace())) { + /**背景地址*/ + if (UtilValidate.isNotEmpty(imageReturnVO.getFace().getUrl())) { + portrait.setBackgroundUrl(imageReturnVO.getFace().getUrl()); + } + /**人脸地址*/ + if (UtilValidate.isNotEmpty(imageReturnVO.getFace().getFaceUrl())) { + portrait.setUrl(imageReturnVO.getFace().getFaceUrl()); + } + } + + if (UtilValidate.isNotEmpty(imageReturnVO.getLibraryId())) { + portrait.setIdFactory(Long.parseLong(imageReturnVO.getLibraryId())); + } + /**出生年月*/ + if (UtilValidate.isNotEmpty(imageVO.getIdCard())) { + portrait.setBirthDate(getBirthDate(imageVO.getIdCard())); + } + /**身份证信息*/ + if (UtilValidate.isNotEmpty(imageReturnVO.getFace().getIdCard())) { + portrait.setIdCard(imageReturnVO.getFace().getIdCard()); + } + if (UtilValidate.isNotEmpty(imageVO.getName())) { + portrait.setName(imageVO.getName()); + } + if (UtilValidate.isNotEmpty(imageReturnVO.getFaceId())) { + portrait.setFaceIds(imageReturnVO.getFaceId()); + } + if (UtilValidate.isNotEmpty(imageVO.getGender())) { + portrait.setSex(imageVO.getGender()); + } + portrait.setIsValid(YNEnums.YES.code); + portrait.setCreateTime(new Date()); + portrait.setUpdateTime(new Date()); + try { + int insert = portraitMapper.insert(portrait); + } catch (Exception e) { + throw new DkException("保存人像信息错误"); + } + return portrait; + } + + /** + * 设置性别 + * + * @param imageVO + * @param idCard + */ + public void setSex(ImagesVO imageVO, String idCard) { + if (UtilValidate.isNotEmpty(idCard)) { + if (idCard.length() == 15) { + String sex = idCard.substring(13, 14); //取指定位置的值(16位之后,17位结束;) + int b = Integer.parseInt(sex);//强制类型转换 + if (b % 2 == 0) { + imageVO.setGender("1");//女 + } else { + imageVO.setGender("0"); + } + } + if (idCard.length() == 18) { + String sex = idCard.substring(16, 17); //取指定位置的值(16位之后,17位结束;) + int b = Integer.parseInt(sex);//强制类型转换 + if (b % 2 == 0) { + imageVO.setGender("1");//女 + } else { + imageVO.setGender("0"); + } + } + imageVO.setIdCard(idCard); + } + } + + public void setimageVO(ImagesVO imageVO, String[] identityMessage) { + if (identityMessage.length > 0) { + /**文件名:身份证_姓名_性别*/ + if (!IdCardUtil.isValidatedAllIdcard(identityMessage[0])) { + throw new DkException(SystemCode.IDCARD_ERROR.code, "身份证号码输入不正确"); + } + if (UtilValidate.isNotEmpty(identityMessage[0])) { + setSex(imageVO, identityMessage[0]); + imageVO.setIdCard(identityMessage[0]); + } + if (UtilValidate.isNotEmpty(identityMessage[1])) { + imageVO.setName(identityMessage[1]); + } + } + } + + @Override + public SearchResultVo libSearchPage(SearchRequestVo searchRequestVo) { + //用户传输图片过来进行检索,调用人脸API + if (UtilValidate.isNotEmpty(searchRequestVo.getFaceImageRequestList())) { + return this.libSearPageByApi(searchRequestVo); + } else { + //调用数据库查询接口进行查询,不涉及人脸检索 + Page searchPage = this.findSearchPage(searchRequestVo.getPageParam(), null, searchRequestVo.getLibIdList(), null); + SearchResultVo searchResultVo = new SearchResultVo(); + searchResultVo.setResultPage(searchPage); + //将部分请求参数返回前端,方便前端进行数据绑定 + searchResultVo.setRequestLibIdList(searchRequestVo.getLibIdList()); + if (UtilValidate.isNotEmpty(searchRequestVo.getPageParam().getNote().get("search"))) { + searchResultVo.setRequestSearch(searchRequestVo.getPageParam().getNote().get("search").replaceAll("%", "")); + } + return searchResultVo; + } + } + + /** + * 人脸检索--api调用渠道 + * + * @param searchRequestVo + * @return + */ + private SearchResultVo libSearPageByApi(SearchRequestVo searchRequestVo) { + String requestUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH_LIB.getUrl(); + /** + * 返回结果集 + */ + SearchResultVo searchResultVo = new SearchResultVo(); + /** + * 图片搜索,如果当前为第一页,则调用sdk查询,反之利用第一页sdk返回的数据 + * 进行操作 + */ + if (searchRequestVo.getPageParam().getPageNo() == 1) { + //人脸ID,分数集合,及其对应分数--由sdk返回 + Map faceApiResultMap = new LinkedHashMap<>(); + for (String faceImage : searchRequestVo.getFaceImageRequestList()) { + /** + * 构建请求对象 + */ + ApiFaceSearchVO apiFaceSearchVO = new ApiFaceSearchVO(); + //设置图片url + apiFaceSearchVO.setUrl(faceImage); + //设置检索库 + apiFaceSearchVO.setLibraryIds(searchRequestVo.getLibIdList()); + //设置阀值 + if (UtilValidate.isNotEmpty(searchRequestVo.getMinScore())) { + apiFaceSearchVO.setMinScore(Double.parseDouble(searchRequestVo.getMinScore())); + } + //设置分页 + PageVO pageVO = new PageVO(); + pageVO.setPageSize(Integer.parseInt(apiMaxResult)); + apiFaceSearchVO.setPageVO(pageVO); + //获取解析结果 + ReturnVO returnVO = (ReturnVO) httpUtil.post(requestUrl, apiFaceSearchVO, ReturnVO.class); + if (returnVO.getCode() != 200) { + throw new DkException(returnVO.getMessage()); + } + //解析结果 + ApiFaceSearchReturnVO apiFaceSearchReturnVO = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference() { + }); + if (UtilValidate.isNotEmpty(apiFaceSearchReturnVO)) { + for (ApiFaceSearchFacesVO apiFaceSearchFacesVO : apiFaceSearchReturnVO.getFaces()) { + List faceList = apiFaceSearchFacesVO.getFaceList(); + if (UtilValidate.isNotEmpty(faceList)) { + for (ApiFaceSearchFaceVO apiFaceSearchFaceVO : faceList) { + faceApiResultMap.put(apiFaceSearchFaceVO.getFaceId(), apiFaceSearchFaceVO.getHitSimilarity()); + } + } + } + } + if (UtilValidate.isEmpty(faceApiResultMap)) { + /** + * 为空的时候组织数据,便于前端组织数据 + */ + Page page = new Page<>(); + searchResultVo.setResultPage(page); + searchResultVo.setFaceImageRequestList(new ArrayList<>()); + searchResultVo.setFaceApiResultMap(new HashMap<>()); + //将部分请求参数返回前端,方便前端进行数据绑定 + searchResultVo.setRequestLibIdList(searchRequestVo.getLibIdList()); + if (UtilValidate.isNotEmpty(searchRequestVo.getPageParam().getNote().get("search"))) { + searchResultVo.setRequestSearch(searchRequestVo.getPageParam().getNote().get("search").replaceAll("%", "")); + } + return searchResultVo; + } else { + // 对API调用返回的数据进行排序 + faceApiResultMap = this.sort(faceApiResultMap); + } + } + //获取分页数据 + Page searchPage = this.findSearchPage(searchRequestVo.getPageParam(), new ArrayList<>(faceApiResultMap.keySet()), searchRequestVo.getLibIdList(), faceApiResultMap); + searchResultVo.setResultPage(searchPage); + searchResultVo.setFaceApiResultMap(faceApiResultMap); + searchResultVo.setFaceImageRequestList(searchRequestVo.getFaceImageRequestList()); + //将部分请求参数返回前端,方便前端进行数据绑定 + searchResultVo.setRequestLibIdList(searchRequestVo.getLibIdList()); + if (UtilValidate.isNotEmpty(searchRequestVo.getPageParam().getNote().get("search"))) { + searchResultVo.setRequestSearch(searchRequestVo.getPageParam().getNote().get("search").replaceAll("%", "")); + } + return searchResultVo; + } else { + //获取分页数据 + Page searchPage = this.findSearchPage(searchRequestVo.getPageParam(), new ArrayList<>(searchRequestVo.getFaceApiResultMap().keySet()), searchRequestVo.getLibIdList(), searchRequestVo.getFaceApiResultMap()); + searchResultVo.setResultPage(searchPage); + searchResultVo.setFaceApiResultMap(searchRequestVo.getFaceApiResultMap()); + searchResultVo.setFaceImageRequestList(searchRequestVo.getFaceImageRequestList()); + //将部分请求参数返回前端,方便前端进行数据绑定 + searchResultVo.setRequestLibIdList(searchRequestVo.getLibIdList()); + if (UtilValidate.isNotEmpty(searchRequestVo.getPageParam().getNote().get("search"))) { + searchResultVo.setRequestSearch(searchRequestVo.getPageParam().getNote().get("search").replaceAll("%", "")); + } + return searchResultVo; + } + } + + /** + * 人脸检索分页 + * + * @param pageParam + * @param faceIdList 人脸Id集合 + * @param libraryIdList 库Id集合 + * @param faceApiResultMap 人脸分数集合 + * @return + */ + private Page findSearchPage(PageParam pageParam, List faceIdList, List libraryIdList, Map faceApiResultMap) { + Page page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize()); + Map searchParams = pageParam.paramsToLike(pageParam.getNote(), "search"); + /** + * 查询出来的数据为乱序,即使对入参做了排序,也没有用,故此处的查询的唯一作用是用于判断有效的记录条数 + * 然后再根据当前页,以及当前页面的入参数据进行一次有效的查询,查询出来的结果依然为乱序,然后再根据、 + * faceApiResultMap 与Id的对应关系再进行一次排序作为返回值 + */ + // 获取总的有效数量, + Integer pageCount = baseMapper.findSearchPageCount(searchParams, faceIdList, libraryIdList); + page.setTotal(pageCount); + List pageList; + // 通过API调用 + if (UtilValidate.isNotEmpty(faceIdList) && UtilValidate.isNotEmpty(libraryIdList) && UtilValidate.isNotEmpty(faceApiResultMap)) { + pageList = baseMapper.findSearchPageList(searchParams, this.getSubFaceIdList(faceIdList, page), libraryIdList); + // 获取当前页有效数据 + // 设置人脸分数 + if (UtilValidate.isNotEmpty(faceApiResultMap)) { + for (SearchPortraitVo searchPortraitVo : pageList) { + if (faceApiResultMap.containsKey(searchPortraitVo.getIdPortrait())) { + searchPortraitVo.setSimilarityDegree(faceApiResultMap.get(searchPortraitVo.getIdPortrait())); + } + } + } + //对返回的数据进行排序 + Collections.sort(pageList); + page.setRecords(pageList); + return page; + } else { + // 非API调用 + pageList = baseMapper.findSearchPage(page, searchParams, null, libraryIdList); + page.setRecords(pageList); + return page; + } + + } + + /** + * 对返回的人脸结果集进行排序 + * + * @param sortMap + * @return + */ + private Map sort(Map sortMap) { + // 通过ArrayList构造函数把map.entrySet()转换成list + List> sortList = new ArrayList<>(sortMap.entrySet()); + Collections.sort(sortList, new Comparator>() { + @Override + public int compare(Map.Entry o1, Map.Entry o2) { + return o2.getValue().compareTo(o1.getValue()); + } + }); + Map resultMap = new LinkedHashMap<>(); + Iterator> iterator = sortList.iterator(); + while (iterator.hasNext()) { + Map.Entry next = iterator.next(); + resultMap.put(next.getKey(), next.getValue()); + } + return resultMap; + } + + /** + * 截取人脸Id子集合 + * + * @param faceIdList 需要剪裁的集合 + * @param page page对象 + * @return + */ + private List getSubFaceIdList(List faceIdList, Page page) { + if (UtilValidate.isEmpty(faceIdList)) { + return null; + } + // 每页数量 + long pageSize = page.getSize(); + // 当前页 + long current = page.getCurrent(); + // 总记录数量 + long total = page.getTotal(); + long start = (current - 1) * pageSize; + long end = current * pageSize; + if (end > total) { + end = total; + } + if (start > end) { + return null; + } + return faceIdList.subList(new Long(start).intValue(), new Long(end).intValue()); + } + + public static void main(String[] args) { + String s = "513902199202293979"; + System.out.println(s.hashCode() % 500); + } +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/TrackTaskImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/TrackTaskImpl.java new file mode 100644 index 0000000..e52e1e1 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/TrackTaskImpl.java @@ -0,0 +1,276 @@ +package com.dkha.server.services.impl; + +import com.dkha.common.enums.ApiUrlEnum; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.camera.BayOnetCameraVO; +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.common.modules.vo.camera.PeopleComparableVO; +import com.dkha.common.modules.vo.camera.PeopleVO; +import com.dkha.common.modules.vo.face.ApiFaceSearchReturnVO; +import com.dkha.common.modules.vo.face.ApiFaceSearchVO; +import com.dkha.common.modules.vo.face.PageVO; +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import com.dkha.common.util.TimeUtil; +import com.dkha.common.util.UrlUtil; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.services.IControlBayonetMidService; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: TrackTaskImpl + * @Package com.dkha.server.services.impl + * @author: panhui + * @date: 2020/1/14 12:39 + * @Copyright: 成都电科慧安 + */ +@Component +@Slf4j +public class TrackTaskImpl { + + + @Autowired + private HttpUtil httpUtil; + + @Value("${api.server.prefix}") + private String link; + + /** + * 调用api进行人脸检测 获取到人脸的id + * @param faceUrl + * @param libs + * @param minScore + */ + public List faceCheck(String faceUrl, List libs, Double minScore) + { + List faceList =new ArrayList<>(); + ApiFaceSearchVO apiFaceSearchVO = new ApiFaceSearchVO(); + apiFaceSearchVO.setUrl(faceUrl); + apiFaceSearchVO.setLibraryIds(libs); + apiFaceSearchVO.setMinScore(minScore); + PageVO pageVO = new PageVO(); + pageVO.setPageSize(1); + apiFaceSearchVO.setPageVO(pageVO); + String json= UrlUtil.postApiData(link+ ApiUrlEnum.FACE_SEARCH_LIB.getUrl(),apiFaceSearchVO, httpUtil,gson); +// log.error("获取数据{}",json); + if(UtilValidate.isEmpty(json)){return faceList; } + ApiFaceSearchReturnVO apiFaceSearchReturnVO=gson.fromJson(json,ApiFaceSearchReturnVO.class); + if(UtilValidate.isEmpty(apiFaceSearchReturnVO) || UtilValidate.isEmpty(apiFaceSearchReturnVO.getFaces())) + { + return faceList; + } + apiFaceSearchReturnVO.getFaces().forEach(e-> + { + if(UtilValidate.isEmpty(e.getFaceList())) + { + return; + } + e.getFaceList().forEach(a-> + { + faceList.add(a.getFaceId()); + }); + }); + return faceList; + } + + @Autowired + private RedisUtils redisUtils; + @Autowired + private Gson gson; + + @Autowired + IControlBayonetMidService iControlBayonetMidService; + /** + * redis获取libid + * @param nowTime + * @return + */ + public List getRedisLibId(String nowTime) + { + List list=new ArrayList<>(); + List cameraList = iControlBayonetMidService.selectFaceCameraBytaskInfo(); + if (!UtilValidate.isEmpty(cameraList)) { + cameraList.forEach(e-> + { + //去API比对 + if(redisUtils.exists(RedisKeys.getCameraByTrack(nowTime,e.getIdFaceCamera()))) + { + BayOnetCameraVO bayOnetCameraVO=gson.fromJson(redisUtils.get(RedisKeys.getCameraByTrack(nowTime,e.getIdFaceCamera())).toString(), BayOnetCameraVO.class); + list.add(bayOnetCameraVO.getAssociationLibraryId().toString()); + //获取lib信息 + } + }); + } + return list; + } + + + /** + * redis临时调用设置redis中属性的id + * @param nowTime + * @return + */ + public void setBingDataCamerID(String nowTime) + { + + + List cameraList = iControlBayonetMidService.selectFaceCameraBytaskInfo(); + if (!UtilValidate.isEmpty(cameraList)) { + cameraList.forEach(e-> + { + //去API比对 + if(redisUtils.exists(RedisKeys.getCameraByTrack(nowTime,e.getIdFaceCamera()))) + { + BayOnetCameraVO bayOnetCameraVO=gson.fromJson(redisUtils.get(RedisKeys.getCameraByTrack(nowTime,e.getIdFaceCamera())).toString(), BayOnetCameraVO.class); + bayOnetCameraVO.getFeatIds().forEach(a-> + { + xxx(nowTime,a); + }); + + } + }); + } + + } + + private void xxx(String nowTime,String faceId) + { + List myList=getRedisCameraId(nowTime); + myList.forEach(a-> + { + //去API比对 + if(redisUtils.exists(RedisKeys.getCameraByFaceId(nowTime,a,faceId))) + { + List list=gson.fromJson(redisUtils.get(RedisKeys.getCameraByFaceId(nowTime,a,faceId)).toString(), new TypeToken>() {}.getType()); + if(UtilValidate.isNotEmpty(list)) { + list.forEach(e-> + { + e.setCameraId(a); + }); + } + redisUtils.set(RedisKeys.getCameraByFaceId(nowTime,a,faceId),gson.toJson(list)); + } + }); + } + + /** + * redis获取CameraId + * @param nowTime + * @return + */ + public List getRedisCameraId(String nowTime) + { + List list=new ArrayList<>(); + List cameraList = iControlBayonetMidService.selectFaceCameraBytaskInfo(); + if (!UtilValidate.isEmpty(cameraList)) { + cameraList.forEach(e-> + { + //去API比对 + if(redisUtils.exists(RedisKeys.getCameraByTrack(nowTime,e.getIdFaceCamera()))) + { + BayOnetCameraVO bayOnetCameraVO=gson.fromJson(redisUtils.get(RedisKeys.getCameraByTrack(nowTime,e.getIdFaceCamera())).toString(), BayOnetCameraVO.class); + list.add(bayOnetCameraVO.getCameraId().toString()); + //获取lib信息 + } + }); + } + return list; + } + + /** + * 筛选数据 + * @return + */ + public Map> filterPeople(List peopleVOList) + { + Map> myMap=new HashMap<>(); + peopleVOList.forEach(e-> + { + if(UtilValidate.isEmpty(e.getTime())) + { + e.setTime( new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getTimestamp()) ); + } + String key=e.getTime().substring(0,10); + if(myMap.containsKey(key)) + { + PeopleComparableVO pvo= new PeopleComparableVO(); + BeanUtils.copyProperties(e,pvo); + myMap.get(key).add(pvo); + }else + { + List lp=new ArrayList<>(); + PeopleComparableVO pvo= new PeopleComparableVO(); + BeanUtils.copyProperties(e,pvo); + lp.add(pvo); + myMap.put(key,lp); + } + }); + //对数据进行排序处理 把所有摄像头的数据整合后进行排序 + //时间和所有数据 + Map> newMyMap=new HashMap<>(); + myMap.forEach((a,b)-> + { + if(UtilValidate.isNotEmpty(b)) + { + //按照时间戳就行排序 + Collections.sort(b); + String lastCarmerId=""; + for(PeopleComparableVO p:b) + { + //相等就不需要这个数据了 + if(UtilValidate.isNotEmpty(p.getCameraId())) { + if (!p.getCameraId().equals(lastCarmerId)) { + if (newMyMap.containsKey(a)) { + newMyMap.get(a).add(p); + } else { + List pList = new ArrayList<>(); + pList.add(p); + newMyMap.put(a, pList); + } + lastCarmerId = p.getCameraId(); + } + } + //筛选有用的 + } + } + }); + return newMyMap; + } + + + + /** + * redis获取用户信息 + * @param faceId + * @return + */ + public List getRedisPeopleInfo(String nowTime,String faceId) + { + List peopleVOList=new ArrayList<>(); + List myList=getRedisCameraId(nowTime); + myList.forEach(a-> + { + //去API比对 + if(redisUtils.exists(RedisKeys.getCameraByFaceId(nowTime,a,faceId))) + { + List list=gson.fromJson(redisUtils.get(RedisKeys.getCameraByFaceId(nowTime,a,faceId)).toString(), new TypeToken>() {}.getType()); + if(UtilValidate.isNotEmpty(list)) { + peopleVOList.addAll(list); + } + } + }); + return peopleVOList; + } +} diff --git a/face-server/src/main/java/com/dkha/server/services/impl/WarningInformationServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/WarningInformationServiceImpl.java new file mode 100644 index 0000000..d07b2fa --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/services/impl/WarningInformationServiceImpl.java @@ -0,0 +1,20 @@ +package com.dkha.server.services.impl; + +import com.dkha.server.modules.entities.WarningInformation; +import com.dkha.server.mappers.WarningInformationMapper; +import com.dkha.server.services.IWarningInformationService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 预警信息 服务实现类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Service +public class WarningInformationServiceImpl extends ServiceImpl implements IWarningInformationService { + +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/annotation/DataFilter.java b/face-server/src/main/java/com/dkha/server/system/common/annotation/DataFilter.java new file mode 100644 index 0000000..0c0b1e2 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/annotation/DataFilter.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.annotation; + +import java.lang.annotation.*; + +/** + * 数据过滤注解 + * + * @author Mark sunlightcs@gmail.com + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DataFilter { + /** + * 表的别名 + */ + String tableAlias() default ""; + + /** + * 查询条件前缀,可选值有:[where、and] + */ + String prefix() default ""; + + /** + * 用户ID + */ + String userId() default "creator"; + + /** + * 部门ID + */ + String deptId() default "dept_id"; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/annotation/LogOperation.java b/face-server/src/main/java/com/dkha/server/system/common/annotation/LogOperation.java new file mode 100644 index 0000000..e82735f --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/annotation/LogOperation.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.annotation; + +import java.lang.annotation.*; + +/** + * 操作日志注解 + * + * @author Mark sunlightcs@gmail.com + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface LogOperation { + + String value() default ""; +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/aspect/DataFilterAspect.java b/face-server/src/main/java/com/dkha/server/system/common/aspect/DataFilterAspect.java new file mode 100644 index 0000000..c0e9ea2 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/aspect/DataFilterAspect.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.aspect; + +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.annotation.DataFilter; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.interceptor.DataScope; +import com.dkha.server.system.modules.security.user.SecurityUser; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.enums.SuperAdminEnum; +import org.apache.commons.lang3.StringUtils; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.stereotype.Component; + +import java.lang.reflect.Method; +import java.util.List; +import java.util.Map; + +/** + * 数据过滤,切面处理类 + * + * @author Mark sunlightcs@gmail.com + */ +@Aspect +@Component +public class DataFilterAspect { + + @Pointcut("@annotation(com.dkha.server.system.common.annotation.DataFilter)") + public void dataFilterCut() { + + } + + @Before("dataFilterCut()") + public void dataFilter(JoinPoint point) { + Object params = point.getArgs()[0]; + if(params != null && params instanceof Map){ + UserDetail user = SecurityUser.getUser(); + + //如果是超级管理员,则不进行数据过滤 + if(user.getSuperAdmin() == SuperAdminEnum.YES.value()) { + return ; + } + + try { + //否则进行数据过滤 + Map map = (Map)params; + String sqlFilter = getSqlFilter(user, point); + map.put(Constant.SQL_FILTER, new DataScope(sqlFilter)); + }catch (Exception e){ + + } + + return ; + } + + throw new com.dkha.server.system.common.exception.RenException(ErrorCode.DATA_SCOPE_PARAMS_ERROR); + } + + /** + * 获取数据过滤的SQL + */ + private String getSqlFilter(UserDetail user, JoinPoint point) throws Exception { + MethodSignature signature = (MethodSignature) point.getSignature(); + Method method = point.getTarget().getClass().getDeclaredMethod(signature.getName(), signature.getParameterTypes()); + DataFilter dataFilter = method.getAnnotation(DataFilter.class); + + //获取表的别名 + String tableAlias = dataFilter.tableAlias(); + if(StringUtils.isNotBlank(tableAlias)){ + tableAlias += "."; + } + + StringBuilder sqlFilter = new StringBuilder(); + + //查询条件前缀 + String prefix = dataFilter.prefix(); + if(StringUtils.isNotBlank(prefix)){ + sqlFilter.append(" ").append(prefix); + } + + sqlFilter.append(" ("); + + //部门ID列表 + List deptIdList = user.getDeptIdList(); + if(UtilValidate.isNotEmpty(deptIdList)){ + sqlFilter.append(tableAlias).append(dataFilter.deptId()); + + sqlFilter.append(" in(").append(StringUtils.join(deptIdList, ",")).append(")"); + } + + //查询本人数据 + if(UtilValidate.isNotEmpty(deptIdList)){ + sqlFilter.append(" or "); + } + sqlFilter.append(tableAlias).append(dataFilter.userId()).append("=").append(user.getId()); + + sqlFilter.append(")"); + + return sqlFilter.toString(); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/aspect/LogOperationAspect.java b/face-server/src/main/java/com/dkha/server/system/common/aspect/LogOperationAspect.java new file mode 100644 index 0000000..979ec89 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/aspect/LogOperationAspect.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.aspect; + +import com.alibaba.fastjson.JSON; +import com.dkha.common.util.IpUtils; +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.utils.HttpContextUtils; +import com.dkha.server.system.modules.log.entity.SysLogOperationEntity; +import com.dkha.server.system.modules.log.enums.OperationStatusEnum; +import com.dkha.server.system.modules.log.service.SysLogOperationService; +import com.dkha.server.system.modules.security.user.SecurityUser; +import com.dkha.server.system.modules.security.user.UserDetail; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import java.lang.reflect.Method; + +/** + * 操作日志,切面处理类 + * + * @author Mark sunlightcs@gmail.com + */ +@Aspect +@Component +public class LogOperationAspect { + @Autowired + private SysLogOperationService sysLogOperationService; + + @Pointcut("@annotation(com.dkha.server.system.common.annotation.LogOperation)") + public void logPointCut() { + + } + + @Around("logPointCut()") + public Object around(ProceedingJoinPoint point) throws Throwable { + long beginTime = System.currentTimeMillis(); + try { + //执行方法 + Object result = point.proceed(); + + //执行时长(毫秒) + long time = System.currentTimeMillis() - beginTime; + //保存日志 + saveLog(point, time, OperationStatusEnum.SUCCESS.value()); + + return result; + }catch(Exception e) { + //执行时长(毫秒) + long time = System.currentTimeMillis() - beginTime; + //保存日志 + saveLog(point, time, OperationStatusEnum.FAIL.value()); + + throw e; + } + } + + private void saveLog(ProceedingJoinPoint joinPoint, long time, Integer status) throws Exception { + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = joinPoint.getTarget().getClass().getDeclaredMethod(signature.getName(), signature.getParameterTypes()); + LogOperation annotation = method.getAnnotation(LogOperation.class); + + SysLogOperationEntity log = new SysLogOperationEntity(); + if(annotation != null){ + //注解上的描述 + log.setOperation(annotation.value()); + } + + //登录用户信息 + UserDetail user = SecurityUser.getUser(); + if(user != null){ + log.setCreatorName(user.getUsername()); + } + + log.setStatus(status); + log.setRequestTime((int)time); + + //请求相关信息 + HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + log.setIp(IpUtils.getIpAddr(request)); + log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); + log.setRequestUri(request.getRequestURI()); + log.setRequestMethod(request.getMethod()); + + //请求参数 + Object[] args = joinPoint.getArgs(); + try{ + String params = JSON.toJSONString(args[0]); + log.setRequestParams(params); + }catch (Exception e){ + + } + + //保存到DB + sysLogOperationService.save(log); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/config/MybatisPlusConfig.java b/face-server/src/main/java/com/dkha/server/system/common/config/MybatisPlusConfig.java new file mode 100644 index 0000000..f588253 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/config/MybatisPlusConfig.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.config; + +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor; +import com.dkha.server.system.common.interceptor.DataFilterInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; + +/** + * mybatis-plus配置 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Configuration +public class MybatisPlusConfig { + + /** + * 配置数据权限 + */ + @Bean + @Order(1) + public DataFilterInterceptor dataFilterInterceptor() { + return new DataFilterInterceptor(); + } + + /** + * 配置分页 + */ + @Bean + @Order(0) + public PaginationInterceptor paginationInterceptor() { + return new PaginationInterceptor(); + } + + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/constant/Constant.java b/face-server/src/main/java/com/dkha/server/system/common/constant/Constant.java new file mode 100644 index 0000000..c8b58e9 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/constant/Constant.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.constant; + +/** + * 常量 + * + * @author Mark sunlightcs@gmail.com + */ +public interface Constant { + /** + * 成功 + */ + int SUCCESS = 1; + /** + * 岗位发布平台登录默认初始化密码 + */ + int COMPANY_INITIALIZATION_PASSWORD = 123456; + /** + * 失败 + */ + int FAIL = 0; + /** + * OK + */ + String OK = "OK"; + /** + * 用户标识 + */ + String USER_KEY = "userId"; + /** + * 菜单根节点标识 + */ + Long MENU_ROOT = 0L; + /** + * 部门根节点标识 + */ + Long DEPT_ROOT = 0L; + /** + * 数据字典根节点标识 + */ + Long DICT_ROOT = 0L; + /** + * 升序 + */ + String ASC = "asc"; + /** + * 降序 + */ + String DESC = "desc"; + /** + * 创建时间字段名 + */ + String CREATE_DATE = "create_date"; + + /** + * 创建时间字段名 + */ + String ID = "id"; + + /** + * 数据权限过滤 + */ + String SQL_FILTER = "sqlFilter"; + + /** + * 当前页码 + */ + String PAGE = "page"; + /** + * 每页显示记录数 + */ + String LIMIT = "limit"; + /** + * 排序字段 + */ + String ORDER_FIELD = "orderField"; + /** + * 排序方式 + */ + String ORDER = "order"; + /** + * token header + */ + String TOKEN_HEADER = "token"; + + /** + * 云存储配置KEY + */ + String CLOUD_STORAGE_CONFIG_KEY = "CLOUD_STORAGE_CONFIG_KEY"; + /** + * 短信配置KEY + */ + String SMS_CONFIG_KEY = "SMS_CONFIG_KEY"; + /** + * 邮件配置KEY + */ + String MAIL_CONFIG_KEY = "MAIL_CONFIG_KEY"; + + /** + * 定时任务状态 + */ + enum ScheduleStatus { + /** + * 暂停 + */ + PAUSE(0), + /** + * 正常 + */ + NORMAL(1); + + private int value; + + ScheduleStatus(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + } + + /** + * 云服务商 + */ + enum CloudService { + /** + * 七牛云 + */ + QINIU(1), + /** + * 阿里云 + */ + ALIYUN(2), + /** + * 腾讯云 + */ + QCLOUD(3), + /** + * FASTDFS + */ + FASTDFS(4), + /** + * 本地 + */ + LOCAL(5); + + private int value; + + CloudService(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + } + + /** + * 短信服务商 + */ + enum SmsService { + /** + * 阿里云 + */ + ALIYUN(1), + /** + * 腾讯云 + */ + QCLOUD(2); + + private int value; + + SmsService(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/convert/DateConverter.java b/face-server/src/main/java/com/dkha/server/system/common/convert/DateConverter.java new file mode 100644 index 0000000..2acda8c --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/convert/DateConverter.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.convert; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.convert.converter.Converter; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 日期转换 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class DateConverter implements Converter { + private static final Logger logger = LoggerFactory.getLogger(DateConverter.class); + private static List formatList = new ArrayList<>(5); + static { + formatList.add("yyyy-MM"); + formatList.add("yyyy-MM-dd"); + formatList.add("yyyy-MM-dd hh:mm"); + formatList.add("yyyy-MM-dd hh:mm:ss"); + formatList.add("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + } + + @Override + public Date convert(String source) { + String value = source.trim(); + if (StringUtils.isEmpty(value)) { + return null; + } + + if(source.matches("^\\d{4}-\\d{1,2}$")){ + return parseDate(source, formatList.get(0)); + }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")){ + return parseDate(source, formatList.get(1)); + }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}$")){ + return parseDate(source, formatList.get(2)); + }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")){ + return parseDate(source, formatList.get(3)); + }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}.*T.*\\d{1,2}:\\d{1,2}:\\d{1,2}.*..*$")){ + return parseDate(source, formatList.get(4)); + } else { + throw new IllegalArgumentException("Invalid boolean value '" + source + "'"); + } + } + + /** + * 格式化日期 + * @param dateStr String 字符型日期 + * @param format String 格式 + * @return Date 日期 + */ + public Date parseDate(String dateStr, String format) { + Date date = null; + try { + DateFormat dateFormat = new SimpleDateFormat(format); + date = dateFormat.parse(dateStr); + } catch (Exception e) { + logger.error("Formatted date with date: {} and format : {} ", dateStr, format); + } + return date; + } + +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/dao/BaseDao.java b/face-server/src/main/java/com/dkha/server/system/common/dao/BaseDao.java new file mode 100644 index 0000000..9aeb96f --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/dao/BaseDao.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 基础Dao + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface BaseDao extends BaseMapper { + +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/entity/BaseEntity.java b/face-server/src/main/java/com/dkha/server/system/common/entity/BaseEntity.java new file mode 100644 index 0000000..71ec4cd --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/entity/BaseEntity.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 基础实体类,所有实体都需要继承 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public abstract class BaseEntity implements Serializable { + /** + * id + */ + @TableId(value = "id", type = IdType.ID_WORKER) + private Long id; + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long creator; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createDate; + + + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/entity/CommonEntity.java b/face-server/src/main/java/com/dkha/server/system/common/entity/CommonEntity.java new file mode 100644 index 0000000..2987358 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/entity/CommonEntity.java @@ -0,0 +1,32 @@ +package com.dkha.server.system.common.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +@Data +public class CommonEntity implements Serializable { + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "是否有效 Y有效 N无效 作逻辑删除使用") + private String isValid; + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "创建人") + private String createBy; + @TableField(fill = FieldFill.INSERT_UPDATE) + @ApiModelProperty(value = "更新人") + private String updateBy; + + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + private Date updateTime; +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/exception/ErrorCode.java b/face-server/src/main/java/com/dkha/server/system/common/exception/ErrorCode.java new file mode 100644 index 0000000..c9f2da7 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/exception/ErrorCode.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.exception; + +/** + * 错误编码,由5位数字组成,前2位为模块编码,后3位为业务编码 + *

+ * 如:10001(10代表系统模块,001代表业务代码) + *

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface ErrorCode { + int INTERNAL_SERVER_ERROR = 500; + int UNAUTHORIZED = 401; + int FORBIDDEN = 403; + + int NOT_NULL = 10001; + int DB_RECORD_EXISTS = 10002; + int PARAMS_GET_ERROR = 10003; + int ACCOUNT_PASSWORD_ERROR = 10004; + int ACCOUNT_DISABLE = 10005; + int IDENTIFIER_NOT_NULL = 10006; + int CAPTCHA_ERROR = 10007; + int SUB_MENU_EXIST = 10008; + int PASSWORD_ERROR = 10009; + int ACCOUNT_NOT_EXIST = 10010; + int SUPERIOR_DEPT_ERROR = 10011; + int SUPERIOR_MENU_ERROR = 10012; + int DATA_SCOPE_PARAMS_ERROR = 10013; + int DEPT_SUB_DELETE_ERROR = 10014; + int DEPT_USER_DELETE_ERROR = 10015; + int ACT_DEPLOY_ERROR = 10016; + int ACT_MODEL_IMG_ERROR = 10017; + int ACT_MODEL_EXPORT_ERROR = 10018; + int UPLOAD_FILE_EMPTY = 10019; + int TOKEN_NOT_EMPTY = 10020; + int TOKEN_INVALID = 10021; + int ACCOUNT_LOCK = 10022; + int ACT_DEPLOY_FORMAT_ERROR = 10023; + int OSS_UPLOAD_FILE_ERROR = 10024; + int SEND_SMS_ERROR = 10025; + int MAIL_TEMPLATE_NOT_EXISTS = 10026; + int REDIS_ERROR = 10027; + int JOB_ERROR = 10028; + int INVALID_SYMBOL = 10029; + int JSON_FORMAT_ERROR = 10030; + int SMS_CONFIG = 10031; + int TASK_CLIME_FAIL = 10032; + int NONE_EXIST_PROCESS = 10033; + int SUPERIOR_NOT_EXIST = 10034; + int REJECT_MESSAGE = 10035; + int ROLLBACK_MESSAGE = 10036; + int UNCLAIM_ERROR_MESSAGE = 10037; + int SUPERIOR_REGION_ERROR = 10038; + int REGION_SUB_DELETE_ERROR = 10039; + int PROCESS_START_ERROR = 10040; + int REJECT_PROCESS_PARALLEL_ERROR = 10041; + int REJECT_PROCESS_HANDLEING_ERROR = 10042; + int END_PROCESS_PARALLEL_ERROR = 10043; + int END_PROCESS_HANDLEING_ERROR = 10044; + int END_PROCESS_MESSAGE = 10045; + int BACK_PROCESS_PARALLEL_ERROR = 10046; + int BACK_PROCESS_HANDLEING_ERROR = 10047; + +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/exception/ExceptionUtils.java b/face-server/src/main/java/com/dkha/server/system/common/exception/ExceptionUtils.java new file mode 100644 index 0000000..b044152 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/exception/ExceptionUtils.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.exception; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; + +/** + * Exception工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class ExceptionUtils { + + /** + * 获取异常信息 + * @param ex 异常 + * @return 返回异常信息 + */ + public static String getErrorStackTrace(Exception ex){ + StringWriter sw = null; + PrintWriter pw = null; + try { + sw = new StringWriter(); + pw = new PrintWriter(sw, true); + ex.printStackTrace(pw); + }finally { + try { + if(pw != null) { + pw.close(); + } + } catch (Exception e) { + + } + try { + if(sw != null) { + sw.close(); + } + } catch (IOException e) { + + } + } + + return sw.toString(); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/exception/RenException.java b/face-server/src/main/java/com/dkha/server/system/common/exception/RenException.java new file mode 100644 index 0000000..4229d95 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/exception/RenException.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.exception; + + +import com.dkha.server.system.common.utils.MessageUtils; + +/** + * 自定义异常 + * + * @author Mark sunlightcs@gmail.com + */ +public class RenException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private int code; + private String msg; + + public RenException(int code) { + this.code = code; + this.msg = MessageUtils.getMessage(code); + } + + public RenException(int code, String... params) { + this.code = code; + this.msg = MessageUtils.getMessage(code, params); + } + + public RenException(int code, Throwable e) { + super(e); + this.code = code; + this.msg = MessageUtils.getMessage(code); + } + + public RenException(int code, Throwable e, String... params) { + super(e); + this.code = code; + this.msg = MessageUtils.getMessage(code, params); + } + + public RenException(String msg) { + super(msg); + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = msg; + } + + public RenException(String msg, Throwable e) { + super(msg, e); + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = msg; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/exception/RenExceptionHandler.java b/face-server/src/main/java/com/dkha/server/system/common/exception/RenExceptionHandler.java new file mode 100644 index 0000000..14b0bdb --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/exception/RenExceptionHandler.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.exception; + +import com.alibaba.fastjson.JSON; +import com.dkha.common.exception.EmployeeException; +import com.dkha.common.result.CommonResult; +import com.dkha.common.systemcode.SystemCode; +import com.dkha.common.util.IpUtils; +import com.dkha.server.system.common.utils.HttpContextUtils; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.modules.log.entity.SysLogErrorEntity; +import com.dkha.server.system.modules.log.service.SysLogErrorService; +import org.apache.commons.collections.MapUtils; +import org.apache.shiro.authz.UnauthorizedException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + + +/** + * 异常处理器 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestControllerAdvice +public class RenExceptionHandler { + private static final Logger logger = LoggerFactory.getLogger(RenExceptionHandler.class); + + @Autowired + private SysLogErrorService sysLogErrorService; + + /** + * 处理自定义异常 + */ + @ExceptionHandler(RenException.class) + public Result handleRenException(RenException ex){ + Result result = new Result(); + result.error(ex.getCode(), ex.getMsg()); + + return result; + } + + @ExceptionHandler(DuplicateKeyException.class) + public Result handleDuplicateKeyException(DuplicateKeyException ex){ + Result result = new Result(); + result.error(ErrorCode.DB_RECORD_EXISTS); + + return result; + } + + @ExceptionHandler(UnauthorizedException.class) + public CommonResult handUnauthorizedException(UnauthorizedException exception) { + return new CommonResult().failResult(SystemCode.NOT_AUTHORIZATION.code, SystemCode.NOT_AUTHORIZATION.des, null); + } + + /** + * 保存异常日志 + */ + private void saveLog(Exception ex){ + SysLogErrorEntity log = new SysLogErrorEntity(); + + //请求相关信息 + HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + log.setIp(IpUtils.getIpAddr(request)); + log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); + log.setRequestUri(request.getRequestURI()); + log.setRequestMethod(request.getMethod()); + Map params = HttpContextUtils.getParameterMap(request); + if(MapUtils.isNotEmpty(params)){ + log.setRequestParams(JSON.toJSONString(params)); + } + + //异常信息 + log.setErrorInfo(ExceptionUtils.getErrorStackTrace(ex)); + + //保存 + sysLogErrorService.save(log); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/interceptor/DataFilterInterceptor.java b/face-server/src/main/java/com/dkha/server/system/common/interceptor/DataFilterInterceptor.java new file mode 100644 index 0000000..e60577c --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/interceptor/DataFilterInterceptor.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.interceptor; + +import com.baomidou.mybatisplus.core.toolkit.PluginUtils; +import com.baomidou.mybatisplus.extension.handlers.AbstractSqlParserHandler; +import org.apache.ibatis.executor.statement.StatementHandler; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.SqlCommandType; +import org.apache.ibatis.plugin.*; +import org.apache.ibatis.reflection.MetaObject; +import org.apache.ibatis.reflection.SystemMetaObject; + +import java.sql.Connection; +import java.util.Map; +import java.util.Properties; + +/** + * 数据过滤 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Intercepts({@Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class, Integer.class})}) +public class DataFilterInterceptor extends AbstractSqlParserHandler implements Interceptor { + + @Override + public Object intercept(Invocation invocation) throws Throwable { + StatementHandler statementHandler = (StatementHandler) PluginUtils.realTarget(invocation.getTarget()); + MetaObject metaObject = SystemMetaObject.forObject(statementHandler); + + // SQL解析 + this.sqlParser(metaObject); + + // 先判断是不是SELECT操作 + MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement"); + if (!SqlCommandType.SELECT.equals(mappedStatement.getSqlCommandType())) { + return invocation.proceed(); + } + + // 针对定义了rowBounds,做为mapper接口方法的参数 + BoundSql boundSql = (BoundSql) metaObject.getValue("delegate.boundSql"); + String originalSql = boundSql.getSql(); + Object paramObj = boundSql.getParameterObject(); + + // 判断参数里是否有DataScope对象 + DataScope scope = null; + if (paramObj instanceof DataScope) { + scope = (DataScope) paramObj; + } else if (paramObj instanceof Map) { + for (Object arg : ((Map) paramObj).values()) { + if (arg instanceof DataScope) { + scope = (DataScope) arg; + break; + } + } + } + + // 不用数据过滤 + if(scope == null){ + return invocation.proceed(); + } + + // 拼接新SQL + originalSql = originalSql + scope.getSqlFilter(); + + // 重写SQL + metaObject.setValue("delegate.boundSql.sql", originalSql); + return invocation.proceed(); + } + + @Override + public Object plugin(Object target) { + if (target instanceof StatementHandler) { + return Plugin.wrap(target, this); + } + return target; + } + + @Override + public void setProperties(Properties properties) { + + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/interceptor/DataScope.java b/face-server/src/main/java/com/dkha/server/system/common/interceptor/DataScope.java new file mode 100644 index 0000000..54c75d1 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/interceptor/DataScope.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.interceptor; + +/** + * 数据范围 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class DataScope { + private String sqlFilter; + + public DataScope(String sqlFilter) { + this.sqlFilter = sqlFilter; + } + + public String getSqlFilter() { + return sqlFilter; + } + + public void setSqlFilter(String sqlFilter) { + this.sqlFilter = sqlFilter; + } + + @Override + public String toString() { + return this.sqlFilter; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/page/PageData.java b/face-server/src/main/java/com/dkha/server/system/common/page/PageData.java new file mode 100644 index 0000000..43da0d1 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/page/PageData.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.page; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 分页工具类 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "分页数据") +public class PageData implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "总记录数") + private int total; + + @ApiModelProperty(value = "列表数据") + private List list; + + /** + * 分页 + * @param list 列表数据 + * @param total 总记录数 + */ + public PageData(List list, long total) { + this.list = list; + this.total = (int)total; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/service/BaseService.java b/face-server/src/main/java/com/dkha/server/system/common/service/BaseService.java new file mode 100644 index 0000000..5883728 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/service/BaseService.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; + +import java.io.Serializable; +import java.util.Collection; + +/** + * 基础服务接口,所有Service接口都要继承 + * + * @author Mark sunlightcs@gmail.com + */ +public interface BaseService { + + /** + *

+ * 插入一条记录(选择字段,策略插入) + *

+ * + * @param entity 实体对象 + */ + boolean insert(T entity); + + /** + *

+ * 插入(批量),该方法不支持 Oracle、SQL Server + *

+ * + * @param entityList 实体对象集合 + */ + boolean insertBatch(Collection entityList); + + /** + *

+ * 插入(批量),该方法不支持 Oracle、SQL Server + *

+ * + * @param entityList 实体对象集合 + * @param batchSize 插入批次数量 + */ + boolean insertBatch(Collection entityList, int batchSize); + + /** + *

+ * 根据 ID 选择修改 + *

+ * + * @param entity 实体对象 + */ + boolean updateById(T entity); + + /** + *

+ * 根据 whereEntity 条件,更新记录 + *

+ * + * @param entity 实体对象 + * @param updateWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper} + */ + boolean update(T entity, Wrapper updateWrapper); + + /** + *

+ * 根据ID 批量更新 + *

+ * + * @param entityList 实体对象集合 + */ + boolean updateBatchById(Collection entityList); + + /** + *

+ * 根据ID 批量更新 + *

+ * + * @param entityList 实体对象集合 + * @param batchSize 更新批次数量 + */ + boolean updateBatchById(Collection entityList, int batchSize); + + /** + *

+ * 根据 ID 查询 + *

+ * + * @param id 主键ID + */ + T selectById(Serializable id); + + /** + *

+ * 根据 ID 删除 + *

+ * + * @param id 主键ID + */ + boolean deleteById(Serializable id); + + /** + *

+ * 删除(根据ID 批量删除) + *

+ * + * @param idList 主键ID列表 + */ + boolean deleteBatchIds(Collection idList); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/service/CrudService.java b/face-server/src/main/java/com/dkha/server/system/common/service/CrudService.java new file mode 100644 index 0000000..a1ebcf0 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/service/CrudService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.service; + + + +import com.dkha.server.system.common.page.PageData; + +import java.util.List; +import java.util.Map; + +/** + * CRUD基础服务接口 + * + * @author Mark sunlightcs@gmail.com + */ +public interface CrudService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + D get(Long id); + + void save(D dto); + + void update(D dto); + + void delete(Long[] ids); + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/service/impl/BaseServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/common/service/impl/BaseServiceImpl.java new file mode 100644 index 0000000..2e5abbe --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/service/impl/BaseServiceImpl.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.enums.SqlMethod; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.*; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.common.utils.ConvertUtils; +import org.apache.ibatis.binding.MapperMethod; +import org.apache.ibatis.session.SqlSession; +import org.mybatis.spring.SqlSessionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import java.io.Serializable; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 基础服务类,所有Service都要继承 + * + * @author Mark sunlightcs@gmail.com + */ +public abstract class BaseServiceImpl, T> implements BaseService { + @Autowired + protected M baseDao; + + /** + * 获取分页对象 + * @param params 分页查询参数 + * @param defaultOrderField 默认排序字段 + * @param isAsc 排序方式 + */ + protected IPage getPage(Map params, String defaultOrderField, boolean isAsc) { + //分页参数 + long curPage = 1; + long limit = 10; + + if(params.get(Constant.PAGE) != null){ + curPage = Long.parseLong((String)params.get(Constant.PAGE)); + } + if(params.get(Constant.LIMIT) != null){ + limit = Long.parseLong((String)params.get(Constant.LIMIT)); + } + + //分页对象 + Page page = new Page<>(curPage, limit); + + //分页参数 + params.put(Constant.PAGE, page); + + //排序字段 + String orderField = (String)params.get(Constant.ORDER_FIELD); + String order = (String)params.get(Constant.ORDER); + + //前端字段排序 + if(StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)){ + if(Constant.ASC.equalsIgnoreCase(order)) { + return page.setAsc(orderField); + }else { + return page.setDesc(orderField); + } + } + + //没有排序字段,则不排序 + if(StringUtils.isEmpty(defaultOrderField)){ + return page; + } + + //默认排序 + if(isAsc) { + page.setAsc(defaultOrderField); + }else { + page.setDesc(defaultOrderField); + } + + return page; + } + + protected PageData getPageData(List list, long total, Class target){ + List targetList = ConvertUtils.sourceToTarget(list, target); + + return new PageData<>(targetList, total); + } + + protected PageData getPageData(IPage page, Class target){ + return getPageData(page.getRecords(), page.getTotal(), target); + } + + protected Map paramsToLike(Map params, String... likes){ + for (String like : likes){ + String val = (String)params.get(like); + if (StringUtils.isNotEmpty(val)){ + params.put(like, "%" + val + "%"); + }else { + params.put(like, null); + } + } + return params; + } + + /** + *

+ * 判断数据库操作是否成功 + *

+ *

+ * 注意!! 该方法为 Integer 判断,不可传入 int 基本类型 + *

+ * + * @param result 数据库操作返回影响条数 + * @return boolean + */ + protected static boolean retBool(Integer result) { + return SqlHelper.retBool(result); + } + + protected Class currentModelClass() { + return (Class) ReflectionKit.getSuperClassGenericType(getClass(), 1); + } + + /** + *

+ * 批量操作 SqlSession + *

+ */ + protected SqlSession sqlSessionBatch() { + return SqlHelper.sqlSessionBatch(currentModelClass()); + } + + /** + * 释放sqlSession + * @param sqlSession session + */ + protected void closeSqlSession(SqlSession sqlSession){ + SqlSessionUtils.closeSqlSession(sqlSession, GlobalConfigUtils.currentSessionFactory(currentModelClass())); + } + + /** + * 获取SqlStatement + * + * @param sqlMethod + * @return + */ + protected String sqlStatement(SqlMethod sqlMethod) { + return SqlHelper.table(currentModelClass()).getSqlStatement(sqlMethod.getMethod()); + } + + @Override + public boolean insert(T entity) { + return BaseServiceImpl.retBool(baseDao.insert(entity)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean insertBatch(Collection entityList) { + return insertBatch(entityList, 100); + } + + /** + * 批量插入 + * + * @param entityList + * @param batchSize + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public boolean insertBatch(Collection entityList, int batchSize) { + SqlSession batchSqlSession = sqlSessionBatch(); + int i = 0; + String sqlStatement = sqlStatement(SqlMethod.INSERT_ONE); + try { + for (T anEntityList : entityList) { + batchSqlSession.insert(sqlStatement, anEntityList); + if (i >= 1 && i % batchSize == 0) { + batchSqlSession.flushStatements(); + } + i++; + } + batchSqlSession.flushStatements(); + }finally { + closeSqlSession(batchSqlSession); + } + return true; + } + + @Override + public boolean updateById(T entity) { + return BaseServiceImpl.retBool(baseDao.updateById(entity)); + } + + @Override + public boolean update(T entity, Wrapper updateWrapper) { + return BaseServiceImpl.retBool(baseDao.update(entity, updateWrapper)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateBatchById(Collection entityList) { + return updateBatchById(entityList, 30); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateBatchById(Collection entityList, int batchSize) { + if (CollectionUtils.isEmpty(entityList)) { + throw new IllegalArgumentException("Error: entityList must not be empty"); + } + SqlSession batchSqlSession = sqlSessionBatch(); + int i = 0; + String sqlStatement = sqlStatement(SqlMethod.UPDATE_BY_ID); + try { + for (T anEntityList : entityList) { + MapperMethod.ParamMap param = new MapperMethod.ParamMap<>(); + param.put(Constants.ENTITY, anEntityList); + batchSqlSession.update(sqlStatement, param); + if (i >= 1 && i % batchSize == 0) { + batchSqlSession.flushStatements(); + } + i++; + } + batchSqlSession.flushStatements(); + }finally { + closeSqlSession(batchSqlSession); + } + return true; + } + + @Override + public T selectById(Serializable id) { + return baseDao.selectById(id); + } + + @Override + public boolean deleteById(Serializable id) { + return SqlHelper.delBool(baseDao.deleteById(id)); + } + + @Override + public boolean deleteBatchIds(Collection idList) { + return SqlHelper.delBool(baseDao.deleteBatchIds(idList)); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/service/impl/CrudServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/common/service/impl/CrudServiceImpl.java new file mode 100644 index 0000000..2bde4c3 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/service/impl/CrudServiceImpl.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.ReflectionKit; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.CrudService; +import com.dkha.server.system.common.utils.ConvertUtils; +import org.springframework.beans.BeanUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * CRUD基础服务类 + * + * @author Mark sunlightcs@gmail.com + */ +public abstract class CrudServiceImpl, T, D> extends BaseServiceImpl implements CrudService { + + protected Class currentDtoClass() { + return (Class) ReflectionKit.getSuperClassGenericType(getClass(), 2); + } + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, null, false), + getWrapper(params) + ); + + return getPageData(page, currentDtoClass()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, currentDtoClass()); + } + + public abstract QueryWrapper getWrapper(Map params); + + @Override + public D get(Long id) { + T entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, currentDtoClass()); + } + + @Override + public void save(D dto) { + T entity = ConvertUtils.sourceToTarget(dto, currentModelClass()); + insert(entity); + + //copy主键值到dto + BeanUtils.copyProperties(entity, dto); + } + + @Override + public void update(D dto) { + T entity = ConvertUtils.sourceToTarget(dto, currentModelClass()); + updateById(entity); + } + + @Override + public void delete(Long[] ids) { + baseDao.deleteBatchIds(Arrays.asList(ids)); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/utils/ConvertUtils.java b/face-server/src/main/java/com/dkha/server/system/common/utils/ConvertUtils.java new file mode 100644 index 0000000..914616d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/utils/ConvertUtils.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.utils; + +import com.dkha.common.util.UtilValidate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * 转换工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class ConvertUtils { + private static Logger logger = LoggerFactory.getLogger(ConvertUtils.class); + + public static T sourceToTarget(Object source, Class target){ + if(source == null){ + return null; + } + T targetObject = null; + try { + targetObject = target.newInstance(); + BeanUtils.copyProperties(source, targetObject); + } catch (Exception e) { + logger.error("convert error ", e); + } + + return targetObject; + } + + public static List sourceToTarget(Collection sourceList, Class target){ + if(sourceList == null){ + return null; + } + + List targetList = new ArrayList<>(sourceList.size()); + try { + for(Object source : sourceList){ + T targetObject = target.newInstance(); + if (UtilValidate.isNotEmpty(source)) { + BeanUtils.copyProperties(source, targetObject); + } + targetList.add(targetObject); + } + }catch (Exception e){ + logger.error("convert error ", e); + } + + return targetList; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/utils/DateUtils.java b/face-server/src/main/java/com/dkha/server/system/common/utils/DateUtils.java new file mode 100644 index 0000000..d297611 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/utils/DateUtils.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.utils; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * 日期处理 + * + * @author Mark sunlightcs@gmail.com + */ +public class DateUtils { + /** 时间格式(yyyy-MM-dd) */ + public final static String DATE_PATTERN = "yyyy-MM-dd"; + /** 时间格式(yyyy-MM-dd HH:mm:ss) */ + public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; + + /** + * 日期格式化 日期格式为:yyyy-MM-dd + * @param date 日期 + * @return 返回yyyy-MM-dd格式日期 + */ + public static String format(Date date) { + return format(date, DATE_PATTERN); + } + + /** + * 日期格式化 日期格式为:yyyy-MM-dd + * @param date 日期 + * @param pattern 格式,如:DateUtils.DATE_TIME_PATTERN + * @return 返回yyyy-MM-dd格式日期 + */ + public static String format(Date date, String pattern) { + if(date != null){ + SimpleDateFormat df = new SimpleDateFormat(pattern); + return df.format(date); + } + return null; + } + + /** + * 日期解析 + * @param date 日期 + * @param pattern 格式,如:DateUtils.DATE_TIME_PATTERN + * @return 返回Date + */ + public static Date parse(String date, String pattern) { + try { + return new SimpleDateFormat(pattern).parse(date); + } catch (ParseException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 字符串转换成日期 + * @param strDate 日期字符串 + * @param pattern 日期的格式,如:DateUtils.DATE_TIME_PATTERN + */ + public static Date stringToDate(String strDate, String pattern) { + if (StringUtils.isBlank(strDate)){ + return null; + } + + DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern); + return fmt.parseLocalDateTime(strDate).toDate(); + } + + /** + * 根据周数,获取开始日期、结束日期 + * @param week 周期 0本周,-1上周,-2上上周,1下周,2下下周 + * @return 返回date[0]开始日期、date[1]结束日期 + */ + public static Date[] getWeekStartAndEnd(int week) { + DateTime dateTime = new DateTime(); + LocalDate date = new LocalDate(dateTime.plusWeeks(week)); + + date = date.dayOfWeek().withMinimumValue(); + Date beginDate = date.toDate(); + Date endDate = date.plusDays(6).toDate(); + return new Date[]{beginDate, endDate}; + } + + /** + * 对日期的【秒】进行加/减 + * + * @param date 日期 + * @param seconds 秒数,负数为减 + * @return 加/减几秒后的日期 + */ + public static Date addDateSeconds(Date date, int seconds) { + DateTime dateTime = new DateTime(date); + return dateTime.plusSeconds(seconds).toDate(); + } + + /** + * 对日期的【分钟】进行加/减 + * + * @param date 日期 + * @param minutes 分钟数,负数为减 + * @return 加/减几分钟后的日期 + */ + public static Date addDateMinutes(Date date, int minutes) { + DateTime dateTime = new DateTime(date); + return dateTime.plusMinutes(minutes).toDate(); + } + + /** + * 对日期的【小时】进行加/减 + * + * @param date 日期 + * @param hours 小时数,负数为减 + * @return 加/减几小时后的日期 + */ + public static Date addDateHours(Date date, int hours) { + DateTime dateTime = new DateTime(date); + return dateTime.plusHours(hours).toDate(); + } + + /** + * 对日期的【天】进行加/减 + * + * @param date 日期 + * @param days 天数,负数为减 + * @return 加/减几天后的日期 + */ + public static Date addDateDays(Date date, int days) { + DateTime dateTime = new DateTime(date); + return dateTime.plusDays(days).toDate(); + } + + /** + * 对日期的【周】进行加/减 + * + * @param date 日期 + * @param weeks 周数,负数为减 + * @return 加/减几周后的日期 + */ + public static Date addDateWeeks(Date date, int weeks) { + DateTime dateTime = new DateTime(date); + return dateTime.plusWeeks(weeks).toDate(); + } + + /** + * 对日期的【月】进行加/减 + * + * @param date 日期 + * @param months 月数,负数为减 + * @return 加/减几月后的日期 + */ + public static Date addDateMonths(Date date, int months) { + DateTime dateTime = new DateTime(date); + return dateTime.plusMonths(months).toDate(); + } + + /** + * 对日期的【年】进行加/减 + * + * @param date 日期 + * @param years 年数,负数为减 + * @return 加/减几年后的日期 + */ + public static Date addDateYears(Date date, int years) { + DateTime dateTime = new DateTime(date); + return dateTime.plusYears(years).toDate(); + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/utils/ExcelUtils.java b/face-server/src/main/java/com/dkha/server/system/common/utils/ExcelUtils.java new file mode 100644 index 0000000..93ab162 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/utils/ExcelUtils.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.utils; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.BeanUtils; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +/** + * excel工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class ExcelUtils { + + /** + * Excel导出 + * + * @param response response + * @param fileName 文件名 + * @param list 数据List + * @param pojoClass 对象Class + */ + public static void exportExcel(HttpServletResponse response, String fileName, Collection list, + Class pojoClass) throws IOException { + if(StringUtils.isBlank(fileName)){ + //当前日期 + fileName = DateUtils.format(new Date()); + } + + Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), pojoClass, list); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls"); + ServletOutputStream out = response.getOutputStream(); + workbook.write(out); + out.flush(); + } + + /** + * Excel导出,先sourceList转换成List,再导出 + * + * @param response response + * @param fileName 文件名 + * @param sourceList 原数据List + * @param targetClass 目标对象Class + */ + public static void exportExcelToTarget(HttpServletResponse response, String fileName, Collection sourceList, + Class targetClass) throws Exception { + List targetList = new ArrayList<>(sourceList.size()); + for(Object source : sourceList){ + Object target = targetClass.newInstance(); + BeanUtils.copyProperties(source, target); + targetList.add(target); + } + + exportExcel(response, fileName, targetList, targetClass); + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/utils/HttpContextUtils.java b/face-server/src/main/java/com/dkha/server/system/common/utils/HttpContextUtils.java new file mode 100644 index 0000000..10fa084 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/utils/HttpContextUtils.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.utils; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; + +/** + * Http + * + * @author Mark sunlightcs@gmail.com + */ +public class HttpContextUtils { + + public static HttpServletRequest getHttpServletRequest() { + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + if(requestAttributes == null){ + return null; + } + + return ((ServletRequestAttributes) requestAttributes).getRequest(); + } + + public static Map getParameterMap(HttpServletRequest request) { + Enumeration parameters = request.getParameterNames(); + + Map params = new HashMap<>(); + while (parameters.hasMoreElements()) { + String parameter = parameters.nextElement(); + String value = request.getParameter(parameter); + if (StringUtils.isNotBlank(value)) { + params.put(parameter, value); + } + } + + return params; + } + + public static String getDomain(){ + HttpServletRequest request = getHttpServletRequest(); + StringBuffer url = request.getRequestURL(); + return url.delete(url.length() - request.getRequestURI().length(), url.length()).toString(); + } + + public static String getOrigin(){ + HttpServletRequest request = getHttpServletRequest(); + return request.getHeader(HttpHeaders.ORIGIN); + } + + public static String getLanguage() { + //默认语言 + String defaultLanguage = "zh-CN"; + //request + HttpServletRequest request = getHttpServletRequest(); + if(request == null){ + return defaultLanguage; + } + + //请求语言 + defaultLanguage = request.getHeader(HttpHeaders.ACCEPT_LANGUAGE); + + return defaultLanguage; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/utils/IpUtils.java b/face-server/src/main/java/com/dkha/server/system/common/utils/IpUtils.java new file mode 100644 index 0000000..0a9bae1 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/utils/IpUtils.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.utils; + +import com.dkha.common.util.UtilValidate; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.http.HttpServletRequest; + +/** + * IP地址 + * + * @author Mark sunlightcs@gmail.com + */ +public class IpUtils { + private static Logger logger = LoggerFactory.getLogger(IpUtils.class); + + /** + * 获取IP地址 + * + * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址 + * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址 + */ + public static String getIpAddr(HttpServletRequest request) { + String unknown = "unknown"; + String ip = null; + try { + ip = request.getHeader("x-forwarded-for"); + //nginx代理存在的情况下 + if (UtilValidate.isNotEmpty(ip) && ip.contains(",")) { + ip = ip.split(",")[0]; + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (StringUtils.isEmpty(ip) || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + } catch (Exception e) { + logger.error("IPUtils ERROR ", e); + } + + return ip; + } + +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/utils/MessageUtils.java b/face-server/src/main/java/com/dkha/server/system/common/utils/MessageUtils.java new file mode 100644 index 0000000..ed30d43 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/utils/MessageUtils.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.utils; + +import com.dkha.common.util.SpringContextUtils; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class MessageUtils { + private static MessageSource messageSource; + static { + messageSource = (MessageSource) SpringContextUtils.getBean("messageSource"); + } + + public static String getMessage(int code){ + return getMessage(code, new String[0]); + } + + public static String getMessage(int code, String... params){ + return messageSource.getMessage(code+"", params, LocaleContextHolder.getLocale()); + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/utils/Result.java b/face-server/src/main/java/com/dkha/server/system/common/utils/Result.java new file mode 100644 index 0000000..b349824 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/utils/Result.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.utils; + +import com.dkha.server.system.common.exception.ErrorCode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; + +/** + * 响应数据 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@ApiModel(value = "响应") +public class Result implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 编码:0表示成功,其他值表示失败 + */ + @ApiModelProperty(value = "编码:0表示成功,其他值表示失败") + private int code = 0; + /** + * 消息内容 + */ + @ApiModelProperty(value = "消息内容") + private String msg = "success"; + /** + * 响应数据 + */ + @ApiModelProperty(value = "响应数据") + private T data; + + public Result ok(T data) { + this.setData(data); + return this; + } + + public boolean success(){ + return code == 0 ? true : false; + } + + public Result error() { + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = MessageUtils.getMessage(this.code); + return this; + } + + public Result error(int code) { + this.code = code; + this.msg = MessageUtils.getMessage(this.code); + return this; + } + + public Result error(int code, String msg) { + this.code = code; + this.msg = msg; + return this; + } + + public Result error(String msg) { + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = msg; + return this; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/utils/TreeNode.java b/face-server/src/main/java/com/dkha/server/system/common/utils/TreeNode.java new file mode 100644 index 0000000..65c1382 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/utils/TreeNode.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.utils; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 树节点,所有需要实现树节点的,都需要继承该类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class TreeNode implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + private Long id; + /** + * 上级ID + */ + private Long pid; + /** + * 子节点列表 + */ + private List children = new ArrayList<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPid() { + return pid; + } + + public void setPid(Long pid) { + this.pid = pid; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/utils/TreeUtils.java b/face-server/src/main/java/com/dkha/server/system/common/utils/TreeUtils.java new file mode 100644 index 0000000..960ba0d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/utils/TreeUtils.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.utils; + + +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.validator.AssertUtils; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * 树形结构工具类,如:菜单、部门等 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class TreeUtils { + + /** + * 根据pid,构建树节点 + */ + public static List build(List treeNodes, Long pid) { + //pid不能为空 + AssertUtils.isNull(pid, "pid"); + + List treeList = new ArrayList<>(); + for(T treeNode : treeNodes) { + if (pid.equals(treeNode.getPid())) { + treeList.add(findChildren(treeNodes, treeNode)); + } + } + + return treeList; + } + + /** + * 查找子节点 + */ + private static T findChildren(List treeNodes, T rootNode) { + for(T treeNode : treeNodes) { + if(rootNode.getId().equals(treeNode.getPid())) { + rootNode.getChildren().add(findChildren(treeNodes, treeNode)); + } + } + return rootNode; + } + + /** + * 构建树节点 + */ + public static List build(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(T treeNode : treeNodes){ + nodeMap.put(treeNode.getId(), treeNode); + } + + for(T node : nodeMap.values()) { + T parent = nodeMap.get(node.getPid()); + if(parent != null && UtilValidate.isNotEmpty(node.getId()) && !(node.getId().equals(parent.getId()))){ + parent.getChildren().add(node); + continue; + } + if (UtilValidate.isNotEmpty(node.getId())) { + result.add(node); + } + } + + return result; + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/AssertUtils.java b/face-server/src/main/java/com/dkha/server/system/common/validator/AssertUtils.java new file mode 100644 index 0000000..ad87b0a --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/AssertUtils.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator; + +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.exception.RenException; +import org.apache.commons.lang3.StringUtils; + +import java.util.List; +import java.util.Map; + +/** + * 校验工具类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class AssertUtils { + + public static void isBlank(String str, String... params) { + isBlank(str, ErrorCode.NOT_NULL, params); + } + + public static void isBlank(String str, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if (StringUtils.isBlank(str)) { + throw new RenException(code, params); + } + } + + public static void isNull(Object object, String... params) { + isNull(object, ErrorCode.NOT_NULL, params); + } + + public static void isNull(Object object, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if (object == null) { + throw new RenException(code, params); + } + } + + public static void isArrayEmpty(Object[] array, String... params) { + isArrayEmpty(array, ErrorCode.NOT_NULL, params); + } + + public static void isArrayEmpty(Object[] array, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if(UtilValidate.isEmpty(array)){ + throw new RenException(code, params); + } + } + + public static void isListEmpty(List list, String... params) { + isListEmpty(list, ErrorCode.NOT_NULL, params); + } + + public static void isListEmpty(List list, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if(UtilValidate.isEmpty(list)){ + throw new RenException(code, params); + } + } + + public static void isMapEmpty(Map map, String... params) { + isMapEmpty(map, ErrorCode.NOT_NULL, params); + } + + public static void isMapEmpty(Map map, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if(UtilValidate.isEmpty(map)){ + throw new RenException(code, params); + } + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/ValidatorUtils.java b/face-server/src/main/java/com/dkha/server/system/common/validator/ValidatorUtils.java new file mode 100644 index 0000000..d4a3d7a --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/ValidatorUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator; + +import com.dkha.server.system.common.exception.RenException; +import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.validation.beanvalidation.MessageSourceResourceBundleLocator; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import java.util.Locale; +import java.util.Set; + +/** + * hibernate-validator校验工具类 + * 参考文档:http://docs.jboss.org/hibernate/validator/6.0/reference/en-US/html_single/ + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class ValidatorUtils { + + private static ResourceBundleMessageSource getMessageSource() { + ResourceBundleMessageSource bundleMessageSource = new ResourceBundleMessageSource(); + bundleMessageSource.setDefaultEncoding("UTF-8"); + bundleMessageSource.setBasenames("i18n/validation"); + return bundleMessageSource; + } + + /** + * 校验对象 + * @param object 待校验对象 + * @param groups 待校验的组 + */ + public static void validateEntity(Object object, Class... groups) + throws RenException { + Locale.setDefault(LocaleContextHolder.getLocale()); + Validator validator = Validation.byDefaultProvider().configure().messageInterpolator( + new ResourceBundleMessageInterpolator(new MessageSourceResourceBundleLocator(getMessageSource()))) + .buildValidatorFactory().getValidator(); + + Set> constraintViolations = validator.validate(object, groups); + if (!constraintViolations.isEmpty()) { + ConstraintViolation constraint = constraintViolations.iterator().next(); + throw new RenException(constraint.getMessage()); + } + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/AddGroup.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/AddGroup.java new file mode 100644 index 0000000..bfc7ea1 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/AddGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +/** + * 新增 Group + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface AddGroup { + +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/AliyunGroup.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/AliyunGroup.java new file mode 100644 index 0000000..4666b48 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/AliyunGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +/** + * 阿里云 + * + * @author Mark sunlightcs@gmail.com + */ +public interface AliyunGroup { +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/DefaultGroup.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/DefaultGroup.java new file mode 100644 index 0000000..2a90285 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/DefaultGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +/** + * 默认 Group + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface DefaultGroup { + +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/FastDFSGroup.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/FastDFSGroup.java new file mode 100644 index 0000000..c3f2f9c --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/FastDFSGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +/** + * FastDFS + * + * @author Mark sunlightcs@gmail.com + */ +public interface FastDFSGroup { +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/Group.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/Group.java new file mode 100644 index 0000000..533cc52 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/Group.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +import javax.validation.GroupSequence; + +/** + * 定义校验顺序,如果AddGroup组失败,则UpdateGroup组不会再校验 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@GroupSequence({AddGroup.class, UpdateGroup.class}) +public interface Group { + +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/LocalGroup.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/LocalGroup.java new file mode 100644 index 0000000..4b6991c --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/LocalGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +/** + * 本地上传 + * + * @author Mark sunlightcs@gmail.com + */ +public interface LocalGroup { +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/QcloudGroup.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/QcloudGroup.java new file mode 100644 index 0000000..dafee40 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/QcloudGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +/** + * 腾讯云 + * + * @author Mark sunlightcs@gmail.com + */ +public interface QcloudGroup { +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/QiniuGroup.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/QiniuGroup.java new file mode 100644 index 0000000..de9611c --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/QiniuGroup.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +/** + * 七牛 + * + * @author Mark sunlightcs@gmail.com + */ +public interface QiniuGroup { +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/TreeNode.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/TreeNode.java new file mode 100644 index 0000000..6db399a --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/TreeNode.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 树节点,所有需要实现树节点的,都需要继承该类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class TreeNode implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + private Long id; + /** + * 上级ID + */ + private Long pid; + /** + * 子节点列表 + */ + private List children = new ArrayList<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPid() { + return pid; + } + + public void setPid(Long pid) { + this.pid = pid; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/validator/group/UpdateGroup.java b/face-server/src/main/java/com/dkha/server/system/common/validator/group/UpdateGroup.java new file mode 100644 index 0000000..6526524 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/validator/group/UpdateGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.validator.group; + +/** + * 修改 Group + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface UpdateGroup { + +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/xss/SqlFilter.java b/face-server/src/main/java/com/dkha/server/system/common/xss/SqlFilter.java new file mode 100644 index 0000000..c8dc6c3 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/xss/SqlFilter.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.xss; + +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.exception.RenException; +import org.apache.commons.lang3.StringUtils; + +/** + * SQL过滤 + * @author Mark sunlightcs@gmail.com + */ +public class SqlFilter { + + /** + * SQL注入过滤 + * @param str 待验证的字符串 + */ + public static String sqlInject(String str){ + if(StringUtils.isBlank(str)){ + return null; + } + //去掉'|"|;|\字符 + str = StringUtils.replace(str, "'", ""); + str = StringUtils.replace(str, "\"", ""); + str = StringUtils.replace(str, ";", ""); + str = StringUtils.replace(str, "\\", ""); + + //转换成小写 + str = str.toLowerCase(); + + //非法字符 + String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; + + //判断是否包含非法字符 + for(String keyword : keywords){ + if(str.indexOf(keyword) != -1){ + throw new RenException(ErrorCode.INVALID_SYMBOL); + } + } + + return str; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/common/xss/XssFilter.java b/face-server/src/main/java/com/dkha/server/system/common/xss/XssFilter.java new file mode 100644 index 0000000..323cff9 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/xss/XssFilter.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.xss; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + +/** + * XSS过滤 + * @author Mark sunlightcs@gmail.com + */ +public class XssFilter implements Filter { + + @Override + public void init(FilterConfig config) throws ServletException { + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper( + (HttpServletRequest) request); + chain.doFilter(xssRequest, response); + } + + @Override + public void destroy() { + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/xss/XssHttpServletRequestWrapper.java b/face-server/src/main/java/com/dkha/server/system/common/xss/XssHttpServletRequestWrapper.java new file mode 100644 index 0000000..c094111 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/xss/XssHttpServletRequestWrapper.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.xss; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; + +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.LinkedHashMap; +import java.util.Map; + + +/** + * XSS过滤处理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { + HttpServletRequest orgRequest; + + public XssHttpServletRequestWrapper(HttpServletRequest request) { + super(request); + orgRequest = request; + } + + @Override + public ServletInputStream getInputStream() throws IOException { + //非json类型,直接返回 + if(!MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(super.getHeader(HttpHeaders.CONTENT_TYPE))){ + return super.getInputStream(); + } + + //为空,直接返回 + String json = IOUtils.toString(super.getInputStream(), StandardCharsets.UTF_8); + if (StringUtils.isBlank(json)) { + return super.getInputStream(); + } + + //xss过滤 + json = xssEncode(json); + final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)); + return new ServletInputStream() { + @Override + public boolean isFinished() { + return true; + } + + @Override + public boolean isReady() { + return true; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + + @Override + public int read() { + return bis.read(); + } + }; + } + + @Override + public String getParameter(String name) { + String value = super.getParameter(xssEncode(name)); + if (StringUtils.isNotBlank(value)) { + value = xssEncode(value); + } + return value; + } + + @Override + public String[] getParameterValues(String name) { + String[] parameters = super.getParameterValues(name); + if (parameters == null || parameters.length == 0) { + return null; + } + + for (int i = 0; i < parameters.length; i++) { + parameters[i] = xssEncode(parameters[i]); + } + return parameters; + } + + @Override + public Map getParameterMap() { + Map map = new LinkedHashMap<>(); + Map parameters = super.getParameterMap(); + for (String key : parameters.keySet()) { + String[] values = parameters.get(key); + for (int i = 0; i < values.length; i++) { + values[i] = xssEncode(values[i]); + } + map.put(key, values); + } + return map; + } + + @Override + public String getHeader(String name) { + String value = super.getHeader(xssEncode(name)); + if (StringUtils.isNotBlank(value)) { + value = xssEncode(value); + } + return value; + } + + private String xssEncode(String input) { + return XssUtils.filter(input); + } + + /** + * 获取最原始的request + */ + public HttpServletRequest getOrgRequest() { + return orgRequest; + } + + /** + * 获取最原始的request + */ + public static HttpServletRequest getOrgRequest(HttpServletRequest request) { + if (request instanceof XssHttpServletRequestWrapper) { + return ((XssHttpServletRequestWrapper) request).getOrgRequest(); + } + + return request; + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/common/xss/XssUtils.java b/face-server/src/main/java/com/dkha/server/system/common/xss/XssUtils.java new file mode 100644 index 0000000..92f8155 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/common/xss/XssUtils.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.common.xss; + +import org.jsoup.Jsoup; +import org.jsoup.safety.Whitelist; + +/** + * XSS过滤工具类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class XssUtils extends Whitelist { + + /** + * XSS过滤 + */ + public static String filter(String html){ + return Jsoup.clean(html, xssWhitelist()); + } + + /** + * XSS过滤白名单 + */ + private static Whitelist xssWhitelist(){ + return new Whitelist() + //支持的标签 + .addTags("a", "b", "blockquote", "br", "caption", "cite", "code", "col", "colgroup", "dd", "div", "dl", + "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "i", "img", "li", "ol", "p", "pre", "q", "small", + "strike", "strong","sub", "sup", "table", "tbody", "td","tfoot", "th", "thead", "tr", "u","ul", + "embed","object","param","span") + + //支持的标签属性 + .addAttributes("a", "href", "class", "style", "target", "rel", "nofollow") + .addAttributes("blockquote", "cite") + .addAttributes("code", "class", "style") + .addAttributes("col", "span", "width") + .addAttributes("colgroup", "span", "width") + .addAttributes("img", "align", "alt", "height", "src", "title", "width", "class", "style") + .addAttributes("ol", "start", "type") + .addAttributes("q", "cite") + .addAttributes("table", "summary", "width", "class", "style") + .addAttributes("tr", "abbr", "axis", "colspan", "rowspan", "width", "style") + .addAttributes("td", "abbr", "axis", "colspan", "rowspan", "width", "style") + .addAttributes("th", "abbr", "axis", "colspan", "rowspan", "scope","width", "style") + .addAttributes("ul", "type", "style") + .addAttributes("pre", "class", "style") + .addAttributes("div", "class", "id", "style") + .addAttributes("embed", "src", "wmode", "flashvars", "pluginspage", "allowFullScreen", "allowfullscreen", + "quality", "width", "height", "align", "allowScriptAccess", "allowscriptaccess", "allownetworking", "type") + .addAttributes("object", "type", "id", "name", "data", "width", "height", "style", "classid", "codebase") + .addAttributes("param", "name", "value") + .addAttributes("span", "class", "style") + + //标签属性对应的协议 + .addProtocols("a", "href", "ftp", "http", "https", "mailto") + .addProtocols("img", "src", "http", "https") + .addProtocols("blockquote", "cite", "http", "https") + .addProtocols("cite", "cite", "http", "https") + .addProtocols("q", "cite", "http", "https") + .addProtocols("embed", "src", "http", "https"); + } + + public static void main(String[] args) { + StringBuilder html = new StringBuilder(); + html.append("人人开源"); + + System.out.println(filter(html.toString())); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/controller/SysLogErrorController.java b/face-server/src/main/java/com/dkha/server/system/modules/log/controller/SysLogErrorController.java new file mode 100644 index 0000000..0835177 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/controller/SysLogErrorController.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.utils.ExcelUtils; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.modules.log.dto.SysLogErrorDTO; +import com.dkha.server.system.modules.log.excel.SysLogErrorExcel; +import com.dkha.server.system.modules.log.service.SysLogErrorService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("sys/log/error") +@Api(tags="异常日志") +public class SysLogErrorController { + @Autowired + private SysLogErrorService sysLogErrorService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:log:error") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysLogErrorService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("sys:log:error") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysLogErrorService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysLogErrorExcel.class); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/controller/SysLogLoginController.java b/face-server/src/main/java/com/dkha/server/system/modules/log/controller/SysLogLoginController.java new file mode 100644 index 0000000..13e571a --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/controller/SysLogLoginController.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.utils.ExcelUtils; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.modules.log.dto.SysLogLoginDTO; +import com.dkha.server.system.modules.log.excel.SysLogLoginExcel; +import com.dkha.server.system.modules.log.service.SysLogLoginService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("sys/log/login") +@Api(tags="登录日志") +public class SysLogLoginController { + @Autowired + private SysLogLoginService sysLogLoginService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功 2:账号已锁定", paramType = "query", dataType="int"), + @ApiImplicitParam(name = "creatorName", value = "用户名", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:log:login") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysLogLoginService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @ApiImplicitParams({ + @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功 2:账号已锁定", paramType = "query", dataType="int"), + @ApiImplicitParam(name = "creatorName", value = "用户名", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:log:login") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysLogLoginService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysLogLoginExcel.class); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/controller/SysLogOperationController.java b/face-server/src/main/java/com/dkha/server/system/modules/log/controller/SysLogOperationController.java new file mode 100644 index 0000000..5376cc9 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/controller/SysLogOperationController.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.utils.ExcelUtils; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.modules.log.dto.SysLogOperationDTO; +import com.dkha.server.system.modules.log.excel.SysLogOperationExcel; +import com.dkha.server.system.modules.log.service.SysLogOperationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("sys/log/operation") +@Api(tags="操作日志") +public class SysLogOperationController { + @Autowired + private SysLogOperationService sysLogOperationService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功", paramType = "query", dataType="int") + }) + @RequiresPermissions("sys:log:operation") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysLogOperationService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("sys:log:operation") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysLogOperationService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysLogOperationExcel.class); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/dao/SysLogErrorDao.java b/face-server/src/main/java/com/dkha/server/system/modules/log/dao/SysLogErrorDao.java new file mode 100644 index 0000000..a7e1161 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/dao/SysLogErrorDao.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.log.entity.SysLogErrorEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysLogErrorDao extends BaseDao { + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/dao/SysLogLoginDao.java b/face-server/src/main/java/com/dkha/server/system/modules/log/dao/SysLogLoginDao.java new file mode 100644 index 0000000..5ef5b3b --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/dao/SysLogLoginDao.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.log.entity.SysLogLoginEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysLogLoginDao extends BaseDao { + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/dao/SysLogOperationDao.java b/face-server/src/main/java/com/dkha/server/system/modules/log/dao/SysLogOperationDao.java new file mode 100644 index 0000000..f4d9c7a --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/dao/SysLogOperationDao.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.log.entity.SysLogOperationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysLogOperationDao extends BaseDao { + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/dto/SysLogErrorDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/log/dto/SysLogErrorDTO.java new file mode 100644 index 0000000..4fabea9 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/dto/SysLogErrorDTO.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "异常日志") +public class SysLogErrorDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + private Long id; + @ApiModelProperty(value = "请求URI") + private String requestUri; + @ApiModelProperty(value = "请求方式") + private String requestMethod; + @ApiModelProperty(value = "请求参数") + private String requestParams; + @ApiModelProperty(value = "用户代理") + private String userAgent; + @ApiModelProperty(value = "操作IP") + private String ip; + @ApiModelProperty(value = "异常信息") + private String errorInfo; + @ApiModelProperty(value = "创建时间") + private Date createDate; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/dto/SysLogLoginDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/log/dto/SysLogLoginDTO.java new file mode 100644 index 0000000..28cd591 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/dto/SysLogLoginDTO.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "登录日志") +public class SysLogLoginDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "用户操作 0:用户登录 1:用户退出") + private Integer operation; + + @ApiModelProperty(value = "状态 0:失败 1:成功 2:账号已锁定") + private Integer status; + + @ApiModelProperty(value = "用户代理") + private String userAgent; + + @ApiModelProperty(value = "操作IP") + private String ip; + + @ApiModelProperty(value = "用户名") + private String creatorName; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/dto/SysLogOperationDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/log/dto/SysLogOperationDTO.java new file mode 100644 index 0000000..3678a7b --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/dto/SysLogOperationDTO.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "操作日志") +public class SysLogOperationDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "用户操作") + private String operation; + + @ApiModelProperty(value = "请求URI") + private String requestUri; + + @ApiModelProperty(value = "请求方式") + private String requestMethod; + + @ApiModelProperty(value = "请求参数") + private String requestParams; + + @ApiModelProperty(value = "请求时长(毫秒)") + private Integer requestTime; + + @ApiModelProperty(value = "用户代理") + private String userAgent; + + @ApiModelProperty(value = "操作IP") + private String ip; + + @ApiModelProperty(value = "状态 0:失败 1:成功") + private Integer status; + + @ApiModelProperty(value = "用户名") + private String creatorName; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/entity/SysLogErrorEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/log/entity/SysLogErrorEntity.java new file mode 100644 index 0000000..7368651 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/entity/SysLogErrorEntity.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_log_error") +public class SysLogErrorEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 请求URI + */ + private String requestUri; + /** + * 请求方式 + */ + private String requestMethod; + /** + * 请求参数 + */ + private String requestParams; + /** + * 用户代理 + */ + private String userAgent; + /** + * 操作IP + */ + private String ip; + /** + * 异常信息 + */ + private String errorInfo; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/entity/SysLogLoginEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/log/entity/SysLogLoginEntity.java new file mode 100644 index 0000000..eb1211d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/entity/SysLogLoginEntity.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_log_login") +public class SysLogLoginEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 用户操作 0:用户登录 1:用户退出 + */ + private Integer operation; + /** + * 状态 0:失败 1:成功 2:账号已锁定 + */ + private Integer status; + /** + * 用户代理 + */ + private String userAgent; + /** + * 操作IP + */ + private String ip; + /** + * 用户名 + */ + private String creatorName; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/entity/SysLogOperationEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/log/entity/SysLogOperationEntity.java new file mode 100644 index 0000000..66f0fad --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/entity/SysLogOperationEntity.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_log_operation") +public class SysLogOperationEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 用户操作 + */ + private String operation; + /** + * 请求URI + */ + private String requestUri; + /** + * 请求方式 + */ + private String requestMethod; + /** + * 请求参数 + */ + private String requestParams; + /** + * 请求时长(毫秒) + */ + private Integer requestTime; + /** + * 用户代理 + */ + private String userAgent; + /** + * 操作IP + */ + private String ip; + /** + * 状态 0:失败 1:成功 + */ + private Integer status; + /** + * 用户名 + */ + private String creatorName; +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/enums/LoginOperationEnum.java b/face-server/src/main/java/com/dkha/server/system/modules/log/enums/LoginOperationEnum.java new file mode 100644 index 0000000..1ca0967 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/enums/LoginOperationEnum.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.enums; + +/** + * 登录操作枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum LoginOperationEnum { + /** + * 用户登录 + */ + LOGIN(0), + /** + * 用户退出 + */ + LOGOUT(1); + + private int value; + + LoginOperationEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/enums/LoginStatusEnum.java b/face-server/src/main/java/com/dkha/server/system/modules/log/enums/LoginStatusEnum.java new file mode 100644 index 0000000..bb7ec23 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/enums/LoginStatusEnum.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.enums; + +/** + * 登录状态枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum LoginStatusEnum { + /** + * 失败 + */ + FAIL(0), + /** + * 成功 + */ + SUCCESS(1), + /** + * 账号已锁定 + */ + LOCK(2); + + private int value; + + LoginStatusEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/enums/OperationStatusEnum.java b/face-server/src/main/java/com/dkha/server/system/modules/log/enums/OperationStatusEnum.java new file mode 100644 index 0000000..3b4ee66 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/enums/OperationStatusEnum.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.enums; + +/** + * 操作状态枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum OperationStatusEnum { + /** + * 失败 + */ + FAIL(0), + /** + * 成功 + */ + SUCCESS(1); + + private int value; + + OperationStatusEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/excel/SysLogErrorExcel.java b/face-server/src/main/java/com/dkha/server/system/modules/log/excel/SysLogErrorExcel.java new file mode 100644 index 0000000..d194d36 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/excel/SysLogErrorExcel.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysLogErrorExcel { + @Excel(name = "请求URI") + private String requestUri; + @Excel(name = "请求方式") + private String requestMethod; + @Excel(name = "请求参数") + private String requestParams; + @Excel(name = "User-Agent") + private String userAgent; + @Excel(name = "操作IP") + private String ip; + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") + private Date createDate; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/excel/SysLogLoginExcel.java b/face-server/src/main/java/com/dkha/server/system/modules/log/excel/SysLogLoginExcel.java new file mode 100644 index 0000000..cca6afb --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/excel/SysLogLoginExcel.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysLogLoginExcel { + @Excel(name = "用户操作") + private String operation; + @Excel(name = "状态", replace = {"失败_0", "成功_1", "账号已锁定_1"}) + private Integer status; + @Excel(name = "User-Agent") + private String userAgent; + @Excel(name = "操作IP") + private String ip; + @Excel(name = "用户名") + private String creatorName; + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") + private Date createDate; + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/excel/SysLogOperationExcel.java b/face-server/src/main/java/com/dkha/server/system/modules/log/excel/SysLogOperationExcel.java new file mode 100644 index 0000000..43fecf6 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/excel/SysLogOperationExcel.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysLogOperationExcel { + @Excel(name = "用户操作") + private String operation; + @Excel(name = "请求URI") + private String requestUri; + @Excel(name = "请求方式") + private String requestMethod; + @Excel(name = "请求参数") + private String requestParams; + @Excel(name = "请求时长(毫秒)") + private Integer requestTime; + @Excel(name = "User-Agent") + private String userAgent; + @Excel(name = "操作IP") + private String ip; + @Excel(name = "状态", replace = {"失败_0", "成功_1"}) + private Integer status; + @Excel(name = "用户名") + private String creatorName; + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") + private Date createDate; + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/service/SysLogErrorService.java b/face-server/src/main/java/com/dkha/server/system/modules/log/service/SysLogErrorService.java new file mode 100644 index 0000000..e0ff1b3 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/service/SysLogErrorService.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.service; + + + +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.log.dto.SysLogErrorDTO; +import com.dkha.server.system.modules.log.entity.SysLogErrorEntity; + +import java.util.List; +import java.util.Map; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysLogErrorService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + void save(SysLogErrorEntity entity); + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/service/SysLogLoginService.java b/face-server/src/main/java/com/dkha/server/system/modules/log/service/SysLogLoginService.java new file mode 100644 index 0000000..6e63ca8 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/service/SysLogLoginService.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.service; + + +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.log.dto.SysLogLoginDTO; +import com.dkha.server.system.modules.log.entity.SysLogLoginEntity; + +import java.util.List; +import java.util.Map; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysLogLoginService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + void save(SysLogLoginEntity entity); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/service/SysLogOperationService.java b/face-server/src/main/java/com/dkha/server/system/modules/log/service/SysLogOperationService.java new file mode 100644 index 0000000..1c514ca --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/service/SysLogOperationService.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.service; + + +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.log.dto.SysLogOperationDTO; +import com.dkha.server.system.modules.log.entity.SysLogOperationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysLogOperationService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + void save(SysLogOperationEntity entity); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/service/impl/SysLogErrorServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/log/service/impl/SysLogErrorServiceImpl.java new file mode 100644 index 0000000..f052957 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/service/impl/SysLogErrorServiceImpl.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.modules.log.dao.SysLogErrorDao; +import com.dkha.server.system.modules.log.dto.SysLogErrorDTO; +import com.dkha.server.system.modules.log.entity.SysLogErrorEntity; +import com.dkha.server.system.modules.log.service.SysLogErrorService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysLogErrorServiceImpl extends BaseServiceImpl implements SysLogErrorService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysLogErrorDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysLogErrorDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + QueryWrapper wrapper = new QueryWrapper<>(); + return wrapper; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysLogErrorEntity entity) { + insert(entity); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/service/impl/SysLogLoginServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/log/service/impl/SysLogLoginServiceImpl.java new file mode 100644 index 0000000..28a98d1 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/service/impl/SysLogLoginServiceImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.modules.log.dao.SysLogLoginDao; +import com.dkha.server.system.modules.log.dto.SysLogLoginDTO; +import com.dkha.server.system.modules.log.entity.SysLogLoginEntity; +import com.dkha.server.system.modules.log.service.SysLogLoginService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysLogLoginServiceImpl extends BaseServiceImpl implements SysLogLoginService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysLogLoginDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysLogLoginDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String status = (String) params.get("status"); + String creatorName = (String) params.get("creatorName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(UtilValidate.isNotEmpty(status), "status", status); + wrapper.like(UtilValidate.isNotEmpty(creatorName), "creator_name", creatorName); + + return wrapper; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysLogLoginEntity entity) { + insert(entity); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/log/service/impl/SysLogOperationServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/log/service/impl/SysLogOperationServiceImpl.java new file mode 100644 index 0000000..67fbc55 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/log/service/impl/SysLogOperationServiceImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.log.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.modules.log.dao.SysLogOperationDao; +import com.dkha.server.system.modules.log.dto.SysLogOperationDTO; +import com.dkha.server.system.modules.log.entity.SysLogOperationEntity; +import com.dkha.server.system.modules.log.service.SysLogOperationService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysLogOperationServiceImpl extends BaseServiceImpl implements SysLogOperationService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysLogOperationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysLogOperationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String status = (String) params.get("status"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(status), "status", status); + + return wrapper; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysLogOperationEntity entity) { + insert(entity); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/config/FilterConfig.java b/face-server/src/main/java/com/dkha/server/system/modules/security/config/FilterConfig.java new file mode 100644 index 0000000..a6ff96d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/config/FilterConfig.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.config; + +import com.dkha.server.system.common.xss.XssFilter; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.filter.DelegatingFilterProxy; + +import javax.servlet.DispatcherType; + +/** + * Filter配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class FilterConfig { + + @Bean + public FilterRegistrationBean shiroFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setFilter(new DelegatingFilterProxy("shiroFilter")); + //该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理 + registration.addInitParameter("targetFilterLifecycle", "true"); + registration.setEnabled(true); + registration.setOrder(Integer.MAX_VALUE - 1); + registration.addUrlPatterns("/*"); + return registration; + } + + @Bean + public FilterRegistrationBean xssFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setDispatcherTypes(DispatcherType.REQUEST); + registration.setFilter(new XssFilter()); + registration.addUrlPatterns("/*"); + registration.setName("xssFilter"); + registration.setOrder(Integer.MAX_VALUE); + return registration; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/config/ShiroConfig.java b/face-server/src/main/java/com/dkha/server/system/modules/security/config/ShiroConfig.java new file mode 100644 index 0000000..820a53a --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/config/ShiroConfig.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.config; + +import com.dkha.server.system.modules.security.oauth2.Oauth2Filter; +import com.dkha.server.system.modules.security.oauth2.Oauth2Realm; +import org.apache.shiro.mgt.SecurityManager; +import org.apache.shiro.session.mgt.SessionManager; +import org.apache.shiro.spring.LifecycleBeanPostProcessor; +import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; +import org.apache.shiro.spring.web.ShiroFilterFactoryBean; +import org.apache.shiro.web.mgt.DefaultWebSecurityManager; +import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.Filter; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Shiro的配置文件 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class ShiroConfig { + + @Bean + public DefaultWebSessionManager sessionManager() { + DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); + sessionManager.setSessionValidationSchedulerEnabled(false); + sessionManager.setSessionIdUrlRewritingEnabled(false); + + return sessionManager; + } + + @Bean("securityManager") + public SecurityManager securityManager(Oauth2Realm oAuth2Realm, SessionManager sessionManager) { + DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); + securityManager.setRealm(oAuth2Realm); + securityManager.setSessionManager(sessionManager); + securityManager.setRememberMeManager(null); + return securityManager; + } + + @Bean + public Oauth2Filter oauth2Filter() { + return new Oauth2Filter(); + } + + @Bean("shiroFilter") + public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) { + ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean(); + shiroFilter.setSecurityManager(securityManager); + + //oauth过滤 + Map filters = new HashMap<>(); + filters.put("oauth2", new Oauth2Filter()); + shiroFilter.setFilters(filters); + + Map filterMap = new LinkedHashMap<>(); + filterMap.put("/faces/callback", "anon"); + filterMap.put("/webjars/**", "anon"); + filterMap.put("/druid/**", "anon"); + filterMap.put("/login", "anon"); + filterMap.put("/swagger/**", "anon"); + filterMap.put("/v2/api-docs", "anon"); + filterMap.put("/swagger-ui.html", "anon"); + filterMap.put("/swagger-resources/**", "anon"); + filterMap.put("/service/**", "anon"); + filterMap.put("/editor-app/**", "anon"); + filterMap.put("/diagram-viewer/**", "anon"); + filterMap.put("/modeler.html", "anon"); + filterMap.put("/captcha", "anon"); + filterMap.put("/favicon.ico", "anon"); + filterMap.put("/warning/**", "anon"); + filterMap.put("/warning/alarm", "anon"); + filterMap.put("/**", "oauth2"); + shiroFilter.setFilterChainDefinitionMap(filterMap); + + return shiroFilter; + } + + @Bean("lifecycleBeanPostProcessor") + public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() { + return new LifecycleBeanPostProcessor(); + } + + @Bean + public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) { + AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor(); + advisor.setSecurityManager(securityManager); + return advisor; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/config/WebMvcConfig.java b/face-server/src/main/java/com/dkha/server/system/modules/security/config/WebMvcConfig.java new file mode 100644 index 0000000..14aa49e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/config/WebMvcConfig.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.config; + +import com.dkha.server.system.common.utils.DateUtils; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.ByteArrayHttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.ResourceHttpMessageConverter; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.TimeZone; + +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowCredentials(true) + .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") + .maxAge(3600); + } + + @Override + public void configureMessageConverters(List> converters) { + converters.add(new ByteArrayHttpMessageConverter()); + converters.add(new StringHttpMessageConverter()); + converters.add(new ResourceHttpMessageConverter()); + converters.add(new AllEncompassingFormHttpMessageConverter()); + converters.add(new StringHttpMessageConverter()); + converters.add(jackson2HttpMessageConverter()); + } + + @Bean + public MappingJackson2HttpMessageConverter jackson2HttpMessageConverter() { + MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); + ObjectMapper mapper = new ObjectMapper(); + + //日期格式转换 + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN)); + mapper.setTimeZone(TimeZone.getTimeZone("GMT+8")); + + //Long类型转String类型 + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(Long.class, ToStringSerializer.instance); + simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); + mapper.registerModule(simpleModule); + + /** + * null 转 "" + * @param builder + * @return + */ + mapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer() { + @Override + public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + jsonGenerator.writeString(""); + } + }); + + converter.setObjectMapper(mapper); + return converter; + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/controller/LoginController.java b/face-server/src/main/java/com/dkha/server/system/modules/security/controller/LoginController.java new file mode 100644 index 0000000..16270b2 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/controller/LoginController.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.controller; + +import com.dkha.common.util.IpUtils; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.exception.RenException; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.common.validator.AssertUtils; +import com.dkha.server.system.common.validator.ValidatorUtils; +import com.dkha.server.system.modules.log.entity.SysLogLoginEntity; +import com.dkha.server.system.modules.log.enums.LoginOperationEnum; +import com.dkha.server.system.modules.log.enums.LoginStatusEnum; +import com.dkha.server.system.modules.log.service.SysLogLoginService; +import com.dkha.server.system.modules.security.dto.LoginDTO; +import com.dkha.server.system.modules.security.password.PasswordUtils; +import com.dkha.server.system.modules.security.service.CaptchaService; +import com.dkha.server.system.modules.security.service.SysUserTokenService; +import com.dkha.server.system.modules.security.user.SecurityUser; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.dto.SysUserDTO; +import com.dkha.server.system.modules.sys.enums.UserStatusEnum; +import com.dkha.server.system.modules.sys.service.SysUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.imageio.ImageIO; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.Date; + +/** + * 登录 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@Api(tags="登录管理") +public class LoginController { + @Autowired + private SysUserService sysUserService; + @Autowired + private SysUserTokenService sysUserTokenService; + @Autowired + private CaptchaService captchaService; + @Autowired + private SysLogLoginService sysLogLoginService; + + @GetMapping("/captcha") + @ApiOperation(value = "验证码", produces="application/octet-stream") + @ApiImplicitParam(paramType = "query", dataType="string", name = "uuid", required = true) + public void captcha(HttpServletResponse response, String uuid)throws IOException { + //uuid不能为空 + AssertUtils.isBlank(uuid, ErrorCode.IDENTIFIER_NOT_NULL); + + //生成图片验证码 + BufferedImage image = captchaService.create(uuid); + + response.setHeader("Cache-Control", "no-store, no-cache"); + response.setContentType("image/jpeg"); + ServletOutputStream out = response.getOutputStream(); + ImageIO.write(image, "jpg", out); + + out.close(); + } + + @PostMapping("login") + @ApiOperation(value = "登录") + public Result login(HttpServletRequest request, @RequestBody LoginDTO login) { + //效验数据 + ValidatorUtils.validateEntity(login); + + //验证码是否正确 + boolean flag = captchaService.validate(login.getUuid(), login.getCaptcha()); + if(!flag){ + return new Result().error(ErrorCode.CAPTCHA_ERROR); + } + + //用户信息 + SysUserDTO user = sysUserService.getByUsername(login.getUsername()); + + SysLogLoginEntity log = new SysLogLoginEntity(); + log.setOperation(LoginOperationEnum.LOGIN.value()); + log.setCreateDate(new Date()); + log.setIp(IpUtils.getIpAddr(request)); + log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); + log.setIp(IpUtils.getIpAddr(request)); + + //用户不存在 + if(user == null){ + log.setStatus(LoginStatusEnum.FAIL.value()); + log.setCreatorName(login.getUsername()); + sysLogLoginService.save(log); + + throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); + } + + //密码错误 + if(!PasswordUtils.matches(login.getPassword(), user.getPassword())){ + log.setStatus(LoginStatusEnum.FAIL.value()); + log.setCreator(user.getId()); + log.setCreatorName(user.getUsername()); + sysLogLoginService.save(log); + + throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); + } + + //账号停用 + if(user.getStatus() == UserStatusEnum.DISABLE.value()){ + log.setStatus(LoginStatusEnum.LOCK.value()); + log.setCreator(user.getId()); + log.setCreatorName(user.getUsername()); + sysLogLoginService.save(log); + + throw new RenException(ErrorCode.ACCOUNT_DISABLE); + } + + //登录成功 + log.setStatus(LoginStatusEnum.SUCCESS.value()); + log.setCreator(user.getId()); + log.setCreatorName(user.getUsername()); + sysLogLoginService.save(log); + + return sysUserTokenService.createToken(user.getId()); + } + + @PostMapping("logout") + @ApiOperation(value = "退出") + public Result logout(HttpServletRequest request) { + UserDetail user = SecurityUser.getUser(); + + //退出 + sysUserTokenService.logout(user.getId()); + + //用户信息 + SysLogLoginEntity log = new SysLogLoginEntity(); + log.setOperation(LoginOperationEnum.LOGOUT.value()); + log.setIp(IpUtils.getIpAddr(request)); + log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); + log.setIp(IpUtils.getIpAddr(request)); + log.setStatus(LoginStatusEnum.SUCCESS.value()); + log.setCreator(user.getId()); + log.setCreatorName(user.getUsername()); + log.setCreateDate(new Date()); + sysLogLoginService.save(log); + + return new Result(); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/dto/LoginDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/security/dto/LoginDTO.java new file mode 100644 index 0000000..7073653 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/dto/LoginDTO.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 登录表单 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "登录表单") +public class LoginDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "用户名", required = true) + @NotBlank(message="{sysuser.username.require}") + private String username; + + @ApiModelProperty(value = "密码") + @NotBlank(message="{sysuser.password.require}") + private String password; + + @ApiModelProperty(value = "验证码") + @NotBlank(message="{sysuser.captcha.require}") + private String captcha; + + @ApiModelProperty(value = "唯一标识") + @NotBlank(message="{sysuser.uuid.require}") + private String uuid; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/Oauth2Filter.java b/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/Oauth2Filter.java new file mode 100644 index 0000000..4e9baf8 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/Oauth2Filter.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.oauth2; + +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.utils.HttpContextUtils; +import com.dkha.server.system.common.utils.Result; +import com.google.gson.Gson; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpStatus; +import org.apache.shiro.authc.AuthenticationException; +import org.apache.shiro.authc.AuthenticationToken; +import org.apache.shiro.web.filter.authc.AuthenticatingFilter; +import org.springframework.web.bind.annotation.RequestMethod; + +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * oauth2过滤器 + * + * @author Mark sunlightcs@gmail.com + */ +public class Oauth2Filter extends AuthenticatingFilter { + + @Override + protected AuthenticationToken createToken(ServletRequest request, ServletResponse response) throws Exception { + //获取请求token + String token = getRequestToken((HttpServletRequest) request); + + if (StringUtils.isBlank(token)) { + return null; + } + + return new Oauth2Token(token); + } + + @Override + protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { + if (((HttpServletRequest) request).getMethod().equals(RequestMethod.OPTIONS.name())) { + return true; + } + + return false; + } + + @Override + protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { + //获取请求token,如果token不存在,直接返回401 + //TODO + String token = getRequestToken((HttpServletRequest) request); + if (StringUtils.isBlank(token)) { + HttpServletResponse httpResponse = (HttpServletResponse) response; + httpResponse.setContentType("application/json;charset=utf-8"); + httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); + httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin()); + + // todo 应该到拦截器里面配置路径,将下面代码解注释,前端所有请求带上token + String json = new Gson().toJson(new Result().error(ErrorCode.UNAUTHORIZED)); + httpResponse.getWriter().print(json); + return false; + +// return true; + } + + return executeLogin(request, response); + } + + @Override + protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) { + HttpServletResponse httpResponse = (HttpServletResponse) response; + httpResponse.setContentType("application/json;charset=utf-8"); + httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); + httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin()); + try { + //处理登录失败的异常 + Throwable throwable = e.getCause() == null ? e : e.getCause(); + Result r = new Result().error(HttpStatus.SC_UNAUTHORIZED, throwable.getMessage()); + + String json = new Gson().toJson(r); + httpResponse.getWriter().print(json); + } catch (IOException e1) { + + } + + return false; + } + + /** + * 获取请求的token + */ + private String getRequestToken(HttpServletRequest httpRequest) { + //从header中获取token + String token = httpRequest.getHeader(Constant.TOKEN_HEADER); + + //如果header中不存在token,则从参数中获取token + if (StringUtils.isBlank(token)) { + token = httpRequest.getParameter(Constant.TOKEN_HEADER); + } + + return token; + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/Oauth2Realm.java b/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/Oauth2Realm.java new file mode 100644 index 0000000..4afe295 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/Oauth2Realm.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.oauth2; + +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.common.utils.MessageUtils; +import com.dkha.server.system.modules.sys.entity.SysUserTokenEntity; +import com.dkha.server.system.modules.security.service.ShiroService; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.entity.SysUserEntity; +import org.apache.shiro.authc.*; +import org.apache.shiro.authz.AuthorizationInfo; +import org.apache.shiro.authz.SimpleAuthorizationInfo; +import org.apache.shiro.realm.AuthorizingRealm; +import org.apache.shiro.subject.PrincipalCollection; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Set; + +/** + * 认证 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class Oauth2Realm extends AuthorizingRealm { + @Autowired + private ShiroService shiroService; + + @Override + public boolean supports(AuthenticationToken token) { + return token instanceof Oauth2Token; + } + + /** + * 授权(验证权限时调用) + */ + @Override + protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { + UserDetail user = (UserDetail)principals.getPrimaryPrincipal(); + + //用户权限列表 + Set permsSet = shiroService.getUserPermissions(user); + + SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); + info.setStringPermissions(permsSet); + return info; + } + + /** + * 认证(登录时调用) + */ + @Override + protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { + String accessToken = (String) token.getPrincipal(); + + //根据accessToken,查询用户信息 + SysUserTokenEntity tokenEntity = shiroService.getByToken(accessToken); + //token失效 + if(tokenEntity == null || tokenEntity.getExpireDate().getTime() < System.currentTimeMillis()){ + throw new IncorrectCredentialsException(MessageUtils.getMessage(ErrorCode.TOKEN_INVALID)); + } + + //查询用户信息 + SysUserEntity userEntity = shiroService.getUser(tokenEntity.getUserId()); + + //转换成UserDetail对象 + UserDetail userDetail = ConvertUtils.sourceToTarget(userEntity, UserDetail.class); + + //获取用户对应的部门数据权限 + List deptIdList = shiroService.getDataScopeList(userDetail.getId()); + userDetail.setDeptIdList(deptIdList); + + //账号锁定 + if(userDetail.getStatus() == 0){ + throw new LockedAccountException(MessageUtils.getMessage(ErrorCode.ACCOUNT_LOCK)); + } + + SimpleAuthenticationInfo info = new SimpleAuthenticationInfo(userDetail, accessToken, getName()); + return info; + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/Oauth2Token.java b/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/Oauth2Token.java new file mode 100644 index 0000000..6753a8b --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/Oauth2Token.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.oauth2; + +import org.apache.shiro.authc.AuthenticationToken; + +/** + * token + * + * @author Mark sunlightcs@gmail.com + */ +public class Oauth2Token implements AuthenticationToken { + private String token; + + public Oauth2Token(String token){ + this.token = token; + } + + @Override + public String getPrincipal() { + return token; + } + + @Override + public Object getCredentials() { + return token; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/TokenGenerator.java b/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/TokenGenerator.java new file mode 100644 index 0000000..7b65d50 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/oauth2/TokenGenerator.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.oauth2; + + +import com.dkha.server.system.common.exception.RenException; + +import java.security.MessageDigest; +import java.util.UUID; + +/** + * 生成token + * + * @author Mark sunlightcs@gmail.com + */ +public class TokenGenerator { + + public static String generateValue() { + return generateValue(UUID.randomUUID().toString()); + } + + private static final char[] HEX_CODE = "0123456789abcdef".toCharArray(); + + public static String toHexString(byte[] data) { + if(data == null) { + return null; + } + StringBuilder r = new StringBuilder(data.length*2); + for ( byte b : data) { + r.append(HEX_CODE[(b >> 4) & 0xF]); + r.append(HEX_CODE[(b & 0xF)]); + } + return r.toString(); + } + + public static String generateValue(String param) { + try { + MessageDigest algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(param.getBytes()); + byte[] messageDigest = algorithm.digest(); + return toHexString(messageDigest); + } catch (Exception e) { + throw new RenException("token invalid", e); + } + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/password/BCrypt.java b/face-server/src/main/java/com/dkha/server/system/modules/security/password/BCrypt.java new file mode 100644 index 0000000..9cdea8a --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/password/BCrypt.java @@ -0,0 +1,662 @@ +package com.dkha.server.system.modules.security.password; + +import java.io.ByteArrayOutputStream; +import java.io.UnsupportedEncodingException; +import java.security.SecureRandom; + +/** + * BCrypt implements OpenBSD-style Blowfish password hashing using the scheme described in + * "A Future-Adaptable Password Scheme" by Niels Provos and David Mazieres. + *

+ * This password hashing system tries to thwart off-line password cracking using a + * computationally-intensive hashing algorithm, based on Bruce Schneier's Blowfish cipher. + * The work factor of the algorithm is parameterised, so it can be increased as computers + * get faster. + *

+ * Usage is really simple. To hash a password for the first time, call the hashpw method + * with a random salt, like this: + *

+ * + * String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt());
+ *
+ *

+ * To check whether a plaintext password matches one that has been hashed previously, use + * the checkpw method: + *

+ * + * if (BCrypt.checkpw(candidate_password, stored_hash))
+ *     System.out.println("It matches");
+ * else
+ *     System.out.println("It does not match");
+ *
+ *

+ * The gensalt() method takes an optional parameter (log_rounds) that determines the + * computational complexity of the hashing: + *

+ * + * String strong_salt = BCrypt.gensalt(10)
+ * String stronger_salt = BCrypt.gensalt(12)
+ *
+ *

+ * The amount of work increases exponentially (2**log_rounds), so each increment is twice + * as much work. The default log_rounds is 10, and the valid range is 4 to 31. + * + * @author Damien Miller + */ +public class BCrypt { + // BCrypt parameters + + private static final int GENSALT_DEFAULT_LOG2_ROUNDS = 10; + private static final int BCRYPT_SALT_LEN = 16; + // Blowfish parameters + private static final int BLOWFISH_NUM_ROUNDS = 16; + // Initial contents of key schedule + private static final int P_orig[] = { 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, + 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b }; + private static final int S_orig[] = { 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, + 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, + 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, + 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, + 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, + 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, + 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, + 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, + 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, + 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, + 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, + 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, + 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, + 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, + 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, + 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, + 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, + 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, + 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, + 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, + 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, + 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, + 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, + 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, + 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, + 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, + 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, + 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, + 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, + 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, + 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, + 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, + 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, + 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, + 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, + 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, + 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, + 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, + 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, + 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, + 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, + 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, + 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, + 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, + 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, + 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, + 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, + 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, + 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, + 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, + 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, + 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, + 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, + 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, + 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, + 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, + 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, + 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, + 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, + 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, + 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, + 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, + 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, + 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, + 0x670efa8e, 0x406000e0, 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, + 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, + 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, + 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, + 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, + 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, + 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, + 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, + 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, + 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, + 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, + 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, + 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, + 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, + 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, + 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, + 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, + 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, + 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, + 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, + 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, + 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 }; + // bcrypt IV: "OrpheanBeholderScryDoubt" + static private final int bf_crypt_ciphertext[] = { 0x4f727068, 0x65616e42, + 0x65686f6c, 0x64657253, 0x63727944, 0x6f756274 }; + // Table for Base64 encoding + static private final char base64_code[] = { '.', '/', 'A', 'B', 'C', 'D', 'E', 'F', + 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', + 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', + 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; + // Table for Base64 decoding + static private final byte index_64[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + -1, -1, -1, -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1 }; + static final int MIN_LOG_ROUNDS = 4; + static final int MAX_LOG_ROUNDS = 31; + // Expanded Blowfish key + private int P[]; + private int S[]; + + /** + * Encode a byte array using bcrypt's slightly-modified base64 encoding scheme. Note + * that this is not compatible with the standard MIME-base64 + * encoding. + * + * @param d the byte array to encode + * @param len the number of bytes to encode + * @param rs the destination buffer for the base64-encoded string + * @exception IllegalArgumentException if the length is invalid + */ + static void encode_base64(byte d[], int len, StringBuilder rs) + throws IllegalArgumentException { + int off = 0; + int c1, c2; + + if (len <= 0 || len > d.length) { + throw new IllegalArgumentException("Invalid len"); + } + + while (off < len) { + c1 = d[off++] & 0xff; + rs.append(base64_code[(c1 >> 2) & 0x3f]); + c1 = (c1 & 0x03) << 4; + if (off >= len) { + rs.append(base64_code[c1 & 0x3f]); + break; + } + c2 = d[off++] & 0xff; + c1 |= (c2 >> 4) & 0x0f; + rs.append(base64_code[c1 & 0x3f]); + c1 = (c2 & 0x0f) << 2; + if (off >= len) { + rs.append(base64_code[c1 & 0x3f]); + break; + } + c2 = d[off++] & 0xff; + c1 |= (c2 >> 6) & 0x03; + rs.append(base64_code[c1 & 0x3f]); + rs.append(base64_code[c2 & 0x3f]); + } + } + + /** + * Look up the 3 bits base64-encoded by the specified character, range-checking + * against conversion table + * @param x the base64-encoded value + * @return the decoded value of x + */ + private static byte char64(char x) { + if (x > index_64.length) { + return -1; + } + return index_64[x]; + } + + /** + * Decode a string encoded using bcrypt's base64 scheme to a byte array. Note that + * this is *not* compatible with the standard MIME-base64 encoding. + * @param s the string to decode + * @param maxolen the maximum number of bytes to decode + * @return an array containing the decoded bytes + * @throws IllegalArgumentException if maxolen is invalid + */ + static byte[] decode_base64(String s, int maxolen) throws IllegalArgumentException { + ByteArrayOutputStream out = new ByteArrayOutputStream(maxolen); + int off = 0, slen = s.length(), olen = 0; + byte c1, c2, c3, c4, o; + + if (maxolen <= 0) { + throw new IllegalArgumentException("Invalid maxolen"); + } + + while (off < slen - 1 && olen < maxolen) { + c1 = char64(s.charAt(off++)); + c2 = char64(s.charAt(off++)); + if (c1 == -1 || c2 == -1) { + break; + } + o = (byte) (c1 << 2); + o |= (c2 & 0x30) >> 4; + out.write(o); + if (++olen >= maxolen || off >= slen) { + break; + } + c3 = char64(s.charAt(off++)); + if (c3 == -1) { + break; + } + o = (byte) ((c2 & 0x0f) << 4); + o |= (c3 & 0x3c) >> 2; + out.write(o); + if (++olen >= maxolen || off >= slen) { + break; + } + c4 = char64(s.charAt(off++)); + o = (byte) ((c3 & 0x03) << 6); + o |= c4; + out.write(o); + ++olen; + } + + return out.toByteArray(); + } + + /** + * Blowfish encipher a single 64-bit block encoded as two 32-bit halves + * @param lr an array containing the two 32-bit half blocks + * @param off the position in the array of the blocks + */ + private final void encipher(int lr[], int off) { + int i, n, l = lr[off], r = lr[off + 1]; + + l ^= P[0]; + for (i = 0; i <= BLOWFISH_NUM_ROUNDS - 2;) { + // Feistel substitution on left word + n = S[(l >> 24) & 0xff]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[++i]; + + // Feistel substitution on right word + n = S[(r >> 24) & 0xff]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[++i]; + } + lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; + lr[off + 1] = l; + } + + /** + * Cycically extract a word of key material + * @param data the string to extract the data from + * @param offp a "pointer" (as a one-entry array) to the current offset into data + * @return the next word of material from data + */ + private static int streamtoword(byte data[], int offp[]) { + int i; + int word = 0; + int off = offp[0]; + + for (i = 0; i < 4; i++) { + word = (word << 8) | (data[off] & 0xff); + off = (off + 1) % data.length; + } + + offp[0] = off; + return word; + } + + /** + * Initialise the Blowfish key schedule + */ + private void init_key() { + P = (int[]) P_orig.clone(); + S = (int[]) S_orig.clone(); + } + + /** + * Key the Blowfish cipher + * @param key an array containing the key + */ + private void key(byte key[]) { + int i; + int koffp[] = { 0 }; + int lr[] = { 0, 0 }; + int plen = P.length, slen = S.length; + + for (i = 0; i < plen; i++) { + P[i] = P[i] ^ streamtoword(key, koffp); + } + + for (i = 0; i < plen; i += 2) { + encipher(lr, 0); + P[i] = lr[0]; + P[i + 1] = lr[1]; + } + + for (i = 0; i < slen; i += 2) { + encipher(lr, 0); + S[i] = lr[0]; + S[i + 1] = lr[1]; + } + } + + /** + * Perform the "enhanced key schedule" step described by Provos and Mazieres in + * "A Future-Adaptable Password Scheme" http://www.openbsd.org/papers/bcrypt-paper.ps + * @param data salt information + * @param key password information + */ + private void ekskey(byte data[], byte key[]) { + int i; + int koffp[] = { 0 }, doffp[] = { 0 }; + int lr[] = { 0, 0 }; + int plen = P.length, slen = S.length; + + for (i = 0; i < plen; i++) { + P[i] = P[i] ^ streamtoword(key, koffp); + } + + for (i = 0; i < plen; i += 2) { + lr[0] ^= streamtoword(data, doffp); + lr[1] ^= streamtoword(data, doffp); + encipher(lr, 0); + P[i] = lr[0]; + P[i + 1] = lr[1]; + } + + for (i = 0; i < slen; i += 2) { + lr[0] ^= streamtoword(data, doffp); + lr[1] ^= streamtoword(data, doffp); + encipher(lr, 0); + S[i] = lr[0]; + S[i + 1] = lr[1]; + } + } + + static long roundsForLogRounds(int log_rounds) { + if (log_rounds < 4 || log_rounds > 31) { + throw new IllegalArgumentException("Bad number of rounds"); + } + return 1L << log_rounds; + } + + /** + * Perform the central password hashing step in the bcrypt scheme + * @param password the password to hash + * @param salt the binary salt to hash with the password + * @param log_rounds the binary logarithm of the number of rounds of hashing to apply + * @return an array containing the binary hashed password + */ + private byte[] crypt_raw(byte password[], byte salt[], int log_rounds) { + int cdata[] = (int[]) bf_crypt_ciphertext.clone(); + int clen = cdata.length; + byte ret[]; + + long rounds = roundsForLogRounds(log_rounds); + + init_key(); + ekskey(salt, password); + for (long i = 0; i < rounds; i++) { + key(password); + key(salt); + } + + for (int i = 0; i < 64; i++) { + for (int j = 0; j < (clen >> 1); j++) { + encipher(cdata, j << 1); + } + } + + ret = new byte[clen * 4]; + for (int i = 0, j = 0; i < clen; i++) { + ret[j++] = (byte) ((cdata[i] >> 24) & 0xff); + ret[j++] = (byte) ((cdata[i] >> 16) & 0xff); + ret[j++] = (byte) ((cdata[i] >> 8) & 0xff); + ret[j++] = (byte) (cdata[i] & 0xff); + } + return ret; + } + + /** + * Hash a password using the OpenBSD bcrypt scheme + * @param password the password to hash + * @param salt the salt to hash with (perhaps generated using BCrypt.gensalt) + * @return the hashed password + * @throws IllegalArgumentException if invalid salt is passed + */ + public static String hashpw(String password, String salt) throws IllegalArgumentException { + BCrypt B; + String real_salt; + byte passwordb[], saltb[], hashed[]; + char minor = (char) 0; + int rounds, off = 0; + StringBuilder rs = new StringBuilder(); + + if (salt == null) { + throw new IllegalArgumentException("salt cannot be null"); + } + + int saltLength = salt.length(); + + if (saltLength < 28) { + throw new IllegalArgumentException("Invalid salt"); + } + + if (salt.charAt(0) != '$' || salt.charAt(1) != '2') { + throw new IllegalArgumentException("Invalid salt version"); + } + if (salt.charAt(2) == '$') { + off = 3; + } + else { + minor = salt.charAt(2); + if (minor != 'a' || salt.charAt(3) != '$') { + throw new IllegalArgumentException("Invalid salt revision"); + } + off = 4; + } + + if (saltLength - off < 25) { + throw new IllegalArgumentException("Invalid salt"); + } + + // Extract number of rounds + if (salt.charAt(off + 2) > '$') { + throw new IllegalArgumentException("Missing salt rounds"); + } + rounds = Integer.parseInt(salt.substring(off, off + 2)); + + real_salt = salt.substring(off + 3, off + 25); + try { + passwordb = (password + (minor >= 'a' ? "\000" : "")).getBytes("UTF-8"); + } + catch (UnsupportedEncodingException uee) { + throw new AssertionError("UTF-8 is not supported"); + } + + saltb = decode_base64(real_salt, BCRYPT_SALT_LEN); + + B = new BCrypt(); + hashed = B.crypt_raw(passwordb, saltb, rounds); + + rs.append("$2"); + if (minor >= 'a') { + rs.append(minor); + } + rs.append("$"); + if (rounds < 10) { + rs.append("0"); + } + rs.append(rounds); + rs.append("$"); + encode_base64(saltb, saltb.length, rs); + encode_base64(hashed, bf_crypt_ciphertext.length * 4 - 1, rs); + return rs.toString(); + } + + /** + * Generate a salt for use with the BCrypt.hashpw() method + * @param log_rounds the log2 of the number of rounds of hashing to apply - the work + * factor therefore increases as 2**log_rounds. Minimum 4, maximum 31. + * @param random an instance of SecureRandom to use + * @return an encoded salt value + */ + public static String gensalt(int log_rounds, SecureRandom random) { + if (log_rounds < MIN_LOG_ROUNDS || log_rounds > MAX_LOG_ROUNDS) { + throw new IllegalArgumentException("Bad number of rounds"); + } + StringBuilder rs = new StringBuilder(); + byte rnd[] = new byte[BCRYPT_SALT_LEN]; + + random.nextBytes(rnd); + + rs.append("$2a$"); + if (log_rounds < 10) { + rs.append("0"); + } + rs.append(log_rounds); + rs.append("$"); + encode_base64(rnd, rnd.length, rs); + return rs.toString(); + } + + /** + * Generate a salt for use with the BCrypt.hashpw() method + * @param log_rounds the log2 of the number of rounds of hashing to apply - the work + * factor therefore increases as 2**log_rounds. Minimum 4, maximum 31. + * @return an encoded salt value + */ + public static String gensalt(int log_rounds) { + return gensalt(log_rounds, new SecureRandom()); + } + + /** + * Generate a salt for use with the BCrypt.hashpw() method, selecting a reasonable + * default for the number of hashing rounds to apply + * @return an encoded salt value + */ + public static String gensalt() { + return gensalt(GENSALT_DEFAULT_LOG2_ROUNDS); + } + + /** + * Check that a plaintext password matches a previously hashed one + * @param plaintext the plaintext password to verify + * @param hashed the previously-hashed password + * @return true if the passwords match, false otherwise + */ + public static boolean checkpw(String plaintext, String hashed) { + return equalsNoEarlyReturn(hashed, hashpw(plaintext, hashed)); + } + + static boolean equalsNoEarlyReturn(String a, String b) { + char[] caa = a.toCharArray(); + char[] cab = b.toCharArray(); + + if (caa.length != cab.length) { + return false; + } + + byte ret = 0; + for (int i = 0; i < caa.length; i++) { + ret |= caa[i] ^ cab[i]; + } + return ret == 0; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/password/BCryptPasswordEncoder.java b/face-server/src/main/java/com/dkha/server/system/modules/security/password/BCryptPasswordEncoder.java new file mode 100644 index 0000000..eb6e174 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/password/BCryptPasswordEncoder.java @@ -0,0 +1,82 @@ +package com.dkha.server.system.modules.security.password; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.security.SecureRandom; +import java.util.regex.Pattern; + +/** + * Implementation of PasswordEncoder that uses the BCrypt strong hashing function. Clients + * can optionally supply a "strength" (a.k.a. log rounds in BCrypt) and a SecureRandom + * instance. The larger the strength parameter the more work will have to be done + * (exponentially) to hash the passwords. The default value is 10. + * + * @author Dave Syer + * + */ +public class BCryptPasswordEncoder implements PasswordEncoder { + private Pattern BCRYPT_PATTERN = Pattern + .compile("\\A\\$2a?\\$\\d\\d\\$[./0-9A-Za-z]{53}"); + private final Log logger = LogFactory.getLog(getClass()); + + private final int strength; + + private final SecureRandom random; + + public BCryptPasswordEncoder() { + this(-1); + } + + /** + * @param strength the log rounds to use, between 4 and 31 + */ + public BCryptPasswordEncoder(int strength) { + this(strength, null); + } + + /** + * @param strength the log rounds to use, between 4 and 31 + * @param random the secure random instance to use + * + */ + public BCryptPasswordEncoder(int strength, SecureRandom random) { + if (strength != -1 && (strength < BCrypt.MIN_LOG_ROUNDS || strength > BCrypt.MAX_LOG_ROUNDS)) { + throw new IllegalArgumentException("Bad strength"); + } + this.strength = strength; + this.random = random; + } + + @Override + public String encode(CharSequence rawPassword) { + String salt; + if (strength > 0) { + if (random != null) { + salt = BCrypt.gensalt(strength, random); + } + else { + salt = BCrypt.gensalt(strength); + } + } + else { + salt = BCrypt.gensalt(); + } + return BCrypt.hashpw(rawPassword.toString(), salt); + } + + @Override + public boolean matches(CharSequence rawPassword, String encodedPassword) { + if (encodedPassword == null || encodedPassword.length() == 0) { + logger.warn("Empty encoded password"); + return false; + } + + if (!BCRYPT_PATTERN.matcher(encodedPassword).matches()) { + logger.warn("Encoded password does not look like BCrypt"); + return false; + } + + return BCrypt.checkpw(rawPassword.toString(), encodedPassword); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/password/PasswordEncoder.java b/face-server/src/main/java/com/dkha/server/system/modules/security/password/PasswordEncoder.java new file mode 100644 index 0000000..0deb715 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/password/PasswordEncoder.java @@ -0,0 +1,30 @@ +package com.dkha.server.system.modules.security.password; + +/** + * Service interface for encoding passwords. + * + * The preferred implementation is {@code BCryptPasswordEncoder}. + * + * @author Keith Donald + */ +public interface PasswordEncoder { + + /** + * Encode the raw password. Generally, a good encoding algorithm applies a SHA-1 or + * greater hash combined with an 8-byte or greater randomly generated salt. + */ + String encode(CharSequence rawPassword); + + /** + * Verify the encoded password obtained from storage matches the submitted raw + * password after it too is encoded. Returns true if the passwords match, false if + * they do not. The stored password itself is never decoded. + * + * @param rawPassword the raw password to encode and match + * @param encodedPassword the encoded password from storage to compare with + * @return true if the raw password, after encoding, matches the encoded password from + * storage + */ + boolean matches(CharSequence rawPassword, String encodedPassword); + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/password/PasswordUtils.java b/face-server/src/main/java/com/dkha/server/system/modules/security/password/PasswordUtils.java new file mode 100644 index 0000000..9c7d85f --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/password/PasswordUtils.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.dkha.server.system.modules.security.password; + +/** + * 密码工具类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class PasswordUtils { + private static PasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + + /** + * 加密 + * @param str 字符串 + * @return 返回加密字符串 + */ + public static String encode(String str){ + return passwordEncoder.encode(str); + } + + + /** + * 比较密码是否相等 + * @param str 明文密码 + * @param password 加密后密码 + * @return true:成功 false:失败 + */ + public static boolean matches(String str, String password){ + return passwordEncoder.matches(str, password); + } + + + public static void main(String[] args) { + String str = "admin"; + String password = encode(str); + + System.out.println(password); + System.out.println(matches(str, password)); + } + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/service/CaptchaService.java b/face-server/src/main/java/com/dkha/server/system/modules/security/service/CaptchaService.java new file mode 100644 index 0000000..e7535a5 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/service/CaptchaService.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.service; + +import java.awt.image.BufferedImage; + +/** + * 验证码 + * + * @author Mark sunlightcs@gmail.com + */ +public interface CaptchaService { + + /** + * 图片验证码 + */ + BufferedImage create(String uuid); + + /** + * 验证码效验 + * @param uuid uuid + * @param code 验证码 + * @return true:成功 false:失败 + */ + boolean validate(String uuid, String code); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/service/ShiroService.java b/face-server/src/main/java/com/dkha/server/system/modules/security/service/ShiroService.java new file mode 100644 index 0000000..365e56e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/service/ShiroService.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.service; + +import com.dkha.server.system.modules.sys.entity.SysUserTokenEntity; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.entity.SysUserEntity; + +import java.util.List; +import java.util.Set; + +/** + * shiro相关接口 + * + * @author Mark sunlightcs@gmail.com + */ +public interface ShiroService { + /** + * 获取用户权限列表 + */ + Set getUserPermissions(UserDetail user); + + SysUserTokenEntity getByToken(String token); + + /** + * 根据用户ID,查询用户 + * @param userId + */ + SysUserEntity getUser(Long userId); + + /** + * 获取用户对应的部门数据权限 + * @param userId 用户ID + * @return 返回部门ID列表 + */ + List getDataScopeList(Long userId); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/service/SysUserTokenService.java b/face-server/src/main/java/com/dkha/server/system/modules/security/service/SysUserTokenService.java new file mode 100644 index 0000000..8d44dcb --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/service/SysUserTokenService.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.service; + + +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.modules.sys.entity.SysUserTokenEntity; + +/** + * 用户Token + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysUserTokenService extends BaseService { + + /** + * 生成token + * @param userId 用户ID + */ + Result createToken(Long userId); + + /** + * 退出,修改token值 + * @param userId 用户ID + */ + void logout(Long userId); + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/service/impl/CaptchaServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/security/service/impl/CaptchaServiceImpl.java new file mode 100644 index 0000000..83895e0 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/service/impl/CaptchaServiceImpl.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.service.impl; + +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import com.dkha.server.system.modules.security.service.CaptchaService; +import com.google.code.kaptcha.Producer; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.awt.image.BufferedImage; +import java.util.concurrent.TimeUnit; + +/** + * 验证码 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class CaptchaServiceImpl implements CaptchaService { + @Autowired + private Producer producer; + @Autowired + private RedisUtils redisUtils; + @Value("${renren.redis.open: false}") + private boolean open; + /** + * Local Cache 5分钟过期 + */ + Cache localCache = CacheBuilder.newBuilder().maximumSize(1000).expireAfterAccess(5, TimeUnit.MINUTES).build(); + + @Override + public BufferedImage create(String uuid) { + //生成文字验证码 + String code = producer.createText(); + + //保存到缓存 + setCache(uuid, code); + + return producer.createImage(code); + } + + @Override + public boolean validate(String uuid, String code) { + //获取验证码 + String captcha = getCache(uuid); + + //效验成功 + if(code.equalsIgnoreCase(captcha)){ + return true; + } + + return false; + } + + private void setCache(String key, String value){ + if(open){ + key = RedisKeys.getCaptchaKey(key); + redisUtils.set(key, value, 300); + }else{ + localCache.put(key, value); + } + } + + private String getCache(String key){ + if(open){ + key = RedisKeys.getCaptchaKey(key); + String captcha = (String)redisUtils.get(key); + //删除验证码 + if(captcha != null){ + redisUtils.delete(key); + } + + return captcha; + } + + String captcha = localCache.getIfPresent(key); + //删除验证码 + if(captcha != null){ + localCache.invalidate(key); + } + return captcha; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/service/impl/ShiroServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/security/service/impl/ShiroServiceImpl.java new file mode 100644 index 0000000..bb14672 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/service/impl/ShiroServiceImpl.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.service.impl; + +import com.dkha.server.system.modules.sys.dao.SysUserTokenDao; +import com.dkha.server.system.modules.sys.entity.SysUserTokenEntity; +import com.dkha.server.system.modules.security.service.ShiroService; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.dao.SysMenuDao; +import com.dkha.server.system.modules.sys.dao.SysRoleDataScopeDao; +import com.dkha.server.system.modules.sys.dao.SysUserDao; +import com.dkha.server.system.modules.sys.entity.SysUserEntity; +import com.dkha.server.system.modules.sys.enums.SuperAdminEnum; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +public class ShiroServiceImpl implements ShiroService { + @Autowired + private SysMenuDao sysMenuDao; + @Autowired + private SysUserDao sysUserDao; + @Autowired + private SysUserTokenDao sysUserTokenDao; + @Autowired + private SysRoleDataScopeDao sysRoleDataScopeDao; + + @Override + public Set getUserPermissions(UserDetail user) { + //系统管理员,拥有最高权限 + List permissionsList; + if(user.getSuperAdmin() == SuperAdminEnum.YES.value()) { + permissionsList = sysMenuDao.getPermissionsList(); + }else{ + permissionsList = sysMenuDao.getUserPermissionsList(user.getId()); + } + + //用户权限列表 + Set permsSet = new HashSet<>(); + for(String permissions : permissionsList){ + if(StringUtils.isBlank(permissions)){ + continue; + } + permsSet.addAll(Arrays.asList(permissions.trim().split(","))); + } + + return permsSet; + } + + @Override + public SysUserTokenEntity getByToken(String token) { + return sysUserTokenDao.getByToken(token); + } + + @Override + public SysUserEntity getUser(Long userId) { + return sysUserDao.selectById(userId); + } + + @Override + public List getDataScopeList(Long userId) { + return sysRoleDataScopeDao.getDataScopeList(userId); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/service/impl/SysUserTokenServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/security/service/impl/SysUserTokenServiceImpl.java new file mode 100644 index 0000000..4bd1c7b --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/service/impl/SysUserTokenServiceImpl.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.service.impl; + +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.modules.sys.dao.SysUserTokenDao; +import com.dkha.server.system.modules.sys.entity.SysUserTokenEntity; +import com.dkha.server.system.modules.security.oauth2.TokenGenerator; +import com.dkha.server.system.modules.security.service.SysUserTokenService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Service +public class SysUserTokenServiceImpl extends BaseServiceImpl implements SysUserTokenService { + /** + * 12小时后过期 + */ + private final static int EXPIRE = 3600 * 24 * 3; + @Autowired + private RedisUtils redisUtils; + + @Override + public Result createToken(Long userId) { + //用户token + String token; + + //当前时间 + Date now = new Date(); + //过期时间 + Date expireTime = new Date(now.getTime() + EXPIRE * 1000); + + //判断是否生成过token + SysUserTokenEntity tokenEntity = baseDao.getByUserId(userId); + if (tokenEntity == null) { + //生成一个token + token = TokenGenerator.generateValue(); + + tokenEntity = new SysUserTokenEntity(); + tokenEntity.setUserId(userId); + tokenEntity.setToken(token); + tokenEntity.setUpdateDate(now); + tokenEntity.setExpireDate(expireTime); + + //保存token + this.insert(tokenEntity); + } else { + //判断token是否过期 + if (tokenEntity.getExpireDate().getTime() < System.currentTimeMillis()) { + //token过期,重新生成token + token = TokenGenerator.generateValue(); + } else { + token = tokenEntity.getToken(); + } + + tokenEntity.setToken(token); + tokenEntity.setUpdateDate(now); + tokenEntity.setExpireDate(expireTime); + + //更新token + this.updateById(tokenEntity); + } + Map map = new HashMap<>(2); + map.put(Constant.TOKEN_HEADER, token); + map.put("expire", EXPIRE); + return new Result().ok(map); + } + + @Override + public void logout(Long userId) { + //生成一个token + String token = TokenGenerator.generateValue(); + + //修改token + baseDao.updateToken(userId, token); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/user/SecurityUser.java b/face-server/src/main/java/com/dkha/server/system/modules/security/user/SecurityUser.java new file mode 100644 index 0000000..652ee64 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/user/SecurityUser.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.user; + +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; + +/** + * 用户 + * + * @author Mark sunlightcs@gmail.com + */ +public class SecurityUser { + + public static Subject getSubject() { + try { + return SecurityUtils.getSubject(); + }catch (Exception e){ + return null; + } + } + + /** + * 获取用户信息 + */ + public static UserDetail getUser() { + Subject subject = getSubject(); + if(subject == null){ + return new UserDetail(); + } + + UserDetail user = (UserDetail)subject.getPrincipal(); + if(user == null){ + return new UserDetail(); + } + + return user; + } + + /** + * 获取用户ID + */ + public static Long getUserId() { + return getUser().getId(); + } + + /** + * 获取部门ID + */ + public static Long getDeptId() { + return getUser().getDeptId(); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/security/user/UserDetail.java b/face-server/src/main/java/com/dkha/server/system/modules/security/user/UserDetail.java new file mode 100644 index 0000000..d1dc4ff --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/security/user/UserDetail.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.security.user; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 登录用户信息 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public class UserDetail implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + private String username; + private String realName; + private String headUrl; + private Integer gender; + private String email; + private String mobile; + private Long deptId; + private String password; + private Integer status; + private Integer superAdmin; + /** + * 部门数据权限 + */ + private List deptIdList; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysDeptController.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysDeptController.java new file mode 100644 index 0000000..22e4fab --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysDeptController.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.common.validator.AssertUtils; +import com.dkha.server.system.common.validator.ValidatorUtils; +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.dkha.server.system.modules.sys.dto.SysDeptDTO; +import com.dkha.server.system.modules.sys.service.SysDeptService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/dept") +@Api(tags="部门管理") +public class SysDeptController { + @Autowired + private SysDeptService sysDeptService; + + @GetMapping("list") + @ApiOperation("列表") + @RequiresPermissions("sys:dept:list") + public Result> list(){ + List list = sysDeptService.list(new HashMap<>(1)); + + return new Result>().ok(list); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:dept:info") + public Result get(@PathVariable("id") Long id){ + SysDeptDTO data = sysDeptService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:dept:save") + public Result save(@RequestBody SysDeptDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysDeptService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:dept:update") + public Result update(@RequestBody SysDeptDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysDeptService.update(dto); + + return new Result(); + } + + @DeleteMapping("{id}") + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:dept:delete") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + + sysDeptService.delete(id); + + return new Result(); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysDictDataController.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysDictDataController.java new file mode 100644 index 0000000..795c95d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysDictDataController.java @@ -0,0 +1,120 @@ +package com.dkha.server.system.modules.sys.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.common.validator.AssertUtils; +import com.dkha.server.system.common.validator.ValidatorUtils; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.dkha.server.system.modules.sys.dto.SysDictDataDTO; +import com.dkha.server.system.modules.sys.dto.SysDictTypeDTO; +import com.dkha.server.system.modules.sys.entity.SysDictDataEntity; +import com.dkha.server.system.modules.sys.service.SysDictDataService; +import com.dkha.server.system.modules.sys.service.SysDictTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.validation.constraints.NotNull; +import java.util.List; +import java.util.Map; + +/** + * 字典数据 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("sys/dict/data") +@Api(tags="字典数据") +public class SysDictDataController { + @Autowired + private SysDictTypeService sysDictTypeService; + @Autowired + private SysDictDataService sysDictDataService; + + @GetMapping("page") + @ApiOperation("字典数据") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "dictLabel", value = "字典标签", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "dictValue", value = "字典值", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:dict:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + //字典类型 + PageData page = sysDictDataService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:dict:info") + public Result get(@PathVariable("id") Long id){ + SysDictDataDTO data = sysDictDataService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:dict:save") + public Result save(@RequestBody SysDictDataDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysDictDataService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:dict:update") + public Result update(@RequestBody SysDictDataDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysDictDataService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:dict:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysDictDataService.delete(ids); + + return new Result(); + } + + + + @GetMapping(value = "/findByType/{type}") + @ApiOperation("类型查询") + @LogOperation("类型查询") +// @RequiresPermissions("sys:dict:list") + public Result getAllByTypeNotFirst( @PathVariable(required = true) String type){ + //效验数据 + return new Result>().ok(sysDictTypeService.getByType(type)); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysDictTypeController.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysDictTypeController.java new file mode 100644 index 0000000..bc5e3c0 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysDictTypeController.java @@ -0,0 +1,119 @@ +package com.dkha.server.system.modules.sys.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.common.validator.AssertUtils; +import com.dkha.server.system.common.validator.ValidatorUtils; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.dkha.server.system.modules.sys.dto.SysDictTypeDTO; +import com.dkha.server.system.modules.sys.entity.DictType; +import com.dkha.server.system.modules.sys.service.SysDictTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Map; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("sys/dict/type") +@Api(tags="字典类型") +@Slf4j +public class SysDictTypeController { + @Autowired + private SysDictTypeService sysDictTypeService; + + @GetMapping("page") + @ApiOperation("字典类型") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "dictType", value = "字典类型", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:dict:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + //字典类型 + PageData page = sysDictTypeService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:dict:info") + public Result get(@PathVariable("id") Long id){ + SysDictTypeDTO data = sysDictTypeService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:dict:save") + public Result save(@RequestBody SysDictTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + try { + sysDictTypeService.save(dto); + } catch (Exception e) { + log.error("添加字典类型码表异常",e.getMessage()); + return new Result().error("添加失败"); + } + + return new Result().ok("添加成功"); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:dict:update") + public Result update(@RequestBody SysDictTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysDictTypeService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:dict:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysDictTypeService.delete(ids); + + return new Result(); + } + + @GetMapping("all") + @ApiOperation("所有字典数据") + public Result> all(){ + List list = sysDictTypeService.getAllList(); + + return new Result>().ok(list); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysMenuController.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysMenuController.java new file mode 100644 index 0000000..d09f8df --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysMenuController.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.common.validator.AssertUtils; +import com.dkha.server.system.common.validator.ValidatorUtils; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.modules.security.service.ShiroService; +import com.dkha.server.system.modules.security.user.SecurityUser; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.dto.SysMenuDTO; +import com.dkha.server.system.modules.sys.enums.MenuTypeEnum; +import com.dkha.server.system.modules.sys.service.SysMenuService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Set; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/menu") +@Api(tags="菜单管理") +public class SysMenuController { + @Autowired + private SysMenuService sysMenuService; + @Autowired + private ShiroService shiroService; + + @GetMapping("nav") + @ApiOperation("导航") + public Result> nav(){ + UserDetail user = SecurityUser.getUser(); + List list = sysMenuService.getUserMenuList(user, MenuTypeEnum.MENU.value()); + + return new Result>().ok(list); + } + + @GetMapping("permissions") + @ApiOperation("权限标识") + public Result> permissions(){ + UserDetail user = SecurityUser.getUser(); + Set set = shiroService.getUserPermissions(user); + + return new Result>().ok(set); + } + + @GetMapping("list") + @ApiOperation("列表") + @ApiImplicitParam(name = "type", value = "菜单类型 0:菜单 1:按钮 null:全部", paramType = "query", dataType="int") + @RequiresPermissions("sys:menu:list") + public Result> list(Integer type){ + List list = sysMenuService.getAllMenuList(type); + + return new Result>().ok(list); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:menu:info") + public Result get(@PathVariable("id") Long id){ + SysMenuDTO data = sysMenuService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:menu:save") + public Result save(@RequestBody SysMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysMenuService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:menu:update") + public Result update(@RequestBody SysMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysMenuService.update(dto); + + return new Result(); + } + + @DeleteMapping("{id}") + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:menu:delete") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + + //判断是否有子菜单或按钮 + List list = sysMenuService.getListPid(id); + if(list.size() > 0){ + return new Result().error(ErrorCode.SUB_MENU_EXIST); + } + + sysMenuService.delete(id); + + return new Result(); + } + + @GetMapping("select") + @ApiOperation("角色菜单权限") + @RequiresPermissions("sys:menu:select") + public Result> select(){ + UserDetail user = SecurityUser.getUser(); + List list = sysMenuService.getUserMenuList(user, null); + + return new Result>().ok(list); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysParamsController.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysParamsController.java new file mode 100644 index 0000000..634aeb9 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysParamsController.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.utils.ExcelUtils; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.common.validator.AssertUtils; +import com.dkha.server.system.common.validator.ValidatorUtils; +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.dkha.server.system.modules.sys.dto.SysParamsDTO; +import com.dkha.server.system.modules.sys.excel.SysParamsExcel; +import com.dkha.server.system.modules.sys.service.SysParamsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("sys/params") +@Api(tags="参数管理") +public class SysParamsController { + @Autowired + private SysParamsService sysParamsService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:params:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysParamsService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:params:info") + public Result get(@PathVariable("id") Long id){ + SysParamsDTO data = sysParamsService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:params:save") + public Result save(@RequestBody SysParamsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysParamsService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:params:update") + public Result update(@RequestBody SysParamsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysParamsService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:params:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysParamsService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("sys:params:export") + @ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysParamsService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysParamsExcel.class); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysRegionController.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysRegionController.java new file mode 100644 index 0000000..2cfc6af --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysRegionController.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.controller; + +import com.dkha.common.exception.DkException; +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.exception.RenException; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.common.validator.AssertUtils; +import com.dkha.server.system.common.validator.ValidatorUtils; +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.dkha.server.system.modules.sys.dto.SysRegionDTO; +import com.dkha.server.system.modules.sys.dto.region.RegionProvince; +import com.dkha.server.system.modules.sys.service.SysRegionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 行政区域 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/region") +@Api(tags="行政区域") +public class SysRegionController { + @Autowired + private SysRegionService sysRegionService; + + @GetMapping("list") + @ApiOperation("列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pid", value = "上级ID", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:region:list") + public Result> list(@RequestParam Map params){ + List list = sysRegionService.list(params); + + return new Result>().ok(list); + } + + @GetMapping("tree") + @ApiOperation("树形数据") + public Result>> tree(){ + List> list = sysRegionService.getTreeList(); + + return new Result>>().ok(list); + } + + @GetMapping("trees") + @ApiOperation("树形数据--正确版本") + public Result> trees(){ + List list = sysRegionService.allList(); + return new Result>().ok(list); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:region:info") + public Result get(@PathVariable("id") Long id){ + SysRegionDTO data = sysRegionService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:region:save") + public Result save(@RequestBody SysRegionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysRegionService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:region:update") + public Result update(@RequestBody SysRegionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysRegionService.update(dto); + + return new Result(); + } + + @DeleteMapping("{id}") + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:region:delete") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + + int count = sysRegionService.getCountByPid(id); + if(count > 0){ + throw new DkException("该区域存在下级区域,无法删除"); + } + + sysRegionService.delete(id); + + return new Result(); + } + + @GetMapping("region") + @ApiOperation("地区列表") + @ApiImplicitParam(name = "threeLevel", value = "是否显示3级 true显示 false不显示", paramType = "query", dataType="boolean") + public Result> region(@RequestParam(value = "threeLevel", defaultValue = "true") boolean threeLevel){ + List list = sysRegionService.getRegion(threeLevel); + + return new Result>().ok(list); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysRoleController.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysRoleController.java new file mode 100644 index 0000000..cc82a2b --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysRoleController.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.common.validator.AssertUtils; +import com.dkha.server.system.common.validator.ValidatorUtils; +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.dkha.server.system.modules.sys.dto.SysRoleDTO; +import com.dkha.server.system.modules.sys.service.SysRoleDataScopeService; +import com.dkha.server.system.modules.sys.service.SysRoleMenuService; +import com.dkha.server.system.modules.sys.service.SysRoleService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/role") +@Api(tags="角色管理") +public class SysRoleController { + @Autowired + private SysRoleService sysRoleService; + @Autowired + private SysRoleMenuService sysRoleMenuService; + @Autowired + private SysRoleDataScopeService sysRoleDataScopeService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "name", value = "角色名", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:role:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysRoleService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("list") + @ApiOperation("列表") + @RequiresPermissions("sys:role:list") + public Result> list(){ + List data = sysRoleService.list(new HashMap<>(1)); + + return new Result>().ok(data); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:role:info") + public Result get(@PathVariable("id") Long id){ + SysRoleDTO data = sysRoleService.get(id); + + //查询角色对应的菜单 + List menuIdList = sysRoleMenuService.getMenuIdList(id); + data.setMenuIdList(menuIdList); + + //查询角色对应的数据权限 + List deptIdList = sysRoleDataScopeService.getDeptIdList(id); + data.setDeptIdList(deptIdList); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:role:save") + public Result save(@RequestBody SysRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysRoleService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:role:update") + public Result update(@RequestBody SysRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysRoleService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:role:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysRoleService.delete(ids); + + return new Result(); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysUserController.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysUserController.java new file mode 100644 index 0000000..10d2558 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SysUserController.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.controller; + +import com.dkha.server.system.common.annotation.LogOperation; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.common.utils.ExcelUtils; +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.common.validator.AssertUtils; +import com.dkha.server.system.common.validator.ValidatorUtils; +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.dkha.server.system.modules.security.password.PasswordUtils; +import com.dkha.server.system.modules.security.user.SecurityUser; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.dto.PasswordDTO; +import com.dkha.server.system.modules.sys.dto.SysUserDTO; +import com.dkha.server.system.modules.sys.excel.SysUserExcel; +import com.dkha.server.system.modules.sys.service.SysRoleUserService; +import com.dkha.server.system.modules.sys.service.SysUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/user") +@Api(tags="用户管理") +public class SysUserController { + @Autowired + private SysUserService sysUserService; + @Autowired + private SysRoleUserService sysRoleUserService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "gender", value = "性别", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:user:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysUserService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:user:info") + public Result get(@PathVariable("id") Long id){ + SysUserDTO data = sysUserService.get(id); + + //用户角色列表 + List roleIdList = sysRoleUserService.getRoleIdList(id); + data.setRoleIdList(roleIdList); + + return new Result().ok(data); + } + + @GetMapping("info") + @ApiOperation("登录用户信息") + public Result info(){ + SysUserDTO data = ConvertUtils.sourceToTarget(SecurityUser.getUser(), SysUserDTO.class); + return new Result().ok(data); + } + + @PutMapping("password") + @ApiOperation("修改密码") + @LogOperation("修改密码") + public Result password(@RequestBody PasswordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto); + + UserDetail user = SecurityUser.getUser(); + + //原密码不正确 + if(!PasswordUtils.matches(dto.getPassword(), user.getPassword())){ + return new Result().error(ErrorCode.PASSWORD_ERROR); + } + + sysUserService.updatePassword(user.getId(), dto.getNewPassword()); + + return new Result(); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:user:save") + public Result save(@RequestBody SysUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysUserService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:user:update") + public Result update(@RequestBody SysUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysUserService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:user:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysUserService.deleteBatchIds(Arrays.asList(ids)); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("sys:user:export") + @ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType="String") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysUserService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysUserExcel.class); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SystemController.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SystemController.java new file mode 100644 index 0000000..b1c8863 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/controller/SystemController.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.controller; + +import com.dkha.server.system.common.utils.Result; +import com.dkha.server.system.modules.sys.dto.SystemDTO; +import com.sun.management.OperatingSystemMXBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.lang.management.ManagementFactory; +import java.math.BigDecimal; +import java.math.RoundingMode; + +/** + * 系统接口 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@Api(tags="系统接口") +public class SystemController { + + @GetMapping("sys/info") + @ApiOperation("系统信息") + public Result info(){ + OperatingSystemMXBean osmx = (OperatingSystemMXBean)ManagementFactory.getOperatingSystemMXBean(); + + SystemDTO dto = new SystemDTO(); + dto.setSysTime(System.currentTimeMillis()); + dto.setOsName(System.getProperty("os.name")); + dto.setOsArch(System.getProperty("os.arch")); + dto.setOsVersion(System.getProperty("os.version")); + dto.setUserLanguage(System.getProperty("user.language")); + dto.setUserDir(System.getProperty("user.dir")); + dto.setTotalPhysical(osmx.getTotalPhysicalMemorySize()/1024/1024); + dto.setFreePhysical(osmx.getFreePhysicalMemorySize()/1024/1024); + dto.setMemoryRate(BigDecimal.valueOf((1-osmx.getFreePhysicalMemorySize()*1.0/osmx.getTotalPhysicalMemorySize())*100).setScale(2, RoundingMode.HALF_UP)); + dto.setProcessors(osmx.getAvailableProcessors()); + dto.setJvmName(System.getProperty("java.vm.name")); + dto.setJavaVersion(System.getProperty("java.version")); + dto.setJavaHome(System.getProperty("java.home")); + dto.setJavaTotalMemory(Runtime.getRuntime().totalMemory()/1024/1024); + dto.setJavaFreeMemory(Runtime.getRuntime().freeMemory()/1024/1024); + dto.setJavaMaxMemory(Runtime.getRuntime().maxMemory()/1024/1024); + dto.setUserName(System.getProperty("user.name")); + dto.setSystemCpuLoad(BigDecimal.valueOf(osmx.getSystemCpuLoad()*100).setScale(2, RoundingMode.HALF_UP)); + dto.setUserTimezone(System.getProperty("user.timezone")); + + return new Result().ok(dto); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysDeptDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysDeptDao.java new file mode 100644 index 0000000..5d73bf1 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysDeptDao.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysDeptEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysDeptDao extends BaseDao { + + List getList(Map params); + + SysDeptEntity getById(Long id); + + /** + * 获取所有部门的id、pid列表 + */ + List getIdAndPidList(); + + /** + * 根据部门ID,获取所有子部门ID列表 + * @param id 部门ID + */ + List getSubDeptIdList(String id); + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysDictDataDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysDictDataDao.java new file mode 100644 index 0000000..7b9f60e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysDictDataDao.java @@ -0,0 +1,31 @@ +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.dto.SysDictDataDTO; +import com.dkha.server.system.modules.sys.entity.DictData; +import com.dkha.server.system.modules.sys.entity.SysDictDataEntity; +import com.dkha.server.system.modules.sys.entity.SysDictTypeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 字典数据 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysDictDataDao extends BaseDao { + + /** + * 字典数据列表 + */ + List getDictDataList(); + + +// /** +// * 字典数据列表 +// */ +// DictData selectById(); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysDictTypeDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysDictTypeDao.java new file mode 100644 index 0000000..904c99e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysDictTypeDao.java @@ -0,0 +1,23 @@ +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.DictType; +import com.dkha.server.system.modules.sys.entity.SysDictTypeEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysDictTypeDao extends BaseDao { + + /** + * 字典类型列表 + */ + List getDictTypeList(); + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysLanguageDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysLanguageDao.java new file mode 100644 index 0000000..533b760 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysLanguageDao.java @@ -0,0 +1,26 @@ +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysLanguageEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysLanguageDao extends BaseDao { + + SysLanguageEntity getLanguage(SysLanguageEntity entity); + + void updateLanguage(SysLanguageEntity entity); + + /** + * 删除国际化 + * @param tableName 表名 + * @param tableId 表主键 + */ + void deleteLanguage(@Param("tableName") String tableName, @Param("tableId") Long tableId); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysMenuDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysMenuDao.java new file mode 100644 index 0000000..491574d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysMenuDao.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysMenuDao extends BaseDao { + + SysMenuEntity getById(@Param("id") Long id, @Param("language") String language); + + /** + * 查询所有菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + */ + List getMenuList(@Param("type") Integer type, @Param("language") String language); + + /** + * 查询用户菜单列表 + * + * @param userId 用户ID + * @param type 菜单类型 + * @param language 语言 + */ + List getUserMenuList(@Param("userId") Long userId, @Param("type") Integer type, @Param("language") String language); + + /** + * 查询用户权限列表 + * @param userId 用户ID + */ + List getUserPermissionsList(Long userId); + + /** + * 查询所有权限列表 + */ + List getPermissionsList(); + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(Long pid); + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysParamsDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysParamsDao.java new file mode 100644 index 0000000..53171ef --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysParamsDao.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysParamsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysParamsDao extends BaseDao { + /** + * 根据参数编码,查询value + * @param paramCode 参数编码 + * @return 参数值 + */ + String getValueByCode(String paramCode); + + /** + * 获取参数编码列表 + * @param ids ids + * @return 返回参数编码列表 + */ + List getParamCodeList(Long[] ids); + + /** + * 根据参数编码,更新value + * @param paramCode 参数编码 + * @param paramValue 参数值 + */ + int updateValueByCode(@Param("paramCode") String paramCode, @Param("paramValue") String paramValue); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRegionDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRegionDao.java new file mode 100644 index 0000000..86a6d56 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRegionDao.java @@ -0,0 +1,47 @@ +package com.dkha.server.system.modules.sys.dao; + +import com.alibaba.druid.sql.ast.statement.SQLForeignKeyImpl; +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysRegionEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 行政区域 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysRegionDao extends BaseDao { + + List getList(Map params); + + List getListByLevel(Integer treeLevel); + + List> getTreeList(); + + SysRegionEntity getById(Long id); + + int getCountByPid(Long pid); + + /** + * 摄像头卡口 + * + * @param pid + * @return + */ + List> getRegion(@Param("pid") long pid); + + /** + * 获取当前区域下的摄像头 + * + * @param pid + * @param + * @return + */ + List> getRegion1(@Param("pid") long pid); + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleDao.java new file mode 100644 index 0000000..b0f5829 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleDao.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysRoleDao extends BaseDao { + + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleDataScopeDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleDataScopeDao.java new file mode 100644 index 0000000..14616a0 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleDataScopeDao.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysRoleDataScopeEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysRoleDataScopeDao extends BaseDao { + + /** + * 根据角色ID,获取部门ID列表 + */ + List getDeptIdList(Long roleId); + + /** + * 获取用户的部门数据权限列表 + */ + List getDataScopeList(Long userId); + + /** + * 根据角色id,删除角色数据权限关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleMenuDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleMenuDao.java new file mode 100644 index 0000000..c5a5140 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleMenuDao.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysRoleMenuDao extends BaseDao { + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(Long roleId); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(Long menuId); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleUserDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleUserDao.java new file mode 100644 index 0000000..966fc5d --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysRoleUserDao.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysRoleUserEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysRoleUserDao extends BaseDao { + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据用户id,删除角色用户关系 + * @param userIds 用户ids + */ + void deleteByUserIds(Long[] userIds); + + /** + * 角色ID列表 + * @param userId 用户ID + * + * @return + */ + List getRoleIdList(Long userId); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysUserDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysUserDao.java new file mode 100644 index 0000000..9764823 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysUserDao.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysUserEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysUserDao extends BaseDao { + + List getList(Map params); + + SysUserEntity getById(Long id); + + SysUserEntity getByUsername(String username); + + int updatePassword(@Param("id") Long id, @Param("newPassword") String newPassword); + + /** + * 根据部门ID,查询用户数 + */ + int getCountByDeptId(Long deptId); + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysUserTokenDao.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysUserTokenDao.java new file mode 100644 index 0000000..93004f0 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dao/SysUserTokenDao.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dao; + +import com.dkha.server.system.common.dao.BaseDao; +import com.dkha.server.system.modules.sys.entity.SysUserTokenEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 系统用户Token + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysUserTokenDao extends BaseDao { + + SysUserTokenEntity getByToken(String token); + + SysUserTokenEntity getByUserId(Long userId); + + void updateToken(@Param("userId") Long userId, @Param("token") String token); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/PasswordDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/PasswordDTO.java new file mode 100644 index 0000000..0dc188e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/PasswordDTO.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 修改密码 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "修改密码") +public class PasswordDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "原密码") + @NotBlank(message="{sysuser.password.require}") + private String password; + + @ApiModelProperty(value = "新密码") + @NotBlank(message="{sysuser.password.require}") + private String newPassword; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDeptDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDeptDTO.java new file mode 100644 index 0000000..b70f7c3 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDeptDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import com.dkha.server.system.common.utils.TreeNode; +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@ApiModel(value = "部门管理") +public class SysDeptDTO extends TreeNode implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @Null(message="{id.null}", groups = AddGroup.class) + @NotNull(message="{id.require}", groups = UpdateGroup.class) + private Long id; + + @ApiModelProperty(value = "上级ID") + @NotNull(message="{sysdept.pid.require}", groups = DefaultGroup.class) + private Long pid; + + @ApiModelProperty(value = "部门名称") + @NotBlank(message="{sysdept.name.require}", groups = DefaultGroup.class) + private String name; + + @ApiModelProperty(value = "排序") + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "上级部门名称") + private String parentName; + + @Override + public Long getId() { + return id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public Long getPid() { + return pid; + } + + @Override + public void setPid(Long pid) { + this.pid = pid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDictDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDictDTO.java new file mode 100644 index 0000000..1654dd9 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDictDTO.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; + +/** + * 字典数据 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "字典数据") +public class SysDictDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "父id") + private Long pid; + + @ApiModelProperty(value = "码表值类型ID") + @NotNull(message = "码表值类型ID不能为空") + private String dictType; + + @ApiModelProperty(value = "码表名称") + @NotBlank(message = "码表名称不能为空") + private String dictName; +// @NotBlank(message = "码表值不能为空") +// @ApiModelProperty(value = "码表值") +// private String dictValue; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "排序") + private Integer sort; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDictDataDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDictDataDTO.java new file mode 100644 index 0000000..83cf41b --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDictDataDTO.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; + +/** + * 字典数据 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "字典数据") +public class SysDictDataDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @Null(message="{id.null}", groups = AddGroup.class) + @NotNull(message="{id.require}", groups = UpdateGroup.class) + private Long id; + + @ApiModelProperty(value = "字典类型ID") + @NotNull(message="{sysdict.type.require}", groups = DefaultGroup.class) + private Long dictTypeId; + + @ApiModelProperty(value = "字典标签") + @NotBlank(message="{sysdict.label.require}", groups = DefaultGroup.class) + private String dictLabel; + + @ApiModelProperty(value = "字典值") + private String dictValue; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "排序") + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "更新时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date updateDate; +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDictTypeDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDictTypeDTO.java new file mode 100644 index 0000000..c63b4cb --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysDictTypeDTO.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "字典类型") +public class SysDictTypeDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @Null(message="{id.null}", groups = AddGroup.class) + @NotNull(message="{id.require}", groups = UpdateGroup.class) + private Long id; + + @ApiModelProperty(value = "字典类型") + @NotBlank(message="{sysdict.type.require}", groups = DefaultGroup.class) + private String dictType; + + @ApiModelProperty(value = "字典名称") + @NotBlank(message="{sysdict.name.require}", groups = DefaultGroup.class) + private String dictName; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "排序") + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "更新时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date updateDate; +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysMenuDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysMenuDTO.java new file mode 100644 index 0000000..e35a545 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysMenuDTO.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import com.dkha.server.system.common.utils.TreeNode; +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.hibernate.validator.constraints.Range; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@ApiModel(value = "菜单管理") +public class SysMenuDTO extends TreeNode implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @Null(message="{id.null}", groups = AddGroup.class) + @NotNull(message="{id.require}", groups = UpdateGroup.class) + private Long id; + + @ApiModelProperty(value = "上级ID") + @NotNull(message="{sysmenu.pid.require}", groups = DefaultGroup.class) + private Long pid; + + @ApiModelProperty(value = "菜单名称") + @NotBlank(message="{sysmenu.name.require}", groups = DefaultGroup.class) + private String name; + + @ApiModelProperty(value = "菜单URL") + private String url; + + @ApiModelProperty(value = "类型 0:菜单 1:按钮") + @Range(min=0, max=1, message = "{sysmenu.type.range}", groups = DefaultGroup.class) + private Integer type; + + @ApiModelProperty(value = "菜单图标") + private String icon; + + @ApiModelProperty(value = "授权(多个用逗号分隔,如:sys:user:list,sys:user:save)") + private String permissions; + + @ApiModelProperty(value = "排序") + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "上级菜单名称") + private String parentName; + + @Override + public Long getId() { + return id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public Long getPid() { + return pid; + } + + @Override + public void setPid(Long pid) { + this.pid = pid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getPermissions() { + return permissions; + } + + public void setPermissions(String permissions) { + this.permissions = permissions; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysParamsDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysParamsDTO.java new file mode 100644 index 0000000..a5ccaaf --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysParamsDTO.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "参数管理") +public class SysParamsDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @Null(message="{id.null}", groups = AddGroup.class) + @NotNull(message="{id.require}", groups = UpdateGroup.class) + private Long id; + + @ApiModelProperty(value = "参数编码") + @NotBlank(message="{sysparams.paramcode.require}", groups = DefaultGroup.class) + private String paramCode; + + @ApiModelProperty(value = "参数值") + @NotBlank(message="{sysparams.paramvalue.require}", groups = DefaultGroup.class) + private String paramValue; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "更新时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date updateDate; + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysRegionDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysRegionDTO.java new file mode 100644 index 0000000..eb2d3b5 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysRegionDTO.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import com.dkha.server.system.common.utils.TreeNode; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + + +/** + * 行政区域 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "行政区域") +public class SysRegionDTO extends TreeNode implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "区域标识") +// @NotNull(message="{id.require}", groups = DefaultGroup.class) + private Long id; + + @ApiModelProperty(value = "上级区域ID") + @NotNull(message="{region.pid.require}", groups = DefaultGroup.class) + private Long pid; + + @ApiModelProperty(value = "区域名称") + @NotBlank(message="{region.name.require}", groups = DefaultGroup.class) + private String name; + + @ApiModelProperty(value = "排序") + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Long sort; + + @ApiModelProperty(value = "上级区域名称") + private String parentName; + @NotBlank() + @ApiModelProperty(value = "是否有子节点") + private Boolean hasChildren; + + @ApiModelProperty(value = "层级") + private Integer treeLevel; + + @ApiModelProperty(value = "更新时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date updateDate; +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysRoleDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysRoleDTO.java new file mode 100644 index 0000000..25a3bde --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysRoleDTO.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "角色管理") +public class SysRoleDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @Null(message="{id.null}", groups = AddGroup.class) + @NotNull(message="{id.require}", groups = UpdateGroup.class) + private Long id; + + @ApiModelProperty(value = "角色名称") + @NotBlank(message="{sysrole.name.require}", groups = DefaultGroup.class) + private String name; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "菜单ID列表") + private List menuIdList; + + @ApiModelProperty(value = "部门ID列表") + private List deptIdList; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysUserDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysUserDTO.java new file mode 100644 index 0000000..14db317 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SysUserDTO.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import com.dkha.server.system.common.validator.group.AddGroup; +import com.dkha.server.system.common.validator.group.DefaultGroup; +import com.dkha.server.system.common.validator.group.UpdateGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Range; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "用户管理") +public class SysUserDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @Null(message="{id.null}", groups = AddGroup.class) + @NotNull(message="{id.require}", groups = UpdateGroup.class) + private Long id; + + @ApiModelProperty(value = "用户名", required = true) + @NotBlank(message="{sysuser.username.require}", groups = DefaultGroup.class) + private String username; + + @ApiModelProperty(value = "密码") + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + @NotBlank(message="{sysuser.password.require}", groups = AddGroup.class) + private String password; + + @ApiModelProperty(value = "姓名", required = true) + @NotBlank(message="{sysuser.realname.require}", groups = DefaultGroup.class) + private String realName; + + @ApiModelProperty(value = "头像") + private String headUrl; + + @ApiModelProperty(value = "性别 0:男 1:女 2:保密", required = true) + @Range(min=0, max=2, message = "{sysuser.gender.range}", groups = DefaultGroup.class) + private Integer gender; + + @ApiModelProperty(value = "邮箱") + @Email(message="{sysuser.email.error}", groups = DefaultGroup.class) + private String email; + + @ApiModelProperty(value = "手机号") + private String mobile; + + @ApiModelProperty(value = "部门ID", required = true) + @NotNull(message="{sysuser.deptId.require}", groups = DefaultGroup.class) + private Long deptId; + + @ApiModelProperty(value = "状态 0:停用 1:正常", required = true) + @Range(min=0, max=1, message = "{sysuser.status.range}", groups = DefaultGroup.class) + private Integer status; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "超级管理员 0:否 1:是") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Integer superAdmin; + + @ApiModelProperty(value = "角色ID列表") + private List roleIdList; + + @ApiModelProperty(value = "部门名称") + private String deptName; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SystemDTO.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SystemDTO.java new file mode 100644 index 0000000..5b6ae2e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/SystemDTO.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 系统数据 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "系统数据") +public class SystemDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private Long sysTime; + private String osName; + private String osArch; + private String osVersion; + private String userLanguage; + private String userDir; + private Long totalPhysical; + private Long freePhysical; + private BigDecimal memoryRate; + private Integer processors; + private String jvmName; + private String javaVersion; + private String javaHome; + private Long javaTotalMemory; + private Long javaFreeMemory; + private Long javaMaxMemory; + private String userName; + private BigDecimal systemCpuLoad; + private String userTimezone; + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/region/Region.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/region/Region.java new file mode 100644 index 0000000..20d1099 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/region/Region.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto.region; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 地区管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "地区管理") +public class Region implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "地区ID") + private Long id; + + @JsonIgnore + private Long pid; + + @ApiModelProperty(value = "名称") + private String name; +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/region/RegionCity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/region/RegionCity.java new file mode 100644 index 0000000..c386f57 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/region/RegionCity.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto.region; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +/** + * 市 + * + * @author Mark sunlightcs@gmail.com + */ +@ApiModel(value = "市") +@Data +@EqualsAndHashCode(callSuper = true) +public class RegionCity extends Region { + @ApiModelProperty(value = "区、县列表") + private List counties = new ArrayList<>(); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/region/RegionProvince.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/region/RegionProvince.java new file mode 100644 index 0000000..9964f05 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/dto/region/RegionProvince.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.dto.region; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +/** + * 省 + * + * @author Mark sunlightcs@gmail.com + */ +@ApiModel(value = "省") +@Data +@EqualsAndHashCode(callSuper = true) +public class RegionProvince extends Region { + @ApiModelProperty(value = "市列表") + private List cities = new ArrayList<>(); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/DictData.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/DictData.java new file mode 100644 index 0000000..9b7dcc7 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/DictData.java @@ -0,0 +1,16 @@ +package com.dkha.server.system.modules.sys.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +/** + * 字典数据 + * + */ +@Data +public class DictData { + @JsonIgnore + private Long dictTypeId; + private String dictLabel; + private String dictValue; +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/DictType.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/DictType.java new file mode 100644 index 0000000..f83f85e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/DictType.java @@ -0,0 +1,19 @@ +package com.dkha.server.system.modules.sys.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 字典类型 + * + */ +@Data +public class DictType { + @JsonIgnore + private Long id; + private String dictType; + private List dataList = new ArrayList<>(); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDeptEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDeptEntity.java new file mode 100644 index 0000000..81d09ef --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDeptEntity.java @@ -0,0 +1,52 @@ +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 部门管理 + * + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_dept") +public class SysDeptEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 上级ID + */ + private Long pid; + /** + * 所有上级ID,用逗号分开 + */ + private String pids; + /** + * 部门名称 + */ + private String name; + /** + * 排序 + */ + private Integer sort; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + /** + * 上级部门名称 + */ + @TableField(exist = false) + private String parentName; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDictDataEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDictDataEntity.java new file mode 100644 index 0000000..96c12ec --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDictDataEntity.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_dict_data") +public class SysDictDataEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 字典类型ID + */ + private Long dictTypeId; + /** + * 字典标签 + */ + private String dictLabel; + /** + * 字典值 + */ + private String dictValue; + /** + * 备注 + */ + private String remark; + /** + * 排序 + */ + private Integer sort; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDictEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDictEntity.java new file mode 100644 index 0000000..6857d47 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDictEntity.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.dkha.server.system.common.entity.CommonEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("sys_dict") +public class SysDictEntity extends CommonEntity { + private static final long serialVersionUID = 1L; + /** + * id + */ + @TableId(type = IdType.ID_WORKER) + private Long id; + /** + * 上级ID,一级为0 + */ + private Long pid; + /** + * 字典类型 + */ + private String dictType; + /** + * 字典名称 + */ + private String dictName; + /** + * 字典值 + */ + private String dictValue; + /** + * 备注 + */ + private String remark; + /** + * 排序 + */ + private Integer sort; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDictTypeEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDictTypeEntity.java new file mode 100644 index 0000000..d15fa53 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysDictTypeEntity.java @@ -0,0 +1,48 @@ +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_dict_type") +public class SysDictTypeEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 字典类型 + */ + private String dictType; + /** + * 字典名称 + */ + private String dictName; + /** + * 备注 + */ + private String remark; + /** + * 排序 + */ + private Integer sort; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysLanguageEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysLanguageEntity.java new file mode 100644 index 0000000..84a5456 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysLanguageEntity.java @@ -0,0 +1,39 @@ +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_language") +public class SysLanguageEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 表名 + */ + private String tableName; + /** + * 表主键 + */ + private Long tableId; + /** + * 字段名 + */ + private String fieldName; + /** + * 字段值 + */ + private String fieldValue; + /** + * 语言 + */ + private String language; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysMenuEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysMenuEntity.java new file mode 100644 index 0000000..cfc2dd6 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysMenuEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_menu") +public class SysMenuEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 父菜单ID,一级菜单为0 + */ + private Long pid; + /** + * 菜单名称 + */ + @TableField(exist = false) + private String name; + /** + * 菜单URL + */ + private String url; + /** + * 授权(多个用逗号分隔,如:sys:user:list,sys:user:save) + */ + private String permissions; + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + /** + * 菜单图标 + */ + private String icon; + /** + * 排序 + */ + private Integer sort; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + /** + * 上级菜单名称 + */ + @TableField(exist = false) + private String parentName; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysParamsEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysParamsEntity.java new file mode 100644 index 0000000..555d2fc --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysParamsEntity.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_params") +public class SysParamsEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 参数编码 + */ + private String paramCode; + /** + * 参数值 + */ + private String paramValue; + /** + * 类型 0:系统参数 1:非系统参数 + */ + private Integer paramType; + /** + * 备注 + */ + private String remark; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRegionEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRegionEntity.java new file mode 100644 index 0000000..bd9c1e0 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRegionEntity.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 行政区域 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_region") +public class SysRegionEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ID_WORKER,value = "id") + private Long id; + /** + * 上级ID,一级为0 + */ + private Long pid; + /** + * 名称 + */ + private String name; + /** + * 层级 + */ + private Integer treeLevel; + /** + * 排序 + */ + private Long sort; + /** + * 是否叶子节点 0:否 1:是 + */ + private Integer leaf; + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long creator; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createDate; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + /** + * 上级名称 + */ + @TableField(exist = false) + private String parentName; +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleDataScopeEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleDataScopeEntity.java new file mode 100644 index 0000000..8f778ee --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleDataScopeEntity.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_role_data_scope") +public class SysRoleDataScopeEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private Long roleId; + /** + * 部门ID + */ + private Long deptId; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleEntity.java new file mode 100644 index 0000000..f5f1273 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleEntity.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 角色 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_role") +public class SysRoleEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色名称 + */ + private String name; + /** + * 备注 + */ + private String remark; + /** + * 部门ID + */ + @TableField(fill = FieldFill.INSERT) + private Long deptId; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleMenuEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleMenuEntity.java new file mode 100644 index 0000000..64bb825 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleMenuEntity.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色菜单关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_role_menu") +public class SysRoleMenuEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 角色ID + */ + private Long roleId; + /** + * 菜单ID + */ + private Long menuId; + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleUserEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleUserEntity.java new file mode 100644 index 0000000..04f7eee --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysRoleUserEntity.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_role_user") +public class SysRoleUserEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private Long roleId; + /** + * 用户ID + */ + private Long userId; + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysUserEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysUserEntity.java new file mode 100644 index 0000000..aba2b78 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysUserEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dkha.server.system.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_user") +public class SysUserEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 用户名 + */ + private String username; + /** + * 密码 + */ + private String password; + /** + * 姓名 + */ + private String realName; + /** + * 头像 + */ + private String headUrl; + /** + * 性别 0:男 1:女 2:保密 + */ + private Integer gender; + /** + * 邮箱 + */ + private String email; + /** + * 手机号 + */ + private String mobile; + /** + * 部门ID + */ + private Long deptId; + /** + * 超级管理员 0:否 1:是 + */ + private Integer superAdmin; + /** + * 状态 0:停用 1:正常 + */ + private Integer status; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + /** + * 部门名称 + */ + @TableField(exist=false) + private String deptName; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysUserTokenEntity.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysUserTokenEntity.java new file mode 100644 index 0000000..054ca36 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/entity/SysUserTokenEntity.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 系统用户Token + */ +@Data +@TableName("sys_user_token") +public class SysUserTokenEntity implements Serializable { + private static final long serialVersionUID = 1L; + /** + * id + */ + @TableId + private Long id; + /** + * 用户ID + */ + private Long userId; + /** + * 用户token + */ + private String token; + /** + * 过期时间 + */ + private Date expireDate; + /** + * 更新时间 + */ + private Date updateDate; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createDate; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/MenuTypeEnum.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/MenuTypeEnum.java new file mode 100644 index 0000000..76930fe --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/MenuTypeEnum.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.enums; + +/** + * 菜单类型枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum MenuTypeEnum { + /** + * 菜单 + */ + MENU(0), + /** + * 按钮 + */ + BUTTON(1); + + private int value; + + MenuTypeEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/RegionLeafEnum.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/RegionLeafEnum.java new file mode 100644 index 0000000..0915005 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/RegionLeafEnum.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.enums; + +/** + * 叶子节点枚举 + * + * @author Mark sunlightcs@gmail.com + */ +public enum RegionLeafEnum { + YES(1), + NO(0); + + private int value; + + RegionLeafEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/RegionLevelEnum.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/RegionLevelEnum.java new file mode 100644 index 0000000..1ddfcf9 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/RegionLevelEnum.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.enums; + +/** + * 行政区域 级别枚举 + * + * @author Mark sunlightcs@gmail.com + */ +public enum RegionLevelEnum { + ONE(1), + TWO(2), + THREE(3); + + private int value; + + RegionLevelEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/RegionTopEnum.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/RegionTopEnum.java new file mode 100644 index 0000000..4bbd8cc --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/RegionTopEnum.java @@ -0,0 +1,18 @@ +package com.dkha.server.system.modules.sys.enums; + +/** + * 顶级区域 + */ +public enum RegionTopEnum { + FATHER(0); + + private long value; + + RegionTopEnum(int value) { + this.value = value; + } + + public long value() { + return this.value; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/SuperAdminEnum.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/SuperAdminEnum.java new file mode 100644 index 0000000..5080b60 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/SuperAdminEnum.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.enums; + +/** + * 超级管理员枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum SuperAdminEnum { + YES(1), + NO(0); + + private int value; + + SuperAdminEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/UserStatusEnum.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/UserStatusEnum.java new file mode 100644 index 0000000..46bbfe7 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/enums/UserStatusEnum.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.enums; + +/** + * 用户状态 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum UserStatusEnum { + DISABLE(0), + ENABLED(1); + + private int value; + + UserStatusEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/excel/SysParamsExcel.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/excel/SysParamsExcel.java new file mode 100644 index 0000000..c80b098 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/excel/SysParamsExcel.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysParamsExcel { + @Excel(name = "参数编码") + private String paramCode; + @Excel(name = "参数值") + private String paramValue; + @Excel(name = "备注") + private String remark; + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/excel/SysUserExcel.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/excel/SysUserExcel.java new file mode 100644 index 0000000..bd28b4e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/excel/SysUserExcel.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysUserExcel { + @Excel(name = "用户名") + private String username; + @Excel(name = "姓名") + private String realName; + @Excel(name = "性别", replace = {"男_0", "女_1", "保密_2"}) + private Integer gender; + @Excel(name = "邮箱") + private String email; + @Excel(name = "手机号") + private String mobile; + @Excel(name = "部门名称") + private String deptName; + @Excel(name = "状态", replace = {"停用_0", "正常_1"}) + private Integer status; + @Excel(name = "备注") + private String remark; + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") + private Date createDate; + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/redis/SysParamsRedis.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/redis/SysParamsRedis.java new file mode 100644 index 0000000..25db847 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/redis/SysParamsRedis.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.redis; + +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class SysParamsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] paramCodes) { + String key = RedisKeys.getSysParamsKey(); + redisUtils.hDel(key, paramCodes); + } + + public void set(String paramCode, String paramValue){ + if(paramValue == null){ + return ; + } + String key = RedisKeys.getSysParamsKey(); + redisUtils.hSet(key, paramCode, paramValue); + } + + public String get(String paramCode){ + String key = RedisKeys.getSysParamsKey(); + return (String)redisUtils.hGet(key, paramCode); + } + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysDeptService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysDeptService.java new file mode 100644 index 0000000..34a661b --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysDeptService.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.dto.SysDeptDTO; +import com.dkha.server.system.modules.sys.entity.SysDeptEntity; + +import java.util.List; +import java.util.Map; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysDeptService extends BaseService { + + List list(Map params); + + SysDeptDTO get(Long id); + + void save(SysDeptDTO dto); + + void update(SysDeptDTO dto); + + void delete(Long id); + + /** + * 根据部门ID,获取本部门及子部门ID列表 + * @param id 部门ID + */ + List getSubDeptIdList(Long id); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysDictDataService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysDictDataService.java new file mode 100644 index 0000000..47f5233 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysDictDataService.java @@ -0,0 +1,27 @@ +package com.dkha.server.system.modules.sys.service; + +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.dto.SysDictDataDTO; +import com.dkha.server.system.modules.sys.entity.SysDictDataEntity; + +import java.util.Map; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysDictDataService extends BaseService { + + PageData page(Map params); + + SysDictDataDTO get(Long id); + + void save(SysDictDataDTO dto); + + void update(SysDictDataDTO dto); + + void delete(Long[] ids); + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysDictTypeService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysDictTypeService.java new file mode 100644 index 0000000..2977e83 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysDictTypeService.java @@ -0,0 +1,37 @@ +package com.dkha.server.system.modules.sys.service; + +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.dto.SysDictTypeDTO; +import com.dkha.server.system.modules.sys.entity.DictType; +import com.dkha.server.system.modules.sys.entity.SysDictDataEntity; +import com.dkha.server.system.modules.sys.entity.SysDictTypeEntity; + +import java.util.List; +import java.util.Map; + +public interface SysDictTypeService extends BaseService { + + PageData page(Map params); + + SysDictTypeDTO get(Long id); + + void save(SysDictTypeDTO dto); + + void update(SysDictTypeDTO dto); + + void delete(Long[] ids); + + /** + * 获取所有字典 + */ + List getAllList(); + + /** + * 按类型获取 + * @param type + * @return + */ + List getByType(String type); + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysLanguageService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysLanguageService.java new file mode 100644 index 0000000..dbf4bda --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysLanguageService.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + + +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.entity.SysLanguageEntity; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysLanguageService extends BaseService { + + /** + * 保存或更新 + * @param tableName 表名 + * @param tableId 表主键 + * @param fieldName 字段名 + * @param fieldValue 字段值 + * @param language 语言 + */ + void saveOrUpdate(String tableName, Long tableId, String fieldName, String fieldValue, String language); + + /** + * 删除国际化 + * @param tableName 表名 + * @param tableId 表主键 + */ + void deleteLanguage(String tableName, Long tableId); +} + diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysMenuService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysMenuService.java new file mode 100644 index 0000000..4f7eb69 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysMenuService.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.dto.SysMenuDTO; +import com.dkha.server.system.modules.sys.entity.SysMenuEntity; +import java.util.List; + + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysMenuService extends BaseService { + + SysMenuDTO get(Long id); + + void save(SysMenuDTO dto); + + void update(SysMenuDTO dto); + + void delete(Long id); + + /** + * 菜单列表 + * + * @param type 菜单类型 + */ + List getAllMenuList(Integer type); + + /** + * 用户菜单列表 + * + * @param user 用户 + * @param type 菜单类型 + */ + List getUserMenuList(UserDetail user, Integer type); + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(Long pid); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysParamsService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysParamsService.java new file mode 100644 index 0000000..f03c9ac --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysParamsService.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + + + +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.dto.SysParamsDTO; +import com.dkha.server.system.modules.sys.entity.SysParamsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysParamsService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysParamsDTO get(Long id); + + void save(SysParamsDTO dto); + + void update(SysParamsDTO dto); + + void delete(Long[] ids); + + /** + * 根据参数编码,获取参数的value值 + * + * @param paramCode 参数编码 + */ + String getValue(String paramCode); + + /** + * 根据参数编码,获取value的Object对象 + * @param paramCode 参数编码 + * @param clazz Object对象 + */ + T getValueObject(String paramCode, Class clazz); + + /** + * 根据参数编码,更新value + * @param paramCode 参数编码 + * @param paramValue 参数值 + */ + int updateValueByCode(String paramCode, String paramValue); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRegionService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRegionService.java new file mode 100644 index 0000000..9acfbc4 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRegionService.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.dto.SysRegionDTO; +import com.dkha.server.system.modules.sys.dto.region.RegionProvince; +import com.dkha.server.system.modules.sys.entity.SysRegionEntity; + +import java.util.List; +import java.util.Map; + +/** + * 行政区域 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysRegionService extends BaseService { + + List list(Map params); + + /** + * 获取树形结构地区码表 + * @return + */ + List allList(); + List> getTreeList(); + + SysRegionDTO get(Long id); + + void save(SysRegionDTO dto); + + void update(SysRegionDTO dto); + + void delete(Long id); + + int getCountByPid(Long pid); + + List getRegion(boolean threeLevel); + + /** + * 根据地区登记查询码值 + * @param level + * @return + */ + List getRegionByLevel(Integer level); + + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleDataScopeService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleDataScopeService.java new file mode 100644 index 0000000..e8b1af6 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleDataScopeService.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + + +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.entity.SysRoleDataScopeEntity; + +import java.util.List; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysRoleDataScopeService extends BaseService { + + /** + * 根据角色ID,获取部门ID列表 + */ + List getDeptIdList(Long roleId); + + /** + * 保存或修改 + * @param roleId 角色ID + * @param deptIdList 部门ID列表 + */ + void saveOrUpdate(Long roleId, List deptIdList); + + /** + * 根据角色id,删除角色数据权限关系 + * @param roleId 角色ids + */ + void deleteByRoleIds(Long[] roleId); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleMenuService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleMenuService.java new file mode 100644 index 0000000..095a92b --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleMenuService.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + + +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.entity.SysRoleMenuEntity; + +import java.util.List; + + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysRoleMenuService extends BaseService { + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(Long roleId); + + /** + * 保存或修改 + * @param roleId 角色ID + * @param menuIdList 菜单ID列表 + */ + void saveOrUpdate(Long roleId, List menuIdList); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(Long menuId); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleService.java new file mode 100644 index 0000000..b02a4da --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleService.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + + + +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.dto.SysRoleDTO; +import com.dkha.server.system.modules.sys.entity.SysRoleEntity; + +import java.util.List; +import java.util.Map; + + +/** + * 角色 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysRoleService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysRoleDTO get(Long id); + + void save(SysRoleDTO dto); + + void update(SysRoleDTO dto); + + void delete(Long[] ids); + +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleUserService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleUserService.java new file mode 100644 index 0000000..dada4da --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysRoleUserService.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + + +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.entity.SysRoleUserEntity; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysRoleUserService extends BaseService { + + /** + * 保存或修改 + * @param userId 用户ID + * @param roleIdList 角色ID列表 + */ + void saveOrUpdate(Long userId, List roleIdList); + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据用户id,删除角色用户关系 + * @param userIds 用户ids + */ + void deleteByUserIds(Long[] userIds); + + /** + * 角色ID列表 + * @param userId 用户ID + */ + List getRoleIdList(Long userId); +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysUserService.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysUserService.java new file mode 100644 index 0000000..d074ecf --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/SysUserService.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service; + + +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.BaseService; +import com.dkha.server.system.modules.sys.dto.SysUserDTO; +import com.dkha.server.system.modules.sys.entity.SysUserEntity; + +import java.util.List; +import java.util.Map; + + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysUserService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysUserDTO get(Long id); + + SysUserDTO getByUsername(String username); + + void save(SysUserDTO dto); + + void update(SysUserDTO dto); + + void delete(Long[] ids); + + /** + * 修改密码 + * @param id 用户ID + * @param newPassword 新密码 + */ + void updatePassword(Long id, String newPassword); + + /** + * 根据部门ID,查询用户数 + */ + int getCountByDeptId(Long deptId); +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysDeptServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysDeptServiceImpl.java new file mode 100644 index 0000000..1d8c3cd --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysDeptServiceImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.exception.RenException; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.common.utils.TreeUtils; +import com.dkha.server.system.modules.security.user.SecurityUser; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.dao.SysDeptDao; +import com.dkha.server.system.modules.sys.dto.SysDeptDTO; +import com.dkha.server.system.modules.sys.entity.SysDeptEntity; +import com.dkha.server.system.modules.sys.enums.SuperAdminEnum; +import com.dkha.server.system.modules.sys.service.SysDeptService; +import com.dkha.server.system.modules.sys.service.SysUserService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + + +@Service +public class SysDeptServiceImpl extends BaseServiceImpl implements SysDeptService { + @Autowired + private SysUserService sysUserService; + + @Override + public List list(Map params) { + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if(user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + params.put("deptIdList", getSubDeptIdList(user.getDeptId())); + } + + //查询部门列表 + List entityList = baseDao.getList(params); + + List dtoList = ConvertUtils.sourceToTarget(entityList, SysDeptDTO.class); + + return TreeUtils.build(dtoList); + } + + @Override + public SysDeptDTO get(Long id) { + //超级管理员,部门ID为null + if(id == null){ + return null; + } + + SysDeptEntity entity = baseDao.getById(id); + + return ConvertUtils.sourceToTarget(entity, SysDeptDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysDeptDTO dto) { + SysDeptEntity entity = ConvertUtils.sourceToTarget(dto, SysDeptEntity.class); + + entity.setPids(getPidList(entity.getPid())); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysDeptDTO dto) { + SysDeptEntity entity = ConvertUtils.sourceToTarget(dto, SysDeptEntity.class); + + //上级部门不能为自身 + if(entity.getId().equals(entity.getPid())){ + throw new RenException(ErrorCode.SUPERIOR_DEPT_ERROR); + } + + //上级部门不能为下级部门 + List subDeptList = getSubDeptIdList(entity.getId()); + if(subDeptList.contains(entity.getPid())){ + throw new RenException(ErrorCode.SUPERIOR_DEPT_ERROR); + } + + entity.setPids(getPidList(entity.getPid())); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + //判断是否有子部门 + List subList = getSubDeptIdList(id); + if(subList.size() > 1){ + throw new RenException(ErrorCode.DEPT_SUB_DELETE_ERROR); + } + + //判断部门下面是否有用户 + int count = sysUserService.getCountByDeptId(id); + if(count > 0){ + throw new RenException(ErrorCode.DEPT_USER_DELETE_ERROR); + } + + //删除 + baseDao.deleteById(id); + } + + @Override + public List getSubDeptIdList(Long id) { + List deptIdList = baseDao.getSubDeptIdList("%" + id + "%"); + deptIdList.add(id); + + return deptIdList; + } + + /** + * 获取所有上级部门ID + * @param pid 上级ID + */ + private String getPidList(Long pid){ + //顶级部门,无上级部门 + if(Constant.DEPT_ROOT.equals(pid)){ + return Constant.DEPT_ROOT + ""; + } + + //所有部门的id、pid列表 + List deptList = baseDao.getIdAndPidList(); + + //list转map + Map map = new HashMap<>(deptList.size()); + for(SysDeptEntity entity : deptList){ + map.put(entity.getId(), entity); + } + + //递归查询所有上级部门ID列表 + List pidList = new ArrayList<>(); + getPidTree(pid, map, pidList); + + return StringUtils.join(pidList, ","); + } + + private void getPidTree(Long pid, Map map, List pidList) { + //顶级部门,无上级部门 + if(Constant.DEPT_ROOT.equals(pid)){ + return ; + } + + //上级部门存在 + SysDeptEntity parent = map.get(pid); + if(parent != null){ + getPidTree(parent.getPid(), map, pidList); + } + + pidList.add(pid); + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysDictDataServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysDictDataServiceImpl.java new file mode 100644 index 0000000..9526566 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysDictDataServiceImpl.java @@ -0,0 +1,80 @@ +package com.dkha.server.system.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.modules.sys.dao.SysDictDataDao; +import com.dkha.server.system.modules.sys.dto.SysDictDataDTO; +import com.dkha.server.system.modules.sys.entity.SysDictDataEntity; +import com.dkha.server.system.modules.sys.service.SysDictDataService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Map; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysDictDataServiceImpl extends BaseServiceImpl implements SysDictDataService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, "sort", true), + getWrapper(params) + ); + + return getPageData(page, SysDictDataDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String dictTypeId = (String) params.get("dictTypeId"); + String dictLabel = (String) params.get("dictLabel"); + String dictValue = (String) params.get("dictValue"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("dict_type_id", dictTypeId); + wrapper.like(StringUtils.isNotBlank(dictLabel), "dict_label", dictLabel); + wrapper.like(StringUtils.isNotBlank(dictValue), "dict_value", dictValue); + + return wrapper; + } + + @Override + public SysDictDataDTO get(Long id) { + SysDictDataEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysDictDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysDictDataDTO dto) { + SysDictDataEntity entity = ConvertUtils.sourceToTarget(dto, SysDictDataEntity.class); + + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysDictDataDTO dto) { + SysDictDataEntity entity = ConvertUtils.sourceToTarget(dto, SysDictDataEntity.class); + + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除 + deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysDictTypeServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysDictTypeServiceImpl.java new file mode 100644 index 0000000..b94d5c7 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysDictTypeServiceImpl.java @@ -0,0 +1,111 @@ +package com.dkha.server.system.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.modules.sys.dao.SysDictDataDao; +import com.dkha.server.system.modules.sys.dao.SysDictTypeDao; +import com.dkha.server.system.modules.sys.dto.SysDictTypeDTO; +import com.dkha.server.system.modules.sys.entity.DictData; +import com.dkha.server.system.modules.sys.entity.DictType; +import com.dkha.server.system.modules.sys.entity.SysDictDataEntity; +import com.dkha.server.system.modules.sys.entity.SysDictTypeEntity; +import com.dkha.server.system.modules.sys.service.SysDictTypeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysDictTypeServiceImpl extends BaseServiceImpl implements SysDictTypeService { + @Autowired + private SysDictDataDao sysDictDataDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, "sort", true), + getWrapper(params) + ); + + return getPageData(page, SysDictTypeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String dictType = (String) params.get("dictType"); + String dictName = (String) params.get("dictName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(dictType), "dict_type", dictType); + wrapper.like(StringUtils.isNotBlank(dictName), "dict_name", dictName); + + return wrapper; + } + + @Override + public SysDictTypeDTO get(Long id) { + SysDictTypeEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysDictTypeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysDictTypeDTO dto) { + SysDictTypeEntity entity = ConvertUtils.sourceToTarget(dto, SysDictTypeEntity.class); + + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysDictTypeDTO dto) { + SysDictTypeEntity entity = ConvertUtils.sourceToTarget(dto, SysDictTypeEntity.class); + + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除 + deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List getAllList() { + List typeList = baseDao.getDictTypeList(); + List dataList = sysDictDataDao.getDictDataList(); + for(DictType type : typeList){ + for(DictData data : dataList){ + if(type.getId().equals(data.getDictTypeId())){ + type.getDataList().add(data); + } + } + } + return typeList; + } + + @Override + public List getByType(String type) { + SysDictTypeEntity entity = baseDao.selectOne(new QueryWrapper().eq("dict_type",type)); + List entities = new ArrayList<>(); + if (UtilValidate.isNotEmpty(entity)) { + entities= sysDictDataDao.selectList(new QueryWrapper().eq("dict_type_id",entity.getId())); + } + return entities; + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysLanguageServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysLanguageServiceImpl.java new file mode 100644 index 0000000..193c7fa --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysLanguageServiceImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.modules.sys.dao.SysLanguageDao; +import com.dkha.server.system.modules.sys.entity.SysLanguageEntity; +import com.dkha.server.system.modules.sys.service.SysLanguageService; +import org.springframework.stereotype.Service; + + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysLanguageServiceImpl extends BaseServiceImpl implements SysLanguageService { + + @Override + public void saveOrUpdate(String tableName, Long tableId, String fieldName, String fieldValue, String language) { + SysLanguageEntity entity = new SysLanguageEntity(); + entity.setTableName(tableName); + entity.setTableId(tableId); + entity.setFieldName(fieldName); + entity.setFieldValue(fieldValue); + entity.setLanguage(language); + + //判断是否有数据 + if(baseDao.getLanguage(entity) == null){ + baseDao.insert(entity); + }else { + baseDao.updateLanguage(entity); + } + } + + @Override + public void deleteLanguage(String tableName, Long tableId) { + baseDao.deleteLanguage(tableName, tableId); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysMenuServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysMenuServiceImpl.java new file mode 100644 index 0000000..47f8f08 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysMenuServiceImpl.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.exception.RenException; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.common.utils.HttpContextUtils; +import com.dkha.server.system.common.utils.TreeUtils; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.dao.SysMenuDao; +import com.dkha.server.system.modules.sys.dto.SysMenuDTO; +import com.dkha.server.system.modules.sys.entity.SysMenuEntity; +import com.dkha.server.system.modules.sys.enums.SuperAdminEnum; +import com.dkha.server.system.modules.sys.service.SysLanguageService; +import com.dkha.server.system.modules.sys.service.SysMenuService; +import com.dkha.server.system.modules.sys.service.SysRoleMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service +public class SysMenuServiceImpl extends BaseServiceImpl implements SysMenuService { + @Autowired + private SysRoleMenuService sysRoleMenuService; + @Autowired + private SysLanguageService sysLanguageService; + + @Override + public SysMenuDTO get(Long id) { + SysMenuEntity entity = baseDao.getById(id, HttpContextUtils.getLanguage()); + + SysMenuDTO dto = ConvertUtils.sourceToTarget(entity, SysMenuDTO.class); + + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysMenuDTO dto) { + SysMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysMenuEntity.class); + + //保存菜单 + insert(entity); + saveLanguage(entity.getId(), "name", entity.getName()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysMenuDTO dto) { + SysMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysMenuEntity.class); + + //上级菜单不能为自身 + if(entity.getId().equals(entity.getPid())){ + throw new RenException(ErrorCode.SUPERIOR_MENU_ERROR); + } + + //更新菜单 + updateById(entity); + saveLanguage(entity.getId(), "name", entity.getName()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + //删除菜单 + deleteById(id); + + //删除菜单国际化 + sysLanguageService.deleteLanguage("sys_menu", id); + + //删除角色菜单关系 + sysRoleMenuService.deleteByMenuId(id); + } + + @Override + public List getAllMenuList(Integer type) { + List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + + List dtoList = ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); + + return TreeUtils.build(dtoList, Constant.MENU_ROOT); + } + + @Override + public List getUserMenuList(UserDetail user, Integer type) { + List menuList; + + //系统管理员,拥有最高权限 + if(user.getSuperAdmin() == SuperAdminEnum.YES.value()){ + menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + }else { + menuList = baseDao.getUserMenuList(user.getId(), type, HttpContextUtils.getLanguage()); + } + + List dtoList = ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); + + return TreeUtils.build(dtoList); + } + + @Override + public List getListPid(Long pid) { + List menuList = baseDao.getListPid(pid); + + return ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); + } + + private void saveLanguage(Long tableId, String fieldName, String fieldValue){ + sysLanguageService.saveOrUpdate("sys_menu", tableId, fieldName, fieldValue, HttpContextUtils.getLanguage()); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysParamsServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysParamsServiceImpl.java new file mode 100644 index 0000000..9010c1f --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysParamsServiceImpl.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.exception.RenException; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.modules.sys.dao.SysParamsDao; +import com.dkha.server.system.modules.sys.dto.SysParamsDTO; +import com.dkha.server.system.modules.sys.entity.SysParamsEntity; +import com.dkha.server.system.modules.sys.redis.SysParamsRedis; +import com.dkha.server.system.modules.sys.service.SysParamsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysParamsServiceImpl extends BaseServiceImpl implements SysParamsService { + @Autowired + private SysParamsRedis sysParamsRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysParamsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysParamsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String paramCode = (String) params.get("paramCode"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("param_type", 1); + wrapper.like(UtilValidate.isNotEmpty(paramCode), "param_code", paramCode); + + return wrapper; + } + + @Override + public SysParamsDTO get(Long id) { + SysParamsEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysParamsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysParamsDTO dto) { + SysParamsEntity entity = ConvertUtils.sourceToTarget(dto, SysParamsEntity.class); + insert(entity); + + sysParamsRedis.set(entity.getParamCode(), entity.getParamValue()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysParamsDTO dto) { + SysParamsEntity entity = ConvertUtils.sourceToTarget(dto, SysParamsEntity.class); + updateById(entity); + + sysParamsRedis.set(entity.getParamCode(), entity.getParamValue()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除Redis数据 + List paramCodeList = baseDao.getParamCodeList(ids); + String[] paramCodes = paramCodeList.toArray(new String[paramCodeList.size()]); + sysParamsRedis.delete(paramCodes); + + //删除 + deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public String getValue(String paramCode) { + String paramValue = sysParamsRedis.get(paramCode); + if(paramValue == null){ + paramValue = baseDao.getValueByCode(paramCode); + + sysParamsRedis.set(paramCode, paramValue); + } + return paramValue; + } + + @Override + public T getValueObject(String paramCode, Class clazz) { + String paramValue = getValue(paramCode); + if(UtilValidate.isNotEmpty(paramValue)){ + return JSON.parseObject(paramValue, clazz); + } + + try { + return clazz.newInstance(); + } catch (Exception e) { + throw new RenException(ErrorCode.PARAMS_GET_ERROR); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int updateValueByCode(String paramCode, String paramValue) { + int count = baseDao.updateValueByCode(paramCode, paramValue); + sysParamsRedis.set(paramCode, paramValue); + return count; + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRegionServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRegionServiceImpl.java new file mode 100644 index 0000000..6ad8c15 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRegionServiceImpl.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dkha.common.enums.YNEnums; +import com.dkha.common.exception.DkException; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.modules.entities.FaceCameraEntity; +import com.dkha.server.services.FaceCameraService; +import com.dkha.server.services.IControlBayonetMidService; +import com.dkha.server.system.common.exception.ErrorCode; +import com.dkha.server.system.common.exception.RenException; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.common.utils.TreeUtils; +import com.dkha.server.system.modules.security.user.SecurityUser; +import com.dkha.server.system.modules.sys.dao.SysRegionDao; +import com.dkha.server.system.modules.sys.dto.SysDictDTO; +import com.dkha.server.system.modules.sys.dto.SysRegionDTO; +import com.dkha.server.system.modules.sys.dto.region.Region; +import com.dkha.server.system.modules.sys.dto.region.RegionCity; +import com.dkha.server.system.modules.sys.dto.region.RegionProvince; +import com.dkha.server.system.modules.sys.entity.SysRegionEntity; +import com.dkha.server.system.modules.sys.enums.RegionLeafEnum; +import com.dkha.server.system.modules.sys.enums.RegionLevelEnum; +import com.dkha.server.system.modules.sys.enums.RegionTopEnum; +import com.dkha.server.system.modules.sys.service.SysRegionService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + + +@Service +public class SysRegionServiceImpl extends BaseServiceImpl implements SysRegionService { + + @Autowired + private IControlBayonetMidService controlBayonetMidServiceImpl; + + @Autowired + private FaceCameraService faceCameraServiceImpl; + + @Override + public List list(Map params) { + String pid = (String) params.get("pid"); + + if (UtilValidate.isEmpty(pid)) { + //查询一级 + params.put("treeLevel", RegionLevelEnum.ONE.value()); + } + //查询列表 + List entityList = baseDao.getList(params); + + List dtoList = new ArrayList<>(entityList.size()); + for (SysRegionEntity entity : entityList) { + SysRegionDTO dto = new SysRegionDTO(); + BeanUtils.copyProperties(entity, dto); + dto.setHasChildren(entity.getLeaf() != 1); + + dtoList.add(dto); + } + + return dtoList; + } + + @Override + public List allList() { + List list = baseDao.selectList(new QueryWrapper<>()); + List dtoList = ConvertUtils.sourceToTarget(list, SysRegionDTO.class); + return TreeUtils.build(dtoList); + } + + @Override + public List> getTreeList() { + return baseDao.getTreeList(); + } + + @Override + public SysRegionDTO get(Long id) { + SysRegionEntity entity = baseDao.getById(id); + + return ConvertUtils.sourceToTarget(entity, SysRegionDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysRegionDTO dto) { + SysRegionEntity entity = ConvertUtils.sourceToTarget(dto, SysRegionEntity.class); + + //查询上级 + SysRegionEntity parentEntity = baseDao.getById(dto.getPid()); + if (parentEntity == null) { + entity.setTreeLevel(RegionLevelEnum.ONE.value()); + //查询当前有几个第一级区域 + List firstLevel = baseDao.selectList(new QueryWrapper().eq("tree_level", 1)); + //当前存在多个一级区域 + if (firstLevel != null && firstLevel.size() > 0) { + entity.setPid(Long.valueOf(firstLevel.size())); + } + } else { + + entity.setTreeLevel(parentEntity.getTreeLevel() + 1); + //上级存在,且为叶子节点,需要修改为非叶子节点 + if (parentEntity.getLeaf() == RegionLeafEnum.YES.value()) { + parentEntity.setLeaf(RegionLeafEnum.NO.value()); + baseDao.updateById(parentEntity); + } + } + entity.setCreator(SecurityUser.getUser() == null ? null : SecurityUser.getUser().getId()); + entity.setCreateDate(new Date()); + entity.setUpdater(SecurityUser.getUser() == null ? null : SecurityUser.getUser().getId()); + entity.setUpdateDate(new Date()); + //新增都是叶子节点 + entity.setLeaf(RegionLeafEnum.YES.value()); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysRegionDTO dto) { + SysRegionEntity entity = ConvertUtils.sourceToTarget(dto, SysRegionEntity.class); + + //上级不能为自身 + if (entity.getId().equals(entity.getPid())) { + throw new RenException(ErrorCode.SUPERIOR_REGION_ERROR); + } + + //查询上级 + SysRegionEntity parentEntity = baseDao.getById(dto.getPid()); + if (parentEntity == null) { + entity.setTreeLevel(RegionLevelEnum.ONE.value()); + } else { + entity.setTreeLevel(parentEntity.getTreeLevel() + 1); + //上级存在,且为叶子节点,需要修改为非叶子节点 + if (parentEntity.getLeaf() == RegionLeafEnum.YES.value()) { + parentEntity.setLeaf(RegionLeafEnum.NO.value()); + baseDao.updateById(parentEntity); + } + } + + //查询下级 + int subCount = baseDao.getCountByPid(dto.getId()); + if (subCount == 0) { + entity.setLeaf(RegionLeafEnum.YES.value()); + } else { + entity.setLeaf(RegionLeafEnum.NO.value()); + } + entity.setUpdater(SecurityUser.getUser() == null ? null : SecurityUser.getUser().getId()); + entity.setUpdateDate(new Date()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + //判断是否为顶级区域 + SysRegionEntity dao = baseDao.getById(id); +// if (dao.getPid() == RegionTopEnum.FATHER.value()) { +// throw new DkException("该区域为顶级区域、不允许删除"); +// } + //判断区域下是否有摄像头 + List> list = faceCameraServiceImpl.listMaps(new QueryWrapper().eq("is_valid", YNEnums.YES.code).like("camera_region_firstlevel", "%" + id + "%")); + if (UtilValidate.isNotEmpty(list)) { + throw new DkException("该区域下存在布控任务或者摄像头,不允许删除"); + } + baseDao.deleteById(id); + //判断父级是否还有子级,若无修改上级为叶子节点 + if (baseDao.getCountByPid(dao.getPid()) == 0) { + SysRegionEntity fatherDao = baseDao.getById(dao.getPid()); + if (UtilValidate.isNotEmpty(fatherDao)) { + fatherDao.setLeaf(RegionLeafEnum.YES.value()); + baseDao.updateById(fatherDao); + } + + } + + } + + @Override + public int getCountByPid(Long pid) { + return baseDao.getCountByPid(pid); + } + + @Override + public List getRegionByLevel(Integer level) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("tree_level", level); + List list = baseDao.selectList(queryWrapper); + return list; + } + + @Override + public List getRegion(boolean threeLevel) { + List provinceList = baseDao.getListByLevel(RegionLevelEnum.ONE.value()); + List cityList = baseDao.getListByLevel(RegionLevelEnum.TWO.value()); + + List provinces = ConvertUtils.sourceToTarget(provinceList, RegionProvince.class); + List cities = ConvertUtils.sourceToTarget(cityList, RegionCity.class); + + for (RegionCity city : cities) { + for (RegionProvince province : provinces) { + if (city.getPid().equals(province.getId())) { + province.getCities().add(city); + } + } + } + + //无需显示3级区县 + if (!threeLevel) { + return provinces; + } + + List countyList = baseDao.getListByLevel(RegionLevelEnum.THREE.value()); + List counties = ConvertUtils.sourceToTarget(countyList, Region.class); + for (Region county : counties) { + for (RegionCity city : cities) { + if (county.getPid().equals(city.getId())) { + city.getCounties().add(county); + } + } + } + + return provinces; + } +} diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleDataScopeServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleDataScopeServiceImpl.java new file mode 100644 index 0000000..ce1a945 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleDataScopeServiceImpl.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.modules.sys.dao.SysRoleDataScopeDao; +import com.dkha.server.system.modules.sys.entity.SysRoleDataScopeEntity; +import com.dkha.server.system.modules.sys.service.SysRoleDataScopeService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysRoleDataScopeServiceImpl extends BaseServiceImpl + implements SysRoleDataScopeService { + + @Override + public List getDeptIdList(Long roleId) { + return baseDao.getDeptIdList(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(Long roleId, List deptIdList) { + //先删除角色数据权限关系 + deleteByRoleIds(new Long[]{roleId}); + + //角色没有一个数据权限的情况 + if(UtilValidate.isEmpty(deptIdList)){ + return ; + } + + //保存角色数据权限关系 + for(Long deptId : deptIdList){ + SysRoleDataScopeEntity sysRoleDataScopeEntity = new SysRoleDataScopeEntity(); + sysRoleDataScopeEntity.setDeptId(deptId); + sysRoleDataScopeEntity.setRoleId(roleId); + + //保存 + insert(sysRoleDataScopeEntity); + } + } + + @Override + public void deleteByRoleIds(Long[] roleIds) { + baseDao.deleteByRoleIds(roleIds); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleMenuServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleMenuServiceImpl.java new file mode 100644 index 0000000..a75a1e5 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleMenuServiceImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.modules.sys.dao.SysRoleMenuDao; +import com.dkha.server.system.modules.sys.entity.SysRoleMenuEntity; +import com.dkha.server.system.modules.sys.service.SysRoleMenuService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysRoleMenuServiceImpl extends BaseServiceImpl implements SysRoleMenuService { + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(Long roleId, List menuIdList) { + //先删除角色菜单关系 + deleteByRoleIds(new Long[]{roleId}); + + //角色没有一个菜单权限的情况 + if(UtilValidate.isEmpty(menuIdList)){ + return ; + } + + //保存角色菜单关系 + for(Long menuId : menuIdList){ + SysRoleMenuEntity sysRoleMenuEntity = new SysRoleMenuEntity(); + sysRoleMenuEntity.setMenuId(menuId); + sysRoleMenuEntity.setRoleId(roleId); + + //保存 + insert(sysRoleMenuEntity); + } + } + + @Override + public List getMenuIdList(Long roleId){ + return baseDao.getMenuIdList(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByRoleIds(Long[] roleIds) { + baseDao.deleteByRoleIds(roleIds); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByMenuId(Long menuId) { + baseDao.deleteByMenuId(menuId); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleServiceImpl.java new file mode 100644 index 0000000..498e84c --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.modules.security.user.SecurityUser; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.dao.SysRoleDao; +import com.dkha.server.system.modules.sys.dto.SysRoleDTO; +import com.dkha.server.system.modules.sys.entity.SysRoleEntity; +import com.dkha.server.system.modules.sys.enums.SuperAdminEnum; +import com.dkha.server.system.modules.sys.service.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 角色 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysRoleServiceImpl extends BaseServiceImpl implements SysRoleService { + @Autowired + private SysRoleMenuService sysRoleMenuService; + @Autowired + private SysRoleDataScopeService sysRoleDataScopeService; + @Autowired + private SysRoleUserService sysRoleUserService; + @Autowired + private SysDeptService sysDeptService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysRoleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysRoleDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String name = (String)params.get("name"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(name), "name", name); + + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if(user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + List deptIdList = sysDeptService.getSubDeptIdList(user.getDeptId()); + wrapper.in(deptIdList != null, "dept_id", deptIdList); + } + + return wrapper; + } + + @Override + public SysRoleDTO get(Long id) { + SysRoleEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysRoleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysRoleDTO dto) { + SysRoleEntity entity = ConvertUtils.sourceToTarget(dto, SysRoleEntity.class); + + //保存角色 + insert(entity); + + //保存角色菜单关系 + sysRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + + //保存角色数据权限关系 + sysRoleDataScopeService.saveOrUpdate(entity.getId(), dto.getDeptIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysRoleDTO dto) { + SysRoleEntity entity = ConvertUtils.sourceToTarget(dto, SysRoleEntity.class); + + //更新角色 + updateById(entity); + + //更新角色菜单关系 + sysRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + + //更新角色数据权限关系 + sysRoleDataScopeService.saveOrUpdate(entity.getId(), dto.getDeptIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除角色 + baseDao.deleteBatchIds(Arrays.asList(ids)); + + //删除角色用户关系 + sysRoleUserService.deleteByRoleIds(ids); + + //删除角色菜单关系 + sysRoleMenuService.deleteByRoleIds(ids); + + //删除角色数据权限关系 + sysRoleDataScopeService.deleteByRoleIds(ids); + } + +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleUserServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleUserServiceImpl.java new file mode 100644 index 0000000..0cac819 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysRoleUserServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.modules.sys.dao.SysRoleUserDao; +import com.dkha.server.system.modules.sys.entity.SysRoleUserEntity; +import com.dkha.server.system.modules.sys.service.SysRoleUserService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysRoleUserServiceImpl extends BaseServiceImpl implements SysRoleUserService { + + @Override + public void saveOrUpdate(Long userId, List roleIdList) { + //先删除角色用户关系 + deleteByUserIds(new Long[]{userId}); + + //用户没有一个角色权限的情况 + if(UtilValidate.isEmpty(roleIdList)){ + return ; + } + + //保存角色用户关系 + for(Long roleId : roleIdList){ + SysRoleUserEntity sysRoleUserEntity = new SysRoleUserEntity(); + sysRoleUserEntity.setUserId(userId); + sysRoleUserEntity.setRoleId(roleId); + + //保存 + insert(sysRoleUserEntity); + } + } + + @Override + public void deleteByRoleIds(Long[] roleIds) { + baseDao.deleteByRoleIds(roleIds); + } + + @Override + public void deleteByUserIds(Long[] userIds) { + baseDao.deleteByUserIds(userIds); + } + + @Override + public List getRoleIdList(Long userId) { + + return baseDao.getRoleIdList(userId); + } +} \ No newline at end of file diff --git a/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysUserServiceImpl.java b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..1d9928e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/system/modules/sys/service/impl/SysUserServiceImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.server.system.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.dkha.common.util.UtilValidate; +import com.dkha.server.system.common.constant.Constant; +import com.dkha.server.system.common.page.PageData; +import com.dkha.server.system.common.service.impl.BaseServiceImpl; +import com.dkha.server.system.common.utils.ConvertUtils; +import com.dkha.server.system.modules.security.password.PasswordUtils; +import com.dkha.server.system.modules.security.user.SecurityUser; +import com.dkha.server.system.modules.security.user.UserDetail; +import com.dkha.server.system.modules.sys.dao.SysUserDao; +import com.dkha.server.system.modules.sys.dto.SysUserDTO; +import com.dkha.server.system.modules.sys.entity.SysUserEntity; +import com.dkha.server.system.modules.sys.enums.SuperAdminEnum; +import com.dkha.server.system.modules.sys.service.SysDeptService; +import com.dkha.server.system.modules.sys.service.SysRoleUserService; +import com.dkha.server.system.modules.sys.service.SysUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysUserServiceImpl extends BaseServiceImpl implements SysUserService { + @Autowired + private SysRoleUserService sysRoleUserService; + @Autowired + private SysDeptService sysDeptService; + + @Override + public PageData page(Map params) { + //转换成like + paramsToLike(params, "username"); + + //分页 + IPage page = getPage(params, Constant.CREATE_DATE, false); + + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if(user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + params.put("deptIdList", sysDeptService.getSubDeptIdList(user.getDeptId())); + } + + //查询 + List list = baseDao.getList(params); + + return getPageData(list, page.getTotal(), SysUserDTO.class); + } + + @Override + public List list(Map params) { + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if(user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + params.put("deptIdList", sysDeptService.getSubDeptIdList(user.getDeptId())); + } + + List entityList = baseDao.getList(params); + + return ConvertUtils.sourceToTarget(entityList, SysUserDTO.class); + } + + @Override + public SysUserDTO get(Long id) { + SysUserEntity entity = baseDao.getById(id); + + return ConvertUtils.sourceToTarget(entity, SysUserDTO.class); + } + + @Override + public SysUserDTO getByUsername(String username) { + SysUserEntity entity = baseDao.getByUsername(username); + return ConvertUtils.sourceToTarget(entity, SysUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysUserDTO dto) { + SysUserEntity entity = ConvertUtils.sourceToTarget(dto, SysUserEntity.class); + + //密码加密 + String password = PasswordUtils.encode(entity.getPassword()); + entity.setPassword(password); + + //保存用户 + entity.setSuperAdmin(SuperAdminEnum.NO.value()); + insert(entity); + + //保存角色用户关系 + sysRoleUserService.saveOrUpdate(entity.getId(), dto.getRoleIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysUserDTO dto) { + SysUserEntity entity = ConvertUtils.sourceToTarget(dto, SysUserEntity.class); + + //密码加密 + if(UtilValidate.isEmpty(dto.getPassword())){ + entity.setPassword(null); + }else{ + String password = PasswordUtils.encode(entity.getPassword()); + entity.setPassword(password); + } + + //更新用户 + updateById(entity); + + //更新角色用户关系 + sysRoleUserService.saveOrUpdate(entity.getId(), dto.getRoleIdList()); + } + + @Override + public void delete(Long[] ids) { + //删除用户 + baseDao.deleteBatchIds(Arrays.asList(ids)); + + //删除角色用户关系 + sysRoleUserService.deleteByUserIds(ids); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updatePassword(Long id, String newPassword) { + newPassword = PasswordUtils.encode(newPassword); + + baseDao.updatePassword(id, newPassword); + } + + @Override + public int getCountByDeptId(Long deptId) { + return baseDao.getCountByDeptId(deptId); + } +} diff --git a/face-server/src/main/java/com/dkha/server/util/FileToBase64.java b/face-server/src/main/java/com/dkha/server/util/FileToBase64.java new file mode 100644 index 0000000..d61a85e --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/util/FileToBase64.java @@ -0,0 +1,68 @@ +package com.dkha.server.util; + +import sun.misc.BASE64Decoder; +import sun.misc.BASE64Encoder; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; + +public class FileToBase64 { + /** + *

将文件转成base64 字符串

+ * @param path 文件路径 + * @return + * @throws Exception + */ + public static String encodeBase64File(String path) throws Exception { + File file = new File(path); + FileInputStream inputFile = new FileInputStream(file); + byte[] buffer = new byte[(int)file.length()]; + inputFile.read(buffer); + inputFile.close(); + return new BASE64Encoder().encode(buffer); + } + + public static String encodeBase64File( InputStream inputFile) throws Exception { + + byte[] buffer = new byte[(int)inputFile.available()]; + inputFile.read(buffer); + inputFile.close(); + return new BASE64Encoder().encode(buffer); + } + /** + *

将base64字符解码保存文件

+ * @param base64Code + * @param targetPath + * @throws Exception + */ + public static void decoderBase64File(String base64Code,String targetPath) throws Exception { + byte[] buffer = new BASE64Decoder().decodeBuffer(base64Code); + FileOutputStream out = new FileOutputStream(targetPath); + out.write(buffer); + out.close(); + } + /** + *

将base64字符保存文本文件

+ * @param base64Code + * @param targetPath + * @throws Exception + */ + public static void toFile(String base64Code,String targetPath) throws Exception { + byte[] buffer = base64Code.getBytes(); + FileOutputStream out = new FileOutputStream(targetPath); + out.write(buffer); + out.close(); + } + public static void main(String[] args) { + try { + String base64Code =encodeBase64File("/Users/Crazy/Pictures/zyb2.jpg"); + System.out.println(base64Code); + decoderBase64File(base64Code, "/Users/Crazy/Desktop/zyb.png"); + toFile(base64Code, "/Users/Crazy/Desktop/zyb.txt"); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/face-server/src/main/java/com/dkha/server/util/RequestUtil.java b/face-server/src/main/java/com/dkha/server/util/RequestUtil.java new file mode 100644 index 0000000..9e6b820 --- /dev/null +++ b/face-server/src/main/java/com/dkha/server/util/RequestUtil.java @@ -0,0 +1,29 @@ +package com.dkha.server.util; + +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + +public class RequestUtil { + + public static String getStreamText(HttpServletRequest request) { + + try { + ServletInputStream inputStream = request.getInputStream(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); + + StringBuilder content = new StringBuilder(); + String line; + while ((line = bufferedReader.readLine()) != null) { + content.append(line); + } + return content.toString(); + } catch (IOException e) { + e.printStackTrace(); + } + + return null; + } +} diff --git a/face-server/src/main/resources/application-dev.yml b/face-server/src/main/resources/application-dev.yml new file mode 100644 index 0000000..fa1f4c3 --- /dev/null +++ b/face-server/src/main/resources/application-dev.yml @@ -0,0 +1,137 @@ +# Tomcat +server: + tomcat: + uri-encoding: UTF-8 + max-threads: 1000 + min-spare-threads: 30 + port: 8889 + connection-timeout: 5000ms + servlet: + context-path: /face + session: + cookie: + http-only: true + +spring: + messages: + encoding: UTF-8 + basename: i18n/messages + servlet: + multipart: + max-file-size: 500MB + max-request-size: 500MB + enabled: true + datasource: + druid: + #MySQL + driver-class-name: com.mysql.jdbc.Driver + url: jdbc:mysql://192.168.1.127:3306/face_application?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: root + password: Dkha123 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 6000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + login-username: admin + login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + redis: + database: 0 + host: 192.168.1.127 + port: 6379 + password: Dkha123 # 密码(默认为空) + timeout: 6000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 + activiti: + check-process-definitions: false + +#mybatis +mybatis-plus: + mapper-locations: classpath:/mybatis/mapper/**/*.xml,classpath:/mappers/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.dkha.server.system.modules + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + # 如果入库为空值,则忽略掉控空值 + insert-strategy: not_empty + update-strategy: not_empty + select-strategy: not_empty + banner: false + #原生配置 + configuration: + #是否开启自动驼峰命名规则(camel case)映射 + map-underscore-to-camel-case: true + #全局地开启或关闭配置文件中的所有映射器已经配置的任何缓存,默认为 true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +# 用于控制swagger是否显示 +swagger: + show: true + +fdfs: + so-timeout: 600000 + connect-timeout: 6000 + tracker-list: #TrackerList参数,支持多个 + - 192.168.10.10:22122 + +# 是否开启redis缓存 true开启 false关闭 +renren.redis.open: false + + +#人脸API统一请求地址定义 +api: + server: + prefix: http://192.168.1.161:8013/dkha/ + #人脸检索最大返回值 + max: + result: 100 + #人脸分组最大支持图片数量 + group: + max: 30 + # 人脸分组最少图片数量 + min: 2 + # 图片支持格式 + picture: + type: (png|jpg|jpeg) + + +httpurlvideo: + url: http://127.0.0.1/ +# 视频上传支持的格式 +videotype: (mp4|flv|avi|rm|rmvb|wmv) + +#minio 配置 +minio: + url: http://192.168.1.161:9000 + accessKey: admin + secretKey: Dkha123. + bucketName: middleware diff --git a/face-server/src/main/resources/application-prod.yml b/face-server/src/main/resources/application-prod.yml new file mode 100644 index 0000000..b8a281b --- /dev/null +++ b/face-server/src/main/resources/application-prod.yml @@ -0,0 +1,137 @@ +# Tomcat +server: + tomcat: + uri-encoding: UTF-8 + max-threads: 1000 + min-spare-threads: 30 + port: 8889 + connection-timeout: 5000ms + servlet: + context-path: /face + session: + cookie: + http-only: true + +spring: + messages: + encoding: UTF-8 + basename: i18n/messages + servlet: + multipart: + max-file-size: 500MB + max-request-size: 500MB + enabled: true + datasource: + druid: + #MySQL + driver-class-name: com.mysql.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/face_application?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: root + password: Dkha123 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 6000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + login-username: admin + login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + redis: + database: 0 + host: 127.0.0.1 + port: 6379 + password: Dkha123 # 密码(默认为空) + timeout: 6000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 + activiti: + check-process-definitions: false + +#mybatis +mybatis-plus: + mapper-locations: classpath:/mybatis/mapper/**/*.xml,classpath:/mappers/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.dkha.server.system.modules + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + # 如果入库为空值,则忽略掉控空值 + insert-strategy: not_empty + update-strategy: not_empty + select-strategy: not_empty + banner: false + #原生配置 + configuration: + #是否开启自动驼峰命名规则(camel case)映射 + map-underscore-to-camel-case: true + #全局地开启或关闭配置文件中的所有映射器已经配置的任何缓存,默认为 true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +# 用于控制swagger是否显示 +swagger: + show: true + +fdfs: + so-timeout: 600000 + connect-timeout: 6000 + tracker-list: #TrackerList参数,支持多个 + - 192.168.10.10:22122 + +# 是否开启redis缓存 true开启 false关闭 +renren.redis.open: false + + +#人脸API统一请求地址定义 +api: + server: + prefix: http://127.0.0.1:8013/dkha/ + #人脸检索最大返回值 + max: + result: 100 + #人脸分组最大支持图片数量 + group: + max: 30 + # 人脸分组最少图片数量 + min: 2 + # 图片支持格式 + picture: + type: (png|jpg|jpeg) + + +httpurlvideo: + url: http://127.0.0.1/ +# 视频上传支持的格式 +videotype: (mp4|flv|avi|rm|rmvb|wmv) + +#minio 配置 +minio: + url: http://192.168.1.220:9000 + accessKey: admin + secretKey: Dkha123. + bucketName: middleware diff --git a/face-server/src/main/resources/application-test.yml b/face-server/src/main/resources/application-test.yml new file mode 100644 index 0000000..d9dff93 --- /dev/null +++ b/face-server/src/main/resources/application-test.yml @@ -0,0 +1,137 @@ +# Tomcat +server: + tomcat: + uri-encoding: UTF-8 + max-threads: 1000 + min-spare-threads: 30 + port: 8889 + connection-timeout: 5000ms + servlet: + context-path: /face + session: + cookie: + http-only: true + +spring: + messages: + encoding: UTF-8 + basename: i18n/messages + servlet: + multipart: + max-file-size: 500MB + max-request-size: 500MB + enabled: true + datasource: + druid: + #MySQL + driver-class-name: com.mysql.jdbc.Driver + url: jdbc:mysql://192.168.1.122:3306/face_application?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: root + password: Dkha123 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 6000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + login-username: admin + login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + redis: + database: 0 + host: 192.168.1.122 + port: 6379 + password: Dkha123 # 密码(默认为空) + timeout: 6000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 + activiti: + check-process-definitions: false + +#mybatis +mybatis-plus: + mapper-locations: classpath:/mybatis/mapper/**/*.xml,classpath:/mappers/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.dkha.server.system.modules + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + # 如果入库为空值,则忽略掉控空值 + insert-strategy: not_empty + update-strategy: not_empty + select-strategy: not_empty + banner: false + #原生配置 + configuration: + #是否开启自动驼峰命名规则(camel case)映射 + map-underscore-to-camel-case: true + #全局地开启或关闭配置文件中的所有映射器已经配置的任何缓存,默认为 true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +# 用于控制swagger是否显示 +swagger: + show: true + +fdfs: + so-timeout: 600000 + connect-timeout: 6000 + tracker-list: #TrackerList参数,支持多个 + - 192.168.10.10:22122 + +# 是否开启redis缓存 true开启 false关闭 +renren.redis.open: false + + +#人脸API统一请求地址定义 +api: + server: + prefix: http://192.168.1.122:8013/dkha/ + #人脸检索最大返回值 + max: + result: 100 + #人脸分组最大支持图片数量 + group: + max: 30 + # 人脸分组最少图片数量 + min: 2 + # 图片支持格式 + picture: + type: (png|jpg|jpeg) + + +httpurlvideo: + url: http://127.0.0.1/ +# 视频上传支持的格式 +videotype: (mp4|flv|avi|rm|rmvb|wmv) + +#minio 配置 +minio: + url: http://192.168.1.122:9000 + accessKey: admin + secretKey: Dkha123. + bucketName: middleware diff --git a/face-server/src/main/resources/application.yml b/face-server/src/main/resources/application.yml new file mode 100644 index 0000000..c688559 --- /dev/null +++ b/face-server/src/main/resources/application.yml @@ -0,0 +1,4 @@ +spring: + # 环境 dev|test|prod + profiles: + active: dev diff --git a/face-server/src/main/resources/banner.txt b/face-server/src/main/resources/banner.txt new file mode 100644 index 0000000..46366f5 --- /dev/null +++ b/face-server/src/main/resources/banner.txt @@ -0,0 +1,23 @@ +${AnsiColor.BLACK} +//////////////////////////////////////////////////////////////////// +// _ooOoo_ // +// o8888888o // +// 88" . "88 // +// (| ^_^ |) // +// O\ = /O // +// ____/`---'\____ // +// .' \\| |// `. // +// / \\||| : |||// \ // +// / _||||| -:- |||||- \ // +// | | \\\ - /// | | // +// | \_| ''\---/'' | | // +// \ .-\__ `-` ___/-. / // +// ___`. .' /--.--\ `. . ___ // +// ."" '< `.___\_<|>_/___.' >'"". // +// | | : `- \`.;`\ _ /`;.`/ - ` : | | // +// \ \ `-. \_ __\ /__ _/ .-` / / // +// ========`-.____`-.___\_____/___.-`____.-'======== // +// `=---=' // +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // +// 佛祖保佑 永不宕机 永无BUG // +//////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/face-server/src/main/resources/i18n/messages.properties b/face-server/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000..f696314 --- /dev/null +++ b/face-server/src/main/resources/i18n/messages.properties @@ -0,0 +1,35 @@ +#Default +500=\u670D\u52A1\u5668\u5185\u90E8\u5F02\u5E38 +401=\u672A\u6388\u6743 +403=\u62D2\u7EDD\u8BBF\u95EE\uFF0C\u6CA1\u6709\u6743\u9650 +10001={0}\u4E0D\u80FD\u4E3A\u7A7A +10002=\u6570\u636E\u5E93\u4E2D\u5DF2\u5B58\u5728\u8BE5\u8BB0\u5F55 +10003=\u83B7\u53D6\u53C2\u6570\u5931\u8D25 +10004=\u8D26\u53F7\u6216\u5BC6\u7801\u9519\u8BEF +10005=\u8D26\u53F7\u5DF2\u88AB\u505C\u7528 +10006=\u552F\u4E00\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A +10007=\u9A8C\u8BC1\u7801\u4E0D\u6B63\u786E +10008=\u5148\u5220\u9664\u5B50\u83DC\u5355\u6216\u6309\u94AE +10009=\u539F\u5BC6\u7801\u4E0D\u6B63\u786E +10010=\u8D26\u53F7\u4E0D\u5B58\u5728 +10011=\u4E0A\u7EA7\u90E8\u95E8\u9009\u62E9\u9519\u8BEF +10012=\u4E0A\u7EA7\u83DC\u5355\u4E0D\u80FD\u4E3A\u81EA\u8EAB +10013=\u6570\u636E\u6743\u9650\u63A5\u53E3\uFF0C\u53EA\u80FD\u662FMap\u7C7B\u578B\u53C2\u6570 +10014=\u8BF7\u5148\u5220\u9664\u4E0B\u7EA7\u90E8\u95E8 +10015=\u8BF7\u5148\u5220\u9664\u90E8\u95E8\u4E0B\u7684\u7528\u6237 +10016=\u90E8\u7F72\u5931\u8D25\uFF0C\u6CA1\u6709\u6D41\u7A0B +10017=\u6A21\u578B\u56FE\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5 +10018=\u5BFC\u51FA\u5931\u8D25\uFF0C\u6A21\u578BID\u4E3A{0} +10019=\u8BF7\u4E0A\u4F20\u6587\u4EF6 +10020=token\u4E0D\u80FD\u4E3A\u7A7A +10021=token\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55 +10022=\u8D26\u53F7\u5DF2\u88AB\u9501\u5B9A +10023=\u8BF7\u4E0A\u4F20zip\u3001bar\u3001bpmn\u3001bpmn20.xml\u683C\u5F0F\u6587\u4EF6 +10024=\u4E0A\u4F20\u6587\u4EF6\u5931\u8D25{0} +10025=\u53D1\u9001\u77ED\u4FE1\u5931\u8D25{0} +10026=\u90AE\u4EF6\u6A21\u677F\u4E0D\u5B58\u5728 +10027=Redis\u670D\u52A1\u5F02\u5E38 +10028=\u5B9A\u65F6\u4EFB\u52A1\u5931\u8D25 +10029=\u4E0D\u80FD\u5305\u542B\u975E\u6CD5\u5B57\u7B26 +10030=\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u8BF7\u4F7F\u7528JSON\u683C\u5F0F +10031=\u8BF7\u5148\u5B8C\u6210\u77ED\u4FE1\u914D\u7F6E \ No newline at end of file diff --git a/face-server/src/main/resources/i18n/messages_en_US.properties b/face-server/src/main/resources/i18n/messages_en_US.properties new file mode 100644 index 0000000..d28e508 --- /dev/null +++ b/face-server/src/main/resources/i18n/messages_en_US.properties @@ -0,0 +1,35 @@ +#English +500=Server internal exception +401=Unauthorized +403=Access denied, no permissions +10001={0} cannot be empty +10002=The record already exists in the database +10003=Failed to get parameters +10004=The account number or password is incorrect. +10005=Account has been deactivated +10006=Unique ID cannot be empty +10007=The verification code is incorrect +10008=First delete submenu or button +10009=The original password is incorrect +10010=The account does not exist +10011=The superior department made a wrong choice +10012=Upper menu cannot be for itself +10013=Data permission interface, which can only be a Map type parameter. +10014=Please delete the subordinate department first +10015=Please delete the user under the department first +10016=Deployment failed, no process +10017=Model diagram is incorrect, please check +10018=The export failed with the model ID {0} +10019=Please upload a file +10020=token cannot be empty +10021=token is invalid, please log in again +10022=The account has been locked +10023=Please upload zip, bar, bpmn, bpmn20.xml format file +10024=Failed to upload file {0} +10025=Failed to send SMS {0} +10026=Mail template does not exist +10027=Redis service exception +10028=Timed task failed +10029=Cannot contain illegal characters +10030=The parameter format is incorrect. Please use JSON format. +10031=Please complete the SMS configuration first. \ No newline at end of file diff --git a/face-server/src/main/resources/i18n/messages_zh_CN.properties b/face-server/src/main/resources/i18n/messages_zh_CN.properties new file mode 100644 index 0000000..75029aa --- /dev/null +++ b/face-server/src/main/resources/i18n/messages_zh_CN.properties @@ -0,0 +1,38 @@ +#\u7B80\u4F53\u4E2D\u6587 +500=\u670D\u52A1\u5668\u5185\u90E8\u5F02\u5E38 +401=\u672A\u6388\u6743 +403=\u62D2\u7EDD\u8BBF\u95EE\uFF0C\u6CA1\u6709\u6743\u9650 +10001={0}\u4E0D\u80FD\u4E3A\u7A7A +10002=\u6570\u636E\u5E93\u4E2D\u5DF2\u5B58\u5728\u8BE5\u8BB0\u5F55 +10003=\u83B7\u53D6\u53C2\u6570\u5931\u8D25 +10004=\u8D26\u53F7\u6216\u5BC6\u7801\u9519\u8BEF +10005=\u8D26\u53F7\u5DF2\u88AB\u505C\u7528 +10006=\u552F\u4E00\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A +10007=\u9A8C\u8BC1\u7801\u4E0D\u6B63\u786E +10008=\u5148\u5220\u9664\u5B50\u83DC\u5355\u6216\u6309\u94AE +10009=\u539F\u5BC6\u7801\u4E0D\u6B63\u786E +10010=\u8D26\u53F7\u4E0D\u5B58\u5728 +10011=\u4E0A\u7EA7\u90E8\u95E8\u9009\u62E9\u9519\u8BEF +10012=\u4E0A\u7EA7\u83DC\u5355\u4E0D\u80FD\u4E3A\u81EA\u8EAB +10013=\u6570\u636E\u6743\u9650\u63A5\u53E3\uFF0C\u53EA\u80FD\u662FMap\u7C7B\u578B\u53C2\u6570 +10014=\u8BF7\u5148\u5220\u9664\u4E0B\u7EA7\u90E8\u95E8 +10015=\u8BF7\u5148\u5220\u9664\u90E8\u95E8\u4E0B\u7684\u7528\u6237 +10016=\u90E8\u7F72\u5931\u8D25\uFF0C\u6CA1\u6709\u6D41\u7A0B +10017=\u6A21\u578B\u56FE\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5 +10018=\u5BFC\u51FA\u5931\u8D25\uFF0C\u6A21\u578BID\u4E3A{0} +10019=\u8BF7\u4E0A\u4F20\u6587\u4EF6 +10020=token\u4E0D\u80FD\u4E3A\u7A7A +10021=token\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55 +10022=\u8D26\u53F7\u5DF2\u88AB\u9501\u5B9A +10023=\u8BF7\u4E0A\u4F20zip\u3001bar\u3001bpmn\u3001bpmn20.xml\u683C\u5F0F\u6587\u4EF6 +10024=\u4E0A\u4F20\u6587\u4EF6\u5931\u8D25{0} +10025=\u53D1\u9001\u77ED\u4FE1\u5931\u8D25{0} +10026=\u90AE\u4EF6\u6A21\u677F\u4E0D\u5B58\u5728 +10027=Redis\u670D\u52A1\u5F02\u5E38 +10028=\u5B9A\u65F6\u4EFB\u52A1\u5931\u8D25 +10029=\u4E0D\u80FD\u5305\u542B\u975E\u6CD5\u5B57\u7B26 +10030=\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u8BF7\u4F7F\u7528JSON\u683C\u5F0F +10031=\u8BF7\u5148\u5B8C\u6210\u77ED\u4FE1\u914D\u7F6E + +71002=\u8d26\u53f7\u5df2\u8fc7\u671f\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55\u0021 +71004=\u5f53\u524d\u8d26\u53f7\u5df2\u5728\u5176\u4ed6\u8bbe\u5907\u767b\u5f55\u0021 \ No newline at end of file diff --git a/face-server/src/main/resources/i18n/messages_zh_TW.properties b/face-server/src/main/resources/i18n/messages_zh_TW.properties new file mode 100644 index 0000000..e80ff94 --- /dev/null +++ b/face-server/src/main/resources/i18n/messages_zh_TW.properties @@ -0,0 +1,35 @@ +#\u7E41\u4F53\u4E2D\u6587 +500=\u670D\u52D9\u5668\u5167\u90E8\u7570\u5E38 +401=\u672A\u6388\u6B0A +403=\u62D2\u7D55\u8A2A\u554F\uFF0C\u6C92\u6709\u6B0A\u9650 +10001={0}\u4E0D\u80FD\u70BA\u7A7A +10002=\u6578\u64DA\u5EAB\u4E2D\u5DF2\u5B58\u5728\u8A72\u8A18\u9304 +10003=\u7372\u53D6\u53C3\u6578\u5931\u6557 +10004=\u8CEC\u865F\u6216\u5BC6\u78BC\u932F\u8AA4 +10005=\u8CEC\u865F\u5DF2\u88AB\u505C\u7528 +10006=\u552F\u4E00\u6A19\u8B58\u4E0D\u80FD\u70BA\u7A7A +10007=\u9A57\u8B49\u78BC\u4E0D\u6B63\u78BA +10008=\u5148\u522A\u9664\u5B50\u83DC\u55AE\u6216\u6309\u9215 +10009=\u539F\u5BC6\u78BC\u4E0D\u6B63\u78BA +10010=\u8CEC\u865F\u4E0D\u5B58\u5728 +10011=\u4E0A\u7D1A\u90E8\u9580\u9078\u64C7\u932F\u8AA4 +10012=\u4E0A\u7D1A\u83DC\u55AE\u4E0D\u80FD\u70BA\u81EA\u8EAB +10013=\u6578\u64DA\u6B0A\u9650\u63A5\u53E3\uFF0C\u53EA\u80FD\u662FMap\u985E\u578B\u53C3\u6578 +10014=\u8ACB\u5148\u522A\u9664\u4E0B\u7D1A\u90E8\u9580 +10015=\u8ACB\u5148\u522A\u9664\u90E8\u9580\u4E0B\u7684\u7528\u6236 +10016=\u90E8\u7F72\u5931\u6557\uFF0C\u6C92\u6709\u6D41\u7A0B +10017=\u6A21\u578B\u5716\u4E0D\u6B63\u78BA\uFF0C\u8ACB\u6AA2\u67E5 +10018=\u5C0E\u51FA\u5931\u6557\uFF0C\u6A21\u578BID\u70BA{0} +10019=\u8ACB\u4E0A\u50B3\u6587\u4EF6 +10020=token\u4E0D\u80FD\u70BA\u7A7A +10021=token\u5931\u6548\uFF0C\u8ACB\u91CD\u65B0\u767B\u9304 +10022=\u8CEC\u865F\u5DF2\u88AB\u9396\u5B9A +10023=\u8ACB\u4E0A\u50B3zip\u3001bar\u3001bpmn\u3001bpmn20.xml\u683C\u5F0F\u6587\u4EF6 +10024=\u4E0A\u50B3\u6587\u4EF6\u5931\u6557{0} +10025=\u767C\u9001\u77ED\u4FE1\u5931\u6557{0} +10026=\u90F5\u4EF6\u6A21\u677F\u4E0D\u5B58\u5728 +10027=Redis\u670D\u52D9\u7570\u5E38 +10028=\u5B9A\u6642\u4EFB\u52D9\u5931\u6557 +10029=\u4E0D\u80FD\u5305\u542B\u975E\u6CD5\u5B57\u7B26 +10030=\u53C3\u6578\u683C\u5F0F\u4E0D\u6B63\u78BA\uFF0C\u8ACB\u4F7F\u7528JSON\u683C\u5F0F +10031=\u8ACB\u5148\u5B8C\u6210\u77ED\u4FE1\u914D\u7F6E \ No newline at end of file diff --git a/face-server/src/main/resources/i18n/validation.properties b/face-server/src/main/resources/i18n/validation.properties new file mode 100644 index 0000000..0d08a87 --- /dev/null +++ b/face-server/src/main/resources/i18n/validation.properties @@ -0,0 +1,89 @@ +#Default +id.require=ID\u4E0D\u80FD\u4E3A\u7A7A +id.null=ID\u5FC5\u987B\u4E3A\u7A7A +pid.require=\u4E0A\u7EA7ID\uFF0C\u4E0D\u80FD\u4E3A\u7A7A +sort.number=\u6392\u5E8F\u503C\u4E0D\u80FD\u5C0F\u4E8E0 + +sysparams.paramcode.require=\u53C2\u6570\u7F16\u7801\u4E0D\u80FD\u4E3A\u7A7A +sysparams.paramvalue.require=\u53C2\u6570\u503C\u4E0D\u80FD\u4E3A\u7A7A + +sysuser.username.require=\u7528\u6237\u540D\u4E0D\u80FD\u4E3A\u7A7A +sysuser.password.require=\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A +sysuser.realname.require=\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A +sysuser.gender.range=\u6027\u522B\u53D6\u503C\u8303\u56F40~2 +sysuser.email.require=\u90AE\u7BB1\u4E0D\u80FD\u4E3A\u7A7A +sysuser.email.error=\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E +sysuser.mobile.require=\u624B\u673A\u53F7\u4E0D\u80FD\u4E3A\u7A7A +sysuser.deptId.require=\u90E8\u95E8\u4E0D\u80FD\u4E3A\u7A7A +sysuser.superadmin.range=\u8D85\u7EA7\u7BA1\u7406\u5458\u53D6\u503C\u8303\u56F40~1 +sysuser.status.range=\u72B6\u6001\u53D6\u503C\u8303\u56F40~1 +sysuser.captcha.require=\u9A8C\u8BC1\u7801\u4E0D\u80FD\u4E3A\u7A7A +sysuser.uuid.require=\u552F\u4E00\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A + +sysmenu.pid.require=\u8BF7\u9009\u62E9\u4E0A\u7EA7\u83DC\u5355 +sysmenu.name.require=\u83DC\u5355\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A +sysmenu.type.range=\u83DC\u5355\u7C7B\u578B\u53D6\u503C\u8303\u56F40~1 + +sysdept.pid.require=\u8BF7\u9009\u62E9\u4E0A\u7EA7\u90E8\u95E8 +sysdept.name.require=\u90E8\u95E8\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +sysrole.name.require=\u89D2\u8272\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +sysdict.type.require=\u5B57\u5178\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A +sysdict.name.require=\u5B57\u5178\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +schedule.status.range=\u72B6\u6001\u53D6\u503C\u8303\u56F40~1 +schedule.cron.require=cron\u8868\u8FBE\u5F0F\u4E0D\u80FD\u4E3A\u7A7A +schedule.bean.require=bean\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +oss.type.range=\u7C7B\u578B\u53D6\u503C\u8303\u56F41~5 + +sms.platform.range=\u5E73\u53F0\u7C7B\u578B\u53D6\u503C\u8303\u56F41~2 +aliyun.accesskeyid.require=\u963F\u91CC\u4E91AccessKeyId\u4E0D\u80FD\u4E3A\u7A7A +aliyun.accesskeysecret.require=\u963F\u91CC\u4E91AccessKeySecret\u4E0D\u80FD\u4E3A\u7A7A +aliyun.signname.require=\u963F\u91CC\u4E91\u77ED\u4FE1\u7B7E\u540D\u4E0D\u80FD\u4E3A\u7A7A +aliyun.templatecode.require=\u963F\u91CC\u4E91\u77ED\u4FE1\u6A21\u677F\u4E0D\u80FD\u4E3A\u7A7A +aliyun.domain.require=\u963F\u91CC\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +aliyun.domain.url=\u963F\u91CC\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +aliyun.endPoint.require=\u963F\u91CC\u4E91EndPoint\u4E0D\u80FD\u4E3A\u7A7A +aliyun.bucketname.require=\u963F\u91CC\u4E91BucketName\u4E0D\u80FD\u4E3A\u7A7A + +qcloud.appid.require=\u817E\u8BAF\u4E91AppId\u4E0D\u80FD\u4E3A\u7A7A +qcloud.appkey.require=\u817E\u8BAF\u4E91AppKey\u4E0D\u80FD\u4E3A\u7A7A +qcloud.secretId.require=\u817E\u8BAF\u4E91SecretId\u4E0D\u80FD\u4E3A\u7A7A +qcloud.secretkey.require=\u817E\u8BAF\u4E91SecretKey\u4E0D\u80FD\u4E3A\u7A7A +qcloud.signname.require=\u817E\u8BAF\u4E91\u77ED\u4FE1\u7B7E\u540D\u4E0D\u80FD\u4E3A\u7A7A +qcloud.templateid.require=\u817E\u8BAF\u4E91\u77ED\u4FE1\u6A21\u677FID\u4E0D\u80FD\u4E3A\u7A7A +qcloud.domain.require=\u817E\u8BAF\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +qcloud.domain.url=\u817E\u8BAF\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +qcloud.bucketname.require=\u817E\u8BAF\u4E91BucketName\u4E0D\u80FD\u4E3A\u7A7A +qcloud.region.require=\u6240\u5C5E\u5730\u533A\u4E0D\u80FD\u4E3A\u7A7A + +qiniu.domain.require=\u4E03\u725B\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +qiniu.domain.url=\u4E03\u725B\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +qiniu.accesskey.require=\u4E03\u725BAccessKey\u4E0D\u80FD\u4E3A\u7A7A +qiniu.secretkey.require=\u4E03\u725BSecretKey\u4E0D\u80FD\u4E3A\u7A7A +qiniu.bucketname.require=\u4E03\u725B\u7A7A\u95F4\u540D\u4E0D\u80FD\u4E3A\u7A7A + +fastdfs.domain.require=FastDFS\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +fastdfs.domain.url=FastDFS\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E + +local.domain.require=\u672C\u5730\u4E0A\u4F20\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +local.domain.url=\u672C\u5730\u4E0A\u4F20\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +local.path.url=\u5B58\u50A8\u76EE\u5F55\u4E0D\u80FD\u4E3A\u7A7A + +email.smtp.require=SMTP\u4E0D\u80FD\u4E3A\u7A7A +email.port.require=\u7AEF\u53E3\u53F7\u4E0D\u80FD\u4E3A\u7A7A +email.username.require=\u90AE\u7BB1\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A +email.password.require=\u90AE\u7BB1\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A + +mail.name.require=\u6A21\u677F\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A +mail.subject.require=\u90AE\u4EF6\u4E3B\u9898\u4E0D\u80FD\u4E3A\u7A7A +mail.content.require=\u90AE\u4EF6\u6B63\u6587\u4E0D\u80FD\u4E3A\u7A7A + +model.name.require=\u6A21\u578B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A +model.key.require=\u6A21\u578B\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A + +news.title.require=\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A +news.content.require=\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A +news.pubdate.require=\u53D1\u5E03\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A \ No newline at end of file diff --git a/face-server/src/main/resources/i18n/validation_en_US.properties b/face-server/src/main/resources/i18n/validation_en_US.properties new file mode 100644 index 0000000..d971977 --- /dev/null +++ b/face-server/src/main/resources/i18n/validation_en_US.properties @@ -0,0 +1,90 @@ +#English +id.require=ID can not be empty +id.null=ID has to be empty +pid.require=Parent ID, cannot be empty +sort.number=The sort value cannot be less than 0 + +sysparams.paramcode.require=Parameter encoding cannot be empty +sysparams.paramvalue.require=Parameter values cannot be empty + +sysuser.username.require=The username cannot be empty +sysuser.password.require=The password cannot be empty +sysuser.realname.require=The realname cannot be empty +sysuser.gender.range=Gender ranges from 0 to 2 +sysuser.email.require=Mailbox cannot be empty +sysuser.email.error=Incorrect email format +sysuser.mobile.require=The phone number cannot be empty +sysuser.deptId.require=Departments cannot be empty +sysuser.superadmin.range=Super administrator values range from 0 to 1 +sysuser.status.range=State ranges from 0 to 1 +sysuser.captcha.require=The captcha cannot be empty +sysuser.uuid.require=The unique identifier cannot be empty + +sysmenu.pid.require=Please select superior menu +sysmenu.name.require=Menu name cannot be empty +sysmenu.type.range=Menu type ranges from 0 to 1 + +sysdept.pid.require=Please select superior department +sysdept.name.require=The department name cannot be empty + +sysrole.name.require=The role name cannot be empty + +sysdict.type.require=The dictionary type cannot be empty +sysdict.name.require=The dictionary name cannot be empty + +schedule.status.range=Status ranges from 0 to 1 +schedule.cron.require=Cron expression cannot be empty +schedule.bean.require=Bean name cannot be empty + +oss.type.range=Type ranges from 1 to 5 + +aliyun.accesskeyid.require=Aliyun AccessKeyId cannot be empty +aliyun.accesskeysecret.require=Aliyun AccessKeySecret cannot be empty +aliyun.signname.require=Aliyun message signature cannot be empty +aliyun.templatecode.require=Aliyun message template cannot be empty +aliyun.domain.require=Aliyun bound domain name cannot be empty +aliyun.domain.url=Aliyun binding domain name format is incorrect +aliyun.endPoint.require=The aliyun EndPoint cannot be empty +aliyun.bucketname.require=Aliyun BucketName cannot be empty + +qcloud.appid.require=Tencent cloud AppId cannot be empty +qcloud.appkey.require=Tencent cloud AppKey cannot be empty +qcloud.secretId.require=Tencent cloud SecretId cannot be empty +qcloud.secretkey.require=Tencent cloud SecretKey cannot be empty +qcloud.signname.require=Tencent cloud SMS signature cannot be empty +qcloud.templateid.require=Tencent cloud SMS template ID cannot be empty +qcloud.domain.require=Tencent cloud bound domain name cannot be empty +qcloud.domain.url=Tencent cloud binding domain name format is incorrect +qcloud.bucketname.require=Tencent cloud BucketName cannot be empty +qcloud.region.require=The region cannot be empty + +qiniu.domain.require=Bound domain name cannot be empty +qiniu.domain.url=Binding domain name format is incorrect +qiniu.accesskey.require=The AccessKey cannot be empty +qiniu.secretkey.require=The SecretKey of seven cows cannot be empty +qiniu.bucketname.require=Space names cannot be empty + +fastdfs.domain.require=FastDFS bound domain name cannot be empty +fastdfs.domain.url=FastDFS bound domain name format is incorrect + +local.domain.require=Local upload bound domain name cannot be empty +local.domain.url=The domain name bound for local upload is not formatted correctly +local.path.url=The storage directory cannot be empty + +sms.platform.range=Platform type ranges from 1 to 2 + +email.smtp.require=SMTP cannot be empty +email.port.require=Port number cannot be empty +email.username.require=The email account cannot be empty +email.password.require=The password cannot be empty + +mail.name.require=The template name cannot be empty +mail.subject.require=Mail subject cannot be empty +mail.content.require=Message text cannot be empty + +model.name.require=The model name cannot be empty +model.key.require=The model key cannot be empty + +news.title.require=The title cannot be empty +news.content.require=Content cannot be empty +news.pubdate.require=The release time cannot be empty diff --git a/face-server/src/main/resources/i18n/validation_zh_CN.properties b/face-server/src/main/resources/i18n/validation_zh_CN.properties new file mode 100644 index 0000000..336a80d --- /dev/null +++ b/face-server/src/main/resources/i18n/validation_zh_CN.properties @@ -0,0 +1,89 @@ +#\u7B80\u4F53\u4E2D\u6587 +id.require=ID\u4E0D\u80FD\u4E3A\u7A7A +id.null=ID\u5FC5\u987B\u4E3A\u7A7A +pid.require=\u4E0A\u7EA7ID\uFF0C\u4E0D\u80FD\u4E3A\u7A7A +sort.number=\u6392\u5E8F\u503C\u4E0D\u80FD\u5C0F\u4E8E0 + +sysparams.paramcode.require=\u53C2\u6570\u7F16\u7801\u4E0D\u80FD\u4E3A\u7A7A +sysparams.paramvalue.require=\u53C2\u6570\u503C\u4E0D\u80FD\u4E3A\u7A7A + +sysuser.username.require=\u7528\u6237\u540D\u4E0D\u80FD\u4E3A\u7A7A +sysuser.password.require=\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A +sysuser.realname.require=\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A +sysuser.gender.range=\u6027\u522B\u53D6\u503C\u8303\u56F40~2 +sysuser.email.require=\u90AE\u7BB1\u4E0D\u80FD\u4E3A\u7A7A +sysuser.email.error=\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E +sysuser.mobile.require=\u624B\u673A\u53F7\u4E0D\u80FD\u4E3A\u7A7A +sysuser.deptId.require=\u90E8\u95E8\u4E0D\u80FD\u4E3A\u7A7A +sysuser.superadmin.range=\u8D85\u7EA7\u7BA1\u7406\u5458\u53D6\u503C\u8303\u56F40~1 +sysuser.status.range=\u72B6\u6001\u53D6\u503C\u8303\u56F40~1 +sysuser.captcha.require=\u9A8C\u8BC1\u7801\u4E0D\u80FD\u4E3A\u7A7A +sysuser.uuid.require=\u552F\u4E00\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A + +sysmenu.pid.require=\u8BF7\u9009\u62E9\u4E0A\u7EA7\u83DC\u5355 +sysmenu.name.require=\u83DC\u5355\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A +sysmenu.type.range=\u83DC\u5355\u7C7B\u578B\u53D6\u503C\u8303\u56F40~1 + +sysdept.pid.require=\u8BF7\u9009\u62E9\u4E0A\u7EA7\u90E8\u95E8 +sysdept.name.require=\u90E8\u95E8\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +sysrole.name.require=\u89D2\u8272\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +sysdict.type.require=\u5B57\u5178\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A +sysdict.name.require=\u5B57\u5178\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +schedule.status.range=\u72B6\u6001\u53D6\u503C\u8303\u56F40~1 +schedule.cron.require=cron\u8868\u8FBE\u5F0F\u4E0D\u80FD\u4E3A\u7A7A +schedule.bean.require=bean\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +oss.type.range=\u7C7B\u578B\u53D6\u503C\u8303\u56F41~5 + +aliyun.accesskeyid.require=\u963F\u91CC\u4E91AccessKeyId\u4E0D\u80FD\u4E3A\u7A7A +aliyun.accesskeysecret.require=\u963F\u91CC\u4E91AccessKeySecret\u4E0D\u80FD\u4E3A\u7A7A +aliyun.signname.require=\u963F\u91CC\u4E91\u77ED\u4FE1\u7B7E\u540D\u4E0D\u80FD\u4E3A\u7A7A +aliyun.templatecode.require=\u963F\u91CC\u4E91\u77ED\u4FE1\u6A21\u677F\u4E0D\u80FD\u4E3A\u7A7A +aliyun.domain.require=\u963F\u91CC\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +aliyun.domain.url=\u963F\u91CC\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +aliyun.endPoint.require=\u963F\u91CC\u4E91EndPoint\u4E0D\u80FD\u4E3A\u7A7A +aliyun.bucketname.require=\u963F\u91CC\u4E91BucketName\u4E0D\u80FD\u4E3A\u7A7A + +qcloud.appid.require=\u817E\u8BAF\u4E91AppId\u4E0D\u80FD\u4E3A\u7A7A +qcloud.appkey.require=\u817E\u8BAF\u4E91AppKey\u4E0D\u80FD\u4E3A\u7A7A +qcloud.secretId.require=\u817E\u8BAF\u4E91SecretId\u4E0D\u80FD\u4E3A\u7A7A +qcloud.secretkey.require=\u817E\u8BAF\u4E91SecretKey\u4E0D\u80FD\u4E3A\u7A7A +qcloud.signname.require=\u817E\u8BAF\u4E91\u77ED\u4FE1\u7B7E\u540D\u4E0D\u80FD\u4E3A\u7A7A +qcloud.templateid.require=\u817E\u8BAF\u4E91\u77ED\u4FE1\u6A21\u677FID\u4E0D\u80FD\u4E3A\u7A7A +qcloud.domain.require=\u817E\u8BAF\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +qcloud.domain.url=\u817E\u8BAF\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +qcloud.bucketname.require=\u817E\u8BAF\u4E91BucketName\u4E0D\u80FD\u4E3A\u7A7A +qcloud.region.require=\u6240\u5C5E\u5730\u533A\u4E0D\u80FD\u4E3A\u7A7A + +qiniu.domain.require=\u4E03\u725B\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +qiniu.domain.url=\u4E03\u725B\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +qiniu.accesskey.require=\u4E03\u725BAccessKey\u4E0D\u80FD\u4E3A\u7A7A +qiniu.secretkey.require=\u4E03\u725BSecretKey\u4E0D\u80FD\u4E3A\u7A7A +qiniu.bucketname.require=\u4E03\u725B\u7A7A\u95F4\u540D\u4E0D\u80FD\u4E3A\u7A7A + +fastdfs.domain.require=FastDFS\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +fastdfs.domain.url=FastDFS\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E + +local.domain.require=\u672C\u5730\u4E0A\u4F20\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +local.domain.url=\u672C\u5730\u4E0A\u4F20\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +local.path.url=\u5B58\u50A8\u76EE\u5F55\u4E0D\u80FD\u4E3A\u7A7A + +sms.platform.range=\u5E73\u53F0\u7C7B\u578B\u53D6\u503C\u8303\u56F41~2 +email.smtp.require=SMTP\u4E0D\u80FD\u4E3A\u7A7A +email.port.require=\u7AEF\u53E3\u53F7\u4E0D\u80FD\u4E3A\u7A7A +email.username.require=\u90AE\u7BB1\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A +email.password.require=\u90AE\u7BB1\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A + +mail.name.require=\u6A21\u677F\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A +mail.subject.require=\u90AE\u4EF6\u4E3B\u9898\u4E0D\u80FD\u4E3A\u7A7A +mail.content.require=\u90AE\u4EF6\u6B63\u6587\u4E0D\u80FD\u4E3A\u7A7A + +model.name.require=\u6A21\u578B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A +model.key.require=\u6A21\u578B\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A + +news.title.require=\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A +news.content.require=\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A +news.pubdate.require=\u53D1\u5E03\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A \ No newline at end of file diff --git a/face-server/src/main/resources/i18n/validation_zh_TW.properties b/face-server/src/main/resources/i18n/validation_zh_TW.properties new file mode 100644 index 0000000..b01b6b9 --- /dev/null +++ b/face-server/src/main/resources/i18n/validation_zh_TW.properties @@ -0,0 +1,90 @@ +#\u7E41\u4F53\u4E2D\u6587 +id.require=ID\u4E0D\u80FD\u70BA\u7A7A +id.null=ID\u5FC5\u9808\u70BA\u7A7A +pid.require=\u4E0A\u7D1AID\uFF0C\u4E0D\u80FD\u70BA\u7A7A +sort.number=\u6392\u5E8F\u503C\u4E0D\u80FD\u5C0F\u65BC0 + +sysparams.paramcode.require=\u53C3\u6578\u7DE8\u78BC\u4E0D\u80FD\u70BA\u7A7A +sysparams.paramvalue.require=\u53C3\u6578\u503C\u4E0D\u80FD\u70BA\u7A7A + +sysuser.username.require=\u7528\u6236\u540D\u4E0D\u80FD\u70BA\u7A7A +sysuser.password.require=\u5BC6\u78BC\u4E0D\u80FD\u70BA\u7A7A +sysuser.realname.require=\u59D3\u540D\u4E0D\u80FD\u70BA\u7A7A +sysuser.gender.range=\u6027\u5225\u53D6\u503C\u7BC4\u570D0~2 +sysuser.email.require=\u90F5\u7BB1\u4E0D\u80FD\u70BA\u7A7A +sysuser.email.error=\u90F5\u7BB1\u683C\u5F0F\u4E0D\u6B63\u78BA +sysuser.mobile.require=\u624B\u6A5F\u865F\u4E0D\u80FD\u70BA\u7A7A +sysuser.deptId.require=\u90E8\u9580\u4E0D\u80FD\u70BA\u7A7A +sysuser.superadmin.range=\u8D85\u7D1A\u7BA1\u7406\u54E1\u53D6\u503C\u7BC4\u570D0~1 +sysuser.status.range=\u72C0\u614B\u53D6\u503C\u7BC4\u570D0~1 +sysuser.captcha.require=\u9A57\u8B49\u78BC\u4E0D\u80FD\u70BA\u7A7A +sysuser.uuid.require=\u552F\u4E00\u6A19\u8B58\u4E0D\u80FD\u70BA\u7A7A + +sysmenu.pid.require=\u8ACB\u9078\u64C7\u4E0A\u7D1A\u83DC\u55AE +sysmenu.name.require=\u83DC\u55AE\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A +sysmenu.type.range=\u83DC\u55AE\u985E\u578B\u53D6\u503C\u7BC4\u570D0~1 + +sysdept.pid.require=\u8ACB\u9078\u64C7\u4E0A\u7D1A\u90E8\u9580 +sysdept.name.require=\u90E8\u9580\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A + +sysrole.name.require=\u89D2\u8272\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A + +sysdict.type.require=\u5B57\u5178\u985E\u578B\u4E0D\u80FD\u70BA\u7A7A +sysdict.name.require=\u5B57\u5178\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A + +schedule.status.range=\u72C0\u614B\u53D6\u503C\u7BC4\u570D0~1 +schedule.cron.require=cron\u8868\u9054\u5F0F\u4E0D\u80FD\u70BA\u7A7A +schedule.bean.require=bean\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A + +oss.type.range=\u985E\u578B\u53D6\u503C\u7BC4\u570D1~5 + +aliyun.accesskeyid.require=\u963F\u91CC\u96F2AccessKeyId\u4E0D\u80FD\u70BA\u7A7A +aliyun.accesskeysecret.require=\u963F\u91CC\u96F2AccessKeySecret\u4E0D\u80FD\u70BA\u7A7A +aliyun.signname.require=\u963F\u91CC\u96F2\u77ED\u4FE1\u7C3D\u540D\u4E0D\u80FD\u70BA\u7A7A +aliyun.templatecode.require=\u963F\u91CC\u96F2\u77ED\u4FE1\u6A21\u677F\u4E0D\u80FD\u70BA\u7A7A +aliyun.domain.require=\u963F\u91CC\u96F2\u7D81\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u70BA\u7A7A +aliyun.domain.url=\u963F\u91CC\u96F2\u7D81\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u78BA +aliyun.endPoint.require=\u963F\u91CC\u96F2EndPoint\u4E0D\u80FD\u70BA\u7A7A +aliyun.bucketname.require=\u963F\u91CC\u96F2BucketName\u4E0D\u80FD\u70BA\u7A7A + +qcloud.appid.require=\u9A30\u8A0A\u96F2AppId\u4E0D\u80FD\u70BA\u7A7A +qcloud.appkey.require=\u9A30\u8A0A\u96F2AppKey\u4E0D\u80FD\u70BA\u7A7A +qcloud.secretId.require=\u9A30\u8A0A\u96F2SecretId\u4E0D\u80FD\u70BA\u7A7A +qcloud.secretkey.require=\u9A30\u8A0A\u96F2SecretKey\u4E0D\u80FD\u70BA\u7A7A +qcloud.signname.require=\u9A30\u8A0A\u96F2\u77ED\u4FE1\u7C3D\u540D\u4E0D\u80FD\u70BA\u7A7A +qcloud.templateid.require=\u9A30\u8A0A\u96F2\u77ED\u4FE1\u6A21\u677FID\u4E0D\u80FD\u70BA\u7A7A +qcloud.domain.require=\u9A30\u8A0A\u96F2\u7D81\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u70BA\u7A7A +qcloud.domain.url=\u9A30\u8A0A\u96F2\u7D81\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u78BA +qcloud.bucketname.require=\u9A30\u8A0A\u96F2BucketName\u4E0D\u80FD\u70BA\u7A7A +qcloud.region.require=\u6240\u5C6C\u5730\u5340\u4E0D\u80FD\u70BA\u7A7A + +qiniu.domain.require=\u4E03\u725B\u7D81\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u70BA\u7A7A +qiniu.domain.url=\u4E03\u725B\u7D81\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u78BA +qiniu.accesskey.require=\u4E03\u725BAccessKey\u4E0D\u80FD\u70BA\u7A7A +qiniu.secretkey.require=\u4E03\u725BSecretKey\u4E0D\u80FD\u70BA\u7A7A +qiniu.bucketname.require=\u4E03\u725B\u7A7A\u9593\u540D\u4E0D\u80FD\u70BA\u7A7A + +fastdfs.domain.require=FastDFS\u7D81\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u70BA\u7A7A +fastdfs.domain.url=FastDFS\u7D81\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u78BA + +local.domain.require=\u672C\u5730\u4E0A\u50B3\u7D81\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u70BA\u7A7A +local.domain.url=\u672C\u5730\u4E0A\u50B3\u7D81\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u78BA +local.path.url=\u5B58\u5132\u76EE\u9304\u4E0D\u80FD\u70BA\u7A7A + +sms.platform.range=\u5E73\u53F0\u985E\u578B\u53D6\u503C\u7BC4\u570D1~2 + +email.smtp.require=SMTP\u4E0D\u80FD\u70BA\u7A7A +email.port.require=\u7AEF\u53E3\u865F\u4E0D\u80FD\u70BA\u7A7A +email.username.require=\u90F5\u7BB1\u8CEC\u865F\u4E0D\u80FD\u70BA\u7A7A +email.password.require=\u90F5\u7BB1\u5BC6\u78BC\u4E0D\u80FD\u70BA\u7A7A + +mail.name.require=\u6A21\u677F\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A +mail.subject.require=\u90F5\u4EF6\u4E3B\u984C\u4E0D\u80FD\u70BA\u7A7A +mail.content.require=\u90F5\u4EF6\u6B63\u6587\u4E0D\u80FD\u70BA\u7A7A + +model.name.require=\u6A21\u578B\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A +model.key.require=\u6A21\u578B\u6A19\u8B58\u4E0D\u80FD\u70BA\u7A7A + +news.title.require=\u6A19\u984C\u4E0D\u80FD\u70BA\u7A7A +news.content.require=\u5167\u5BB9\u4E0D\u80FD\u70BA\u7A7A +news.pubdate.require=\u767C\u4F48\u6642\u9593\u4E0D\u80FD\u70BA\u7A7A \ No newline at end of file diff --git a/face-server/src/main/resources/logback-spring.xml b/face-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..7239257 --- /dev/null +++ b/face-server/src/main/resources/logback-spring.xml @@ -0,0 +1,60 @@ + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + /mnt/appSystems/logs/${app_name}/%d{yyyy-MM, aux}/trace.%d{yyyy-MM-dd}.%i.log + + 500MB + + 10 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + /appSystems/logs/error.%d{yyyy-MM-dd}.%i.log + + /mnt/appSystems/logs/${app_name}/%d{yyyy-MM, aux}/error.%d{yyyy-MM-dd}.%i.log + + 500MB + + 10 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + ERROR + ACCEPT + DENY + + + + + + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/ControlBayonetMidMapper.xml b/face-server/src/main/resources/mybatis/mapper/ControlBayonetMidMapper.xml new file mode 100644 index 0000000..176bfce --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/ControlBayonetMidMapper.xml @@ -0,0 +1,35 @@ + + + + + + update control_bayonet_mid set is_valid=#{State},update_time=now(),update_by=#{UpdateBy} where id_control_task=#{taskID} + + + + DELETE FROM control_bayonet_mid WHERE id_control_task =#{taskID} + + + + + + + + + + + diff --git a/face-server/src/main/resources/mybatis/mapper/ControlLibraryMidMapper.xml b/face-server/src/main/resources/mybatis/mapper/ControlLibraryMidMapper.xml new file mode 100644 index 0000000..e11fb57 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/ControlLibraryMidMapper.xml @@ -0,0 +1,16 @@ + + + + + delete from control_library_mid where id_control_task=#{taskID} + + + + + + + diff --git a/face-server/src/main/resources/mybatis/mapper/ControlTaskMapper.xml b/face-server/src/main/resources/mybatis/mapper/ControlTaskMapper.xml new file mode 100644 index 0000000..3cba040 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/ControlTaskMapper.xml @@ -0,0 +1,114 @@ + + + + + + `id_control_task`, + `task_name`, + `control_object`, + `disposal_type`, + `control_type`, + `control_start_time`, + `control_end_time`, + `control_region`, + `control_threshold`, + `control_status`, + `receive`, + `remarks`, + `is_valid`, + `create_time`, + `update_time`, + `create_by`, + `update_by`, + task_no, + viedourl, + imgurl + + + + + + + + + + + + + + + diff --git a/face-server/src/main/resources/mybatis/mapper/FaceCameraDao.xml b/face-server/src/main/resources/mybatis/mapper/FaceCameraDao.xml new file mode 100644 index 0000000..172435b --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/FaceCameraDao.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/FaceCameraMapper.xml b/face-server/src/main/resources/mybatis/mapper/FaceCameraMapper.xml new file mode 100644 index 0000000..95d51ab --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/FaceCameraMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/face-server/src/main/resources/mybatis/mapper/FaceLibraryMapper.xml b/face-server/src/main/resources/mybatis/mapper/FaceLibraryMapper.xml new file mode 100644 index 0000000..121f854 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/FaceLibraryMapper.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/face-server/src/main/resources/mybatis/mapper/FaceTrackMapper.xml b/face-server/src/main/resources/mybatis/mapper/FaceTrackMapper.xml new file mode 100644 index 0000000..2d7abe9 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/FaceTrackMapper.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/PortraitMapper.xml b/face-server/src/main/resources/mybatis/mapper/PortraitMapper.xml new file mode 100644 index 0000000..3dd4017 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/PortraitMapper.xml @@ -0,0 +1,156 @@ + + + + + + + + DELETE FROM portrait WHERE id_factory =#{taskID} + + + + + diff --git a/face-server/src/main/resources/mybatis/mapper/WarningInformationMapper.xml b/face-server/src/main/resources/mybatis/mapper/WarningInformationMapper.xml new file mode 100644 index 0000000..34b7197 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/WarningInformationMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/face-server/src/main/resources/mybatis/mapper/log/SysLogErrorDao.xml b/face-server/src/main/resources/mybatis/mapper/log/SysLogErrorDao.xml new file mode 100644 index 0000000..26dabce --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/log/SysLogErrorDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/log/SysLogLoginDao.xml b/face-server/src/main/resources/mybatis/mapper/log/SysLogLoginDao.xml new file mode 100644 index 0000000..4b27814 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/log/SysLogLoginDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/log/SysLogOperationDao.xml b/face-server/src/main/resources/mybatis/mapper/log/SysLogOperationDao.xml new file mode 100644 index 0000000..b295356 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/log/SysLogOperationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysDeptDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysDeptDao.xml new file mode 100644 index 0000000..b7e4680 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysDeptDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysDictDataDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysDictDataDao.xml new file mode 100644 index 0000000..f9af478 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysDictDataDao.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysDictTypeDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysDictTypeDao.xml new file mode 100644 index 0000000..e1a23be --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysDictTypeDao.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysLanguageDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysLanguageDao.xml new file mode 100644 index 0000000..88e6482 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysLanguageDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + delete from sys_language where table_name=#{tableName} and table_id=#{tableId} + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysMenuDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysMenuDao.xml new file mode 100644 index 0000000..d845bd2 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysMenuDao.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysParamsDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysParamsDao.xml new file mode 100644 index 0000000..482815f --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysParamsDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + update sys_params set param_value = #{paramValue} where param_code = #{paramCode} + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysRegionDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysRegionDao.xml new file mode 100644 index 0000000..ca91ddb --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysRegionDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysRoleDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysRoleDao.xml new file mode 100644 index 0000000..9229109 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysRoleDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysRoleDataScopeDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysRoleDataScopeDao.xml new file mode 100644 index 0000000..710682a --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysRoleDataScopeDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + delete from sys_role_data_scope where role_id in + + #{roleId} + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysRoleMenuDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysRoleMenuDao.xml new file mode 100644 index 0000000..487efec --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysRoleMenuDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + delete from sys_role_menu where role_id in + + #{roleId} + + + + + delete from sys_role_menu where menu_id = #{value} + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysRoleUserDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysRoleUserDao.xml new file mode 100644 index 0000000..938a00f --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysRoleUserDao.xml @@ -0,0 +1,24 @@ + + + + + + + delete from sys_role_user where role_id in + + #{roleId} + + + + + delete from sys_role_user where user_id in + + #{userId} + + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysUserDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysUserDao.xml new file mode 100644 index 0000000..3497975 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysUserDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + update sys_user set password = #{newPassword} where id = #{id} + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mapper/sys/SysUserTokenDao.xml b/face-server/src/main/resources/mybatis/mapper/sys/SysUserTokenDao.xml new file mode 100644 index 0000000..c6c3348 --- /dev/null +++ b/face-server/src/main/resources/mybatis/mapper/sys/SysUserTokenDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + update sys_user_token set token = #{token} where user_id = #{userId} + + \ No newline at end of file diff --git a/face-server/src/main/resources/mybatis/mybatis.cfg.xml b/face-server/src/main/resources/mybatis/mybatis.cfg.xml new file mode 100644 index 0000000..bcdf41a --- /dev/null +++ b/face-server/src/main/resources/mybatis/mybatis.cfg.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/face-server/src/main/resources/摄像头导入模板.xls b/face-server/src/main/resources/摄像头导入模板.xls new file mode 100644 index 0000000..dff70dd Binary files /dev/null and b/face-server/src/main/resources/摄像头导入模板.xls differ diff --git a/face-snapShot/pom.xml b/face-snapShot/pom.xml new file mode 100644 index 0000000..b06f916 --- /dev/null +++ b/face-snapShot/pom.xml @@ -0,0 +1,69 @@ + + + + face-application + com.dkha + 1.0-SNAPSHOT + + 4.0.0 + + face-snapShot + + + + + com.dkha + face-common + ${project.version} + + + + org.springframework + springloaded + + + org.springframework.boot + spring-boot-devtools + true + true + + + + + + + + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-starter-web + + + + + + org.springframework.boot + spring-boot-maven-plugin + + com.dkha.face.FaceSnapShotMain + + + + + \ No newline at end of file diff --git a/face-snapShot/src/main/java/com/dkha/face/FaceSnapShotMain.java b/face-snapShot/src/main/java/com/dkha/face/FaceSnapShotMain.java new file mode 100644 index 0000000..1ab8e2e --- /dev/null +++ b/face-snapShot/src/main/java/com/dkha/face/FaceSnapShotMain.java @@ -0,0 +1,25 @@ +package com.dkha.face; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: FaceSnapShotMain + * @Package com.dkha.face.contral + * @author: panhui + * @date: 2019/12/25 10:09 + * @Copyright: 成都电科慧安 + */ +@SpringBootApplication +@EnableSwagger2 +public class FaceSnapShotMain { + + public static void main(String[]args) + { + SpringApplication.run(FaceSnapShotMain.class,args); + } +} diff --git a/face-snapShot/src/main/java/com/dkha/face/contral/FaceSnapContal.java b/face-snapShot/src/main/java/com/dkha/face/contral/FaceSnapContal.java new file mode 100644 index 0000000..26f9c25 --- /dev/null +++ b/face-snapShot/src/main/java/com/dkha/face/contral/FaceSnapContal.java @@ -0,0 +1,60 @@ +package com.dkha.face.contral; + +import com.dkha.face.modules.ReceiveSnapVO; +import com.dkha.face.modules.RecevieVO; +import com.google.gson.Gson; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: FaceSnapContal + * @Package com.dkha.face.contral + * @author: panhui + * @date: 2019/12/25 10:59 + * @Copyright: 成都电科慧安 + */ +@RestController +@RequestMapping("/face") +@Api(tags = "抓拍机管理") +@Slf4j +public class FaceSnapContal { + + + @Autowired + private Gson gson; + + @PostMapping("/snapshot") + @ApiOperation(value = "接收抓拍信息") + public String snapshot(@RequestBody RecevieVO recevieVO) + { + String json=gson.toJson(recevieVO); + log.error("接收卡口数据:"+json); + return json; + } + + @PostMapping("/test1") + @ApiOperation(value = "测试抓拍信息") + public String snapshot(@RequestBody ReceiveSnapVO receiveSnapVO) + { + String json=gson.toJson(receiveSnapVO); + log.error("接收卡口数据:"+json); + + System.out.println(receiveSnapVO.getBody().getPicture().size()); + return json; + } + + @PostMapping("/tripWire") + @ApiOperation(value = "人员绊线统计") + public String tripWire(@RequestBody RecevieVO recevieVO) + { + String json=gson.toJson(recevieVO); + log.error("接收绊线数据:"+json); + return json; + } +} diff --git a/face-snapShot/src/main/java/com/dkha/face/modules/ReceiveSnapVO.java b/face-snapShot/src/main/java/com/dkha/face/modules/ReceiveSnapVO.java new file mode 100644 index 0000000..b21788f --- /dev/null +++ b/face-snapShot/src/main/java/com/dkha/face/modules/ReceiveSnapVO.java @@ -0,0 +1,482 @@ +package com.dkha.face.modules; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ReceiveSnapVO + * @Package com.dkha.face.modules + * @author: panhui + * @date: 2019/12/25 16:31 + * @Copyright: 成都电科慧安 + */ +public class ReceiveSnapVO { + + /** + * cmd : face_snapshot + * id : 0 + * body : {"age":2,"event_type":1,"face":[{"confidence":72,"data_type":1,"eye_dist":142,"face_id":1285,"pitch":0,"rect":{"bottom":733,"left":926,"right":1068,"top":584},"rel_rect":{"bottom":239,"left":94,"right":236,"top":90},"roll":0,"yaw":0}],"have_glasses":1,"have_hat":0,"have_mask":0,"num":1,"picture":[{"data":"","length":10015,"type":2}],"serialno":"6e25d4fe-b6abfa6d","sex":0,"snapshot":{"data":"","length":156397,"type":2},"time_str":"2019-12-25 12:56:04","timestamp":{"msec":351,"sec":1577249764},"trigger":1} + */ + + private String cmd; + private int id; + private BodyBean body; + + public String getCmd() { + return cmd; + } + + public void setCmd(String cmd) { + this.cmd = cmd; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public BodyBean getBody() { + return body; + } + + public void setBody(BodyBean body) { + this.body = body; + } + + public static class BodyBean { + /** + * age : 2 + * event_type : 1 + * face : [{"confidence":72,"data_type":1,"eye_dist":142,"face_id":1285,"pitch":0,"rect":{"bottom":733,"left":926,"right":1068,"top":584},"rel_rect":{"bottom":239,"left":94,"right":236,"top":90},"roll":0,"yaw":0}] + * have_glasses : 1 + * have_hat : 0 + * have_mask : 0 + * num : 1 + * picture : [{"data":"","length":10015,"type":2}] + * serialno : 6e25d4fe-b6abfa6d + * sex : 0 + * snapshot : {"data":"","length":156397,"type":2} + * time_str : 2019-12-25 12:56:04 + * timestamp : {"msec":351,"sec":1577249764} + * trigger : 1 + */ + + private int age; + private int event_type; + private int have_glasses; + private int have_hat; + private int have_mask; + private int num; + private String serialno; + private int sex; + private SnapshotBean snapshot; + private String time_str; + private TimestampBean timestamp; + private int trigger; + private List face; + private List picture; + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public int getEvent_type() { + return event_type; + } + + public void setEvent_type(int event_type) { + this.event_type = event_type; + } + + public int getHave_glasses() { + return have_glasses; + } + + public void setHave_glasses(int have_glasses) { + this.have_glasses = have_glasses; + } + + public int getHave_hat() { + return have_hat; + } + + public void setHave_hat(int have_hat) { + this.have_hat = have_hat; + } + + public int getHave_mask() { + return have_mask; + } + + public void setHave_mask(int have_mask) { + this.have_mask = have_mask; + } + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + public String getSerialno() { + return serialno; + } + + public void setSerialno(String serialno) { + this.serialno = serialno; + } + + public int getSex() { + return sex; + } + + public void setSex(int sex) { + this.sex = sex; + } + + public SnapshotBean getSnapshot() { + return snapshot; + } + + public void setSnapshot(SnapshotBean snapshot) { + this.snapshot = snapshot; + } + + public String getTime_str() { + return time_str; + } + + public void setTime_str(String time_str) { + this.time_str = time_str; + } + + public TimestampBean getTimestamp() { + return timestamp; + } + + public void setTimestamp(TimestampBean timestamp) { + this.timestamp = timestamp; + } + + public int getTrigger() { + return trigger; + } + + public void setTrigger(int trigger) { + this.trigger = trigger; + } + + public List getFace() { + return face; + } + + public void setFace(List face) { + this.face = face; + } + + public List getPicture() { + return picture; + } + + public void setPicture(List picture) { + this.picture = picture; + } + + public static class SnapshotBean { + /** + * data : + * length : 156397 + * type : 2 + */ + + private String data; + private int length; + private int type; + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + public int getLength() { + return length; + } + + public void setLength(int length) { + this.length = length; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + } + + public static class TimestampBean { + /** + * msec : 351 + * sec : 1577249764 + */ + + private int msec; + private int sec; + + public int getMsec() { + return msec; + } + + public void setMsec(int msec) { + this.msec = msec; + } + + public int getSec() { + return sec; + } + + public void setSec(int sec) { + this.sec = sec; + } + } + + public static class FaceBean { + /** + * confidence : 72 + * data_type : 1 + * eye_dist : 142 + * face_id : 1285 + * pitch : 0 + * rect : {"bottom":733,"left":926,"right":1068,"top":584} + * rel_rect : {"bottom":239,"left":94,"right":236,"top":90} + * roll : 0 + * yaw : 0 + */ + + private int confidence; + private int data_type; + private int eye_dist; + private int face_id; + private int pitch; + private RectBean rect; + private RelRectBean rel_rect; + private int roll; + private int yaw; + + public int getConfidence() { + return confidence; + } + + public void setConfidence(int confidence) { + this.confidence = confidence; + } + + public int getData_type() { + return data_type; + } + + public void setData_type(int data_type) { + this.data_type = data_type; + } + + public int getEye_dist() { + return eye_dist; + } + + public void setEye_dist(int eye_dist) { + this.eye_dist = eye_dist; + } + + public int getFace_id() { + return face_id; + } + + public void setFace_id(int face_id) { + this.face_id = face_id; + } + + public int getPitch() { + return pitch; + } + + public void setPitch(int pitch) { + this.pitch = pitch; + } + + public RectBean getRect() { + return rect; + } + + public void setRect(RectBean rect) { + this.rect = rect; + } + + public RelRectBean getRel_rect() { + return rel_rect; + } + + public void setRel_rect(RelRectBean rel_rect) { + this.rel_rect = rel_rect; + } + + public int getRoll() { + return roll; + } + + public void setRoll(int roll) { + this.roll = roll; + } + + public int getYaw() { + return yaw; + } + + public void setYaw(int yaw) { + this.yaw = yaw; + } + + public static class RectBean { + /** + * bottom : 733 + * left : 926 + * right : 1068 + * top : 584 + */ + + private int bottom; + private int left; + private int right; + private int top; + + public int getBottom() { + return bottom; + } + + public void setBottom(int bottom) { + this.bottom = bottom; + } + + public int getLeft() { + return left; + } + + public void setLeft(int left) { + this.left = left; + } + + public int getRight() { + return right; + } + + public void setRight(int right) { + this.right = right; + } + + public int getTop() { + return top; + } + + public void setTop(int top) { + this.top = top; + } + } + + public static class RelRectBean { + /** + * bottom : 239 + * left : 94 + * right : 236 + * top : 90 + */ + + private int bottom; + private int left; + private int right; + private int top; + + public int getBottom() { + return bottom; + } + + public void setBottom(int bottom) { + this.bottom = bottom; + } + + public int getLeft() { + return left; + } + + public void setLeft(int left) { + this.left = left; + } + + public int getRight() { + return right; + } + + public void setRight(int right) { + this.right = right; + } + + public int getTop() { + return top; + } + + public void setTop(int top) { + this.top = top; + } + } + } + + public static class PictureBean { + /** + * data : + * length : 10015 + * type : 2 + */ + + private String data; + private int length; + private int type; + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + public int getLength() { + return length; + } + + public void setLength(int length) { + this.length = length; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + } + } +} diff --git a/face-snapShot/src/main/java/com/dkha/face/modules/RecevieVO.java b/face-snapShot/src/main/java/com/dkha/face/modules/RecevieVO.java new file mode 100644 index 0000000..8d37043 --- /dev/null +++ b/face-snapShot/src/main/java/com/dkha/face/modules/RecevieVO.java @@ -0,0 +1,28 @@ +package com.dkha.face.modules; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @version V1.0 + * @Description: TODO(用于接收抓拍机返回的数据) + * All rights 成都电科慧安 + * @Title: RecevieVO + * @Package com.dkha.face.modules + * @author: panhui + * @date: 2019/12/25 11:30 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NotNull +@JsonInclude(JsonInclude.Include.NON_NULL) +public class RecevieVO { + + private String cmd; + private Integer id; + private Object body; +} diff --git a/face-snapShot/src/main/resources/application.yml b/face-snapShot/src/main/resources/application.yml new file mode 100644 index 0000000..174babe --- /dev/null +++ b/face-snapShot/src/main/resources/application.yml @@ -0,0 +1,2 @@ +server: + port: 1990 diff --git a/face-task/pom.xml b/face-task/pom.xml new file mode 100644 index 0000000..3be788c --- /dev/null +++ b/face-task/pom.xml @@ -0,0 +1,109 @@ + + + + face-application + com.dkha + 1.0-SNAPSHOT + + 4.0.0 + + face-task + + + + com.dkha + face-common + ${project.version} + + + + org.springframework + springloaded + + + org.springframework.boot + spring-boot-devtools + true + true + + + + org.springframework.boot + spring-boot-starter-websocket + + + org.springframework.boot + spring-boot-starter-data-redis + + + redis.clients + jedis + + + + + + + + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-starter-web + + + + com.baomidou + mybatis-plus-boot-starter + + + com.baomidou + mybatis-plus-generator + + + + + org.freemarker + freemarker + + + mysql + mysql-connector-java + + + org.projectlombok + lombok + + + com.alibaba + druid-spring-boot-starter + + + + + + org.springframework.boot + spring-boot-maven-plugin + + com.dkha.task.FaceTaskMain + + + + + + \ No newline at end of file diff --git a/face-task/src/main/java/com/dkha/task/FaceTaskMain.java b/face-task/src/main/java/com/dkha/task/FaceTaskMain.java new file mode 100644 index 0000000..6ec30d7 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/FaceTaskMain.java @@ -0,0 +1,62 @@ +package com.dkha.task; + +import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor; +import com.dkha.task.config.MyMetaObjectHandler; +import com.dkha.task.service.WebSocketContral; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.PropertySource; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import springfox.documentation.swagger2.annotations.EnableSwagger2; +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: FaceSnapShotMain + * @Package com.dkha.face.contral + * @author: panhui + * @date: 2019/12/25 10:09 + * @Copyright: 成都电科慧安 + */ +@EnableSwagger2 +@SpringBootApplication(scanBasePackages = {"com.dkha.common","com.dkha.task"}) +@MapperScan("com.dkha.task.modual.mapper") +@EnableScheduling +@EnableAsync +public class FaceTaskMain { + + public static void main(String[]args) + { + SpringApplication springApplication = new SpringApplication(FaceTaskMain.class); + ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args); + //解决WebSocket不能注入的问题 + WebSocketContral.setApplicationContext(configurableApplicationContext); + } + + /** + * mybatis-plus自动注入插件 + * + * @return + */ + @Bean + public MyMetaObjectHandler createMyMetaObjectHandler() { + return new MyMetaObjectHandler(); + } + + /** + * mybatis-plus执行效率插件 + * @return + */ + //@Bean + // 设置 dev test 环境开启 + //@Profile({"dev"}) + public PerformanceInterceptor performanceInterceptor() { + return new PerformanceInterceptor(); + } + + +} diff --git a/face-task/src/main/java/com/dkha/task/comm/TimerData.java b/face-task/src/main/java/com/dkha/task/comm/TimerData.java new file mode 100644 index 0000000..36a96cb --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/comm/TimerData.java @@ -0,0 +1,38 @@ +package com.dkha.task.comm; + +import com.dkha.task.modual.vo.BayonetVO; + +import java.text.SimpleDateFormat; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @version V1.0 + * @Description: TODO(定时任务里面的统计) + * All rights 成都电科慧安 + * @Title: TimerData + * @Package com.dkha.server.common + * @author: panhui + * @date: 2020/1/3 14:26 + * @Copyright: 成都电科慧安 + */ +public class TimerData { + //预警总数统计 + public static Long WARNING_NUM = -1L; + + //存储卡口不同的数据 + public static ConcurrentHashMap bayonetMap=new ConcurrentHashMap<>(); + + /** + * 不同的session保存不同的token + */ + public static ConcurrentHashMap tokens=new ConcurrentHashMap<>(); + + //获取当前时间 + public static String TIME_MARK=new SimpleDateFormat("yyyyMMdd").format(System.currentTimeMillis()); + + //系统处理的数量 50 + public static final Integer SYSTEM_DEEL_NUM=100; + //每次处理数据中 redis过期时间 + public static final Long expireTime=3000L; +} + diff --git a/face-task/src/main/java/com/dkha/task/config/MyMetaObjectHandler.java b/face-task/src/main/java/com/dkha/task/config/MyMetaObjectHandler.java new file mode 100644 index 0000000..bf861ba --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/config/MyMetaObjectHandler.java @@ -0,0 +1,42 @@ +package com.dkha.task.config; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.dkha.common.enums.YNEnums; +import org.apache.ibatis.reflection.MetaObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Date; + +/** + * 公共字段自动填充处理类 + */ +public class MyMetaObjectHandler implements MetaObjectHandler { + private static final Logger LOGGER = LoggerFactory.getLogger(MyMetaObjectHandler.class); + + + @Override + public void insertFill(MetaObject metaObject) { + + /** + * Ps:此处不能用下划线表示数据库字段,要使用驼峰命名 + */ + + Object isValidData = this.getFieldValByName( + "isValid", metaObject); + if (isValidData == null) { + this.setFieldValByName("isValid", YNEnums.YES.code, metaObject); + } + this.setFieldValByName("createTime", new Date(), metaObject); + this.setFieldValByName("createBy", String.valueOf(0L), metaObject); + this.setFieldValByName("updateTime", new Date(), metaObject); + this.setFieldValByName("updateBy", String.valueOf(0L), metaObject); + } + + @Override + public void updateFill(MetaObject metaObject) { + this.setUpdateFieldValByName("updateTime", new Date(), metaObject); + this.setUpdateFieldValByName("updateBy", String.valueOf(0L), metaObject); + } +} + diff --git a/face-task/src/main/java/com/dkha/task/config/WebSocketConfig.java b/face-task/src/main/java/com/dkha/task/config/WebSocketConfig.java new file mode 100644 index 0000000..07a6786 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/config/WebSocketConfig.java @@ -0,0 +1,19 @@ +package com.dkha.task.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +/** + * @Author Spring + * @Since 2019/9/12 20:10 + * @Description + */ +@Configuration +public class WebSocketConfig { + + @Bean + public ServerEndpointExporter serverEndpointExporter() { + return new ServerEndpointExporter(); + } +} diff --git a/face-task/src/main/java/com/dkha/task/contral/TestContral.java b/face-task/src/main/java/com/dkha/task/contral/TestContral.java new file mode 100644 index 0000000..8cca7e3 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/contral/TestContral.java @@ -0,0 +1,61 @@ +package com.dkha.task.contral; + +import com.dkha.task.modual.entity.FaceTrackEntity; +import com.dkha.task.modual.mapper.SysUserTokenDao; +import com.dkha.task.service.FaceTrackService; +import com.dkha.task.service.WebSocketContral; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: TestContral + * @Package com.dkha.task.contral + * @author: panhui + * @date: 2019/12/31 18:24 + * @Copyright: 成都电科慧安 + */ +@RestController +@RequestMapping("/socket") +public class TestContral { + + @Autowired + private WebSocketContral webSocketContral; + + @Autowired + private SysUserTokenDao sysUserTokenDao; + + + @Autowired + private FaceTrackService faceTrackService; + + @GetMapping("/test1") + public String test1(String token) + { + System.out.println("sysUserTokenDao="+sysUserTokenDao.getByToken(token,new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(System.currentTimeMillis()))); + webSocketContral.sendMessage("xxxxxxxxxxx"); + return "xxx"; + } + + + @GetMapping("/test2") + public String test2() + { + List faceTrackEntities=new ArrayList<>(); + FaceTrackEntity faceTrackEntity=new FaceTrackEntity(); + faceTrackEntity.setTrajectoryThreshold(0.8); + faceTrackEntity.setIdPortrait(111L); + faceTrackEntities.add(faceTrackEntity); + faceTrackService.saveBatch(faceTrackEntities); + return "xxx"; + } +} diff --git a/face-task/src/main/java/com/dkha/task/contral/TimerContral.java b/face-task/src/main/java/com/dkha/task/contral/TimerContral.java new file mode 100644 index 0000000..ac1d486 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/contral/TimerContral.java @@ -0,0 +1,273 @@ +package com.dkha.task.contral; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dkha.common.enums.ErrEnum; +import com.dkha.common.enums.SocketEnum; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.camera.BayOnetCameraVO; +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.common.modules.vo.dto.FaceLibraryVO; +import com.dkha.common.modules.vo.face.AlarmReturnVO; +import com.dkha.common.modules.vo.face.ApiAlarmVO; +import com.dkha.common.modules.vo.face.PageVO; +import com.dkha.common.modules.vo.warning.BayoneReturnListVO; +import com.dkha.common.modules.vo.warning.WarningPageVO; +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import com.dkha.common.util.UrlUtil; +import com.dkha.common.util.UtilValidate; +import com.dkha.task.comm.TimerData; +import com.dkha.task.modual.vo.ReturnVO; +import com.dkha.task.service.ApiDeelService; +import com.dkha.task.service.IControlBayonetMidService; +import com.dkha.task.service.WebSocketContral; +import com.dkha.task.service.impl.AsyncServiceImpl; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: TimerContral + * @Package com.dkha.task.contral + * @author: panhui + * @date: 2020/1/2 16:31 + * @Copyright: 成都电科慧安 + */ +@Slf4j +@Component +public class TimerContral { + + @Value("${face.warning-url}") + private String warningUrl; + + @Value("${face.bayonet-url}") + private String bayonetUrl; + + @Autowired + private HttpUtil httpUtil; + + @Autowired + private WebSocketContral webSocketContral; + + @Autowired + private Gson gson; + + @Autowired + private RedisUtils redisUtils; + + /** + * 预警内容的定时数据 10秒后啓動每次10毫秒運行 TODO 後續記得加上token + */ + @Scheduled(fixedDelay = 50, initialDelay = 1000 * 10) + public void warning() { + try { +// String userToken = ""; +// if (UtilValidate.isNotEmpty(redisUtils.get("token"))) { +// userToken = (String) redisUtils.get("token"); +// } else { +// return; +// } + //更改ddd + ApiAlarmVO apiAlarmVO = new ApiAlarmVO(); +// apiAlarmVO.setToken(userToken); + String json = UrlUtil.postData(warningUrl, apiAlarmVO, httpUtil, gson); + if (UtilValidate.isEmpty(json)) { + return; + } + Page pages = gson.fromJson(json, Page.class); + if (TimerData.WARNING_NUM.intValue() == -1 || pages.getTotal() == 0L || TimerData.WARNING_NUM.intValue() == pages.getTotal()) { + if (TimerData.WARNING_NUM.intValue() == -1 && pages.getTotal() != 0L) { + //刚启动的时候 + TimerData.WARNING_NUM = pages.getTotal(); + } + } else { + Long count = pages.getTotal() - TimerData.WARNING_NUM; + if(count<0){ + count = 1L; + } + ApiAlarmVO apiVO = new ApiAlarmVO(); +// apiVO.setToken(userToken); + PageVO pageVo = new PageVO(); + pageVo.setPageSize(count.intValue()); + apiVO.setPage(pageVo); + String jsonData = UrlUtil.postData(warningUrl, apiVO, httpUtil, gson); + if (UtilValidate.isNotEmpty(jsonData)) { + Page page = gson.fromJson(jsonData, Page.class); + try { + List myRecords = gson.fromJson(gson.toJson(page.getRecords()), new TypeToken>() { + }.getType()); + myRecords.forEach(e -> + { + ReturnVO returnVO = new ReturnVO(ErrEnum.OK, e); + returnVO.setCmd(SocketEnum.WARNING.getCode()); + webSocketContral.sendMessage(gson.toJson(returnVO)); + try { + if (myRecords.size() > 1) { + Thread.sleep(50); + } + } catch (Exception ex) { + } + }); + } catch (Exception ex) { + } finally { + TimerData.WARNING_NUM = pages.getTotal(); + } + } + } + } catch (Exception e) { + log.error("预警系统异常,休眠10秒再试{}", e.getMessage()); + try { + Thread.sleep(10000); + } catch (InterruptedException e1) { + + } + } + } + + + @Autowired + private AsyncServiceImpl asyncContral; + + /** + * 卡口数据获取 TODO 後續記得加上token + */ + @Scheduled(fixedDelay = 40, initialDelay = 20000) + public void bayonet() { + try { + TimerData.bayonetMap.forEach((a, b) -> + { +// String sessionId = a; +// String userToken = ""; +// if (UtilValidate.isNotEmpty(redisUtils.get(RedisKeys.getSessionIdKey(sessionId)))) { +// userToken = (String) redisUtils.get(RedisKeys.getSessionIdKey(sessionId)); +// } else { +// return; +// } + ApiAlarmVO apiAlarmVO = new ApiAlarmVO(); +// apiAlarmVO.setToken(userToken); + String json = UrlUtil.getData(bayonetUrl + "/" + b.getCarmeraId() + "/" + 1, httpUtil, gson); + + if (UtilValidate.isEmpty(json)) { + return; + } +// if (json.length() < 4) { +// if (ErrEnum.UNAUTHORIZED.getCode().intValue() == Integer.valueOf(json)) { +// webSocketContral.sendMessage(gson.toJson(new ReturnVO(ErrEnum.UNAUTHORIZED))); +// TimerData.bayonetMap.remove(a); +// return; +// } +// } + + BayoneReturnListVO bayoneReturnListVO = gson.fromJson(json, BayoneReturnListVO.class); + if (b.getBayonetNum().intValue() == -1 || bayoneReturnListVO.getToDaySnapShot() == 0L || b.getBayonetNum() == bayoneReturnListVO.getToDaySnapShot()) { + if (b.getBayonetNum().intValue() == -1 && bayoneReturnListVO.getToDaySnapShot() != 0L) { + //刚启动的时候 + b.setBayonetNum(bayoneReturnListVO.getToDaySnapShot()); + } + } else { + Long count = bayoneReturnListVO.getToDaySnapShot() - b.getBayonetNum(); + String jsonData = UrlUtil.getData(bayonetUrl + "/" + b.getCarmeraId() + "/" + count, httpUtil, gson); + if (UtilValidate.isNotEmpty(jsonData)) { +// System.out.println(bayoneReturnListVO.getToDaySnapShot() + "bayonet发现预警!" + count + "==" + b.getBayonetNum()); + BayoneReturnListVO bayoneVO = gson.fromJson(jsonData, BayoneReturnListVO.class); + try { + List myRecords = gson.fromJson(gson.toJson(bayoneVO.getResult()), new TypeToken>() { + }.getType()); + myRecords.forEach(e -> + { + e.setToDaySnapShot(bayoneVO.getToDaySnapShot()); + e.setTotalSnapShot(bayoneVO.getTotalSnapShot()); + ReturnVO returnVO = new ReturnVO(ErrEnum.OK, e); + returnVO.setCmd(SocketEnum.BAYONET.getCode()); + asyncContral.bayonetInfo(a, gson.toJson(returnVO)); + }); + } catch (Exception ex) { + } finally { + b.setBayonetNum(bayoneReturnListVO.getToDaySnapShot()); + } + } + } + }); + } catch (Exception e) { + log.error("卡口系统异常,休眠10秒再试{}", e.getMessage()); + try { + Thread.sleep(10000); + } catch (InterruptedException e1) { + + } + } + } + + + @Autowired + private IControlBayonetMidService iControlBayonetMidService; + + + @Autowired + private ApiDeelService apiDeelService; + + /** + * 人物轨迹信息 TODO 後續記得加上token + */ + @Scheduled(fixedDelay = 1000 * 60, initialDelay = 10000) + public void bayonetTrack() { + log.error("轨迹检测开始"); + //获取布控摄像头的列表 + List cameraList = iControlBayonetMidService.selectCameraByTask(); + if (UtilValidate.isEmpty(cameraList)) { + return; + } + String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis()); +// CameraInfoVO cameraInfoVO = cameraList.get(0); +// System.out.println(cameraInfoVO); +// cameraList.clear(); +// cameraInfoVO.setIdFaceCamera("1210110089958686721"); +// cameraList.add(cameraInfoVO); +// log.error("摄像头类别"+gson.toJson(cameraList)); + cameraList.forEach(a -> + { + //不存在摄像头数据了 + if (!redisUtils.exists(RedisKeys.getCameraByTrack(nowTime, a.getIdFaceCamera()))) { + FaceLibraryVO faceLibraryVO = new FaceLibraryVO(); + faceLibraryVO.setName("摄像头库" + nowTime + ":" + a.getIdFaceCamera()); + faceLibraryVO = apiDeelService.addLib(faceLibraryVO); //暂时去掉 +// faceLibraryVO=new FaceLibraryVO(); +// faceLibraryVO.setLibraryId(a.getIdFaceCamera()); + if (UtilValidate.isNotEmpty(faceLibraryVO)) { + //创建人脸库 使用时间+摄像头id + //给redis赋值 + //每个摄像头创建一个线程一直运行程序检测时间如果不是当天则自动关闭 + //关联新建的库id和一些基本信息 + BayOnetCameraVO bayOnetCameraVO = new BayOnetCameraVO(a.getIdFaceCamera(), faceLibraryVO.getLibraryId().toString(), 0L, new ArrayList<>()); + redisUtils.set(RedisKeys.getCameraByTrack(nowTime, a.getIdFaceCamera()), gson.toJson(bayOnetCameraVO)); + //运行一个线程检索的方法 + asyncContral.trackByCamera(nowTime, a.getIdFaceCamera()); + log.error("运行检测的方法:{},{}", nowTime, a.getIdFaceCamera()); + return; + } + } else { + //利用redis的过期来判定任务是否异常退出 + //30秒过期 + if (!redisUtils.exists(RedisKeys.getCameraByExpired(nowTime, a.getIdFaceCamera()))) { + //运行一个线程检索的方法 + log.error("过期时候运行检测的方法:{},{}", nowTime, a.getIdFaceCamera()); + asyncContral.trackByCamera(nowTime, a.getIdFaceCamera()); + } + } + }); + } + + +} diff --git a/face-task/src/main/java/com/dkha/task/modual/BaseDao.java b/face-task/src/main/java/com/dkha/task/modual/BaseDao.java new file mode 100644 index 0000000..d5caaf5 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/BaseDao.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.task.modual; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 基础Dao + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface BaseDao extends BaseMapper { + +} diff --git a/face-task/src/main/java/com/dkha/task/modual/SysUserTokenEntity.java b/face-task/src/main/java/com/dkha/task/modual/SysUserTokenEntity.java new file mode 100644 index 0000000..2b52d61 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/SysUserTokenEntity.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.task.modual; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 系统用户Token + */ +@Data +@TableName("sys_user_token") +public class SysUserTokenEntity implements Serializable { + private static final long serialVersionUID = 1L; + /** + * id + */ + @TableId + private Long id; + /** + * 用户ID + */ + private Long userId; + /** + * 用户token + */ + private String token; + /** + * 过期时间 + */ + private Date expireDate; + /** + * 更新时间 + */ + private Date updateDate; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createDate; + +} \ No newline at end of file diff --git a/face-task/src/main/java/com/dkha/task/modual/entity/ControlBayonetMid.java b/face-task/src/main/java/com/dkha/task/modual/entity/ControlBayonetMid.java new file mode 100644 index 0000000..ae3546a --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/entity/ControlBayonetMid.java @@ -0,0 +1,62 @@ +package com.dkha.task.modual.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 布控和摄像头中间表 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="ControlBayonetMid对象", description="布控和摄像头中间表") +public class ControlBayonetMid implements Serializable { + + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "id") + @TableId(value = "id", type = IdType.ID_WORKER) + private Long id; + + @ApiModelProperty(value = "id布控id") + private Long idControlTask; + + @ApiModelProperty(value = "摄像头id") + private Long idFaceCamera; + + @ApiModelProperty(value = "是否有效 Y有效 N无效") + @TableField(fill = FieldFill.INSERT) + private String isValid; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date createTime; + + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createBy; + + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + +} diff --git a/face-task/src/main/java/com/dkha/task/modual/entity/FaceCamera.java b/face-task/src/main/java/com/dkha/task/modual/entity/FaceCamera.java new file mode 100644 index 0000000..77d319f --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/entity/FaceCamera.java @@ -0,0 +1,107 @@ +package com.dkha.task.modual.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 摄像头表 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="FaceCamera对象", description="摄像头表") +public class FaceCamera implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + @TableId(value = "id_face_camera", type = IdType.ID_WORKER) + private Long idFaceCamera; + + @ApiModelProperty(value = "摄像头名称") + private String cameraName; + + @ApiModelProperty(value = "摄像头区域-码值") + private String cameraRegionFirstlevel; + + @ApiModelProperty(value = "摄像头详细地址") + private String cameraAddress; + + @ApiModelProperty(value = "摄像头经度") + private String cameratLongitude; + + @ApiModelProperty(value = "摄像头纬度") + private String cameraLatitude; + + @ApiModelProperty(value = "位置类型-码值") + private String cameratLocationtypeId; + + @ApiModelProperty(value = "公安机关代码") + private String publicSecurityCode; + + @ApiModelProperty(value = "公安机关名称") + private String publicSecurityName; + + @ApiModelProperty(value = "建设单位") + private String constructionUnit; + + @ApiModelProperty(value = "管理单位") + private String managementUnit; + + @ApiModelProperty(value = "管理人员") + private String managementPersonnel; + + @ApiModelProperty(value = "联系电话") + private String contactNumber; + + @ApiModelProperty(value = "IP") + private String ip; + + @ApiModelProperty(value = "用户名") + private String userName; + + @ApiModelProperty(value = "密码") + private String passwd; + + @ApiModelProperty(value = "品牌") + private String brand; + + @ApiModelProperty(value = "rtsp地址") + private String rtspUrl; + + @ApiModelProperty(value = "备注信息") + private String remarks; + + @ApiModelProperty(value = "是否运行 Y启动 N未启动") + private String status; + + @ApiModelProperty(value = "是否有效 Y有效 N无效") + private String isValid; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + +} diff --git a/face-task/src/main/java/com/dkha/task/modual/entity/FaceTrackEntity.java b/face-task/src/main/java/com/dkha/task/modual/entity/FaceTrackEntity.java new file mode 100644 index 0000000..96b3719 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/entity/FaceTrackEntity.java @@ -0,0 +1,84 @@ +package com.dkha.task.modual.entity; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Value; +import lombok.experimental.Accessors; +import java.io.Serializable; +import java.util.Date; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="FaceTrackEntity对象", description="轨迹对象") +@TableName(value = "face_track") +public class FaceTrackEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 轨迹id + */ + @ApiModelProperty(value = "id_face_track") + @TableId(value = "id_face_track", type = IdType.ID_WORKER) + private Long idFaceTrack; + /** + * 人像id + */ + private Long idPortrait; + /** + * 摄像头id + */ + private Long idFaceCamera; + /** + * 库id + */ + private Long idFactory; + /** + * 人物数据 + */ + private String characterData; + /** + * 关联数据 + */ + private String linkedData; + /** + * 分组时间 + */ + private String packetTime; + /** + * 当月数据关联 + */ + private String monthData; + /** + * 轨迹判定阈值 + */ + private Double trajectoryThreshold; + /** + * 创建人 + */ + private String createBy; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新人 + */ + private String updateBy; + /** + * 更新时间 + */ + private Date updateTime; +} \ No newline at end of file diff --git a/face-task/src/main/java/com/dkha/task/modual/mapper/ControlBayonetMidMapper.java b/face-task/src/main/java/com/dkha/task/modual/mapper/ControlBayonetMidMapper.java new file mode 100644 index 0000000..7697a42 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/mapper/ControlBayonetMidMapper.java @@ -0,0 +1,36 @@ +package com.dkha.task.modual.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.task.modual.entity.ControlBayonetMid; +import com.dkha.task.modual.entity.FaceCamera; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *

+ * 布控和摄像头中间表 Mapper 接口 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Mapper +public interface ControlBayonetMidMapper extends BaseMapper { + /** + * 根据任务ID删除任务和摄像头的中间表 + * + * @Return Integer >0成功 + */ + Integer deletetaskandcarmerbytaskid(@Param("taskID") String taskID); + + Integer selectexistByCarmeID(@Param("idcamera") String idcamera); + + Integer updateCarmerValidaStateByTaskID(@Param("taskID") String taskID, @Param("State") String State, @Param("UpdateBy") String UpdateBy); + + List selectFaceCameraBytaskID(@Param("taskID") String taskID); + List selectFaceCameraBytask(); + int getControlByRegion(@Param("regionId") long regionId); +} diff --git a/face-task/src/main/java/com/dkha/task/modual/mapper/FaceTrackMapper.java b/face-task/src/main/java/com/dkha/task/modual/mapper/FaceTrackMapper.java new file mode 100644 index 0000000..7d5c04a --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/mapper/FaceTrackMapper.java @@ -0,0 +1,41 @@ +package com.dkha.task.modual.mapper; + + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dkha.task.modual.entity.FaceTrackEntity; +import com.dkha.task.modual.vo.FaceTrackVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +@Mapper +public interface FaceTrackMapper extends BaseMapper { + /** + * 根据摄像头和分组时间查询 + * @param idFaceCamera + * @param packetTime + * @return + */ + List querByidCameraAndTime(@Param("idFaceCamera")Long idFaceCamera, @Param("packetTime")String packetTime); + /** + * 根据摄像头Id和开始,结束时间,人脸ID + * @param faceTrackVO + * @return + */ + List queryByidCamerAndFaceId(@Param("faceTrackVO")FaceTrackVO faceTrackVO); + + /** + * 根据图片路径和开始,结束时间 + * @param faceTrackVO + * @return + */ + List queryByurlAndTime(@Param("faceTrackVO")FaceTrackVO faceTrackVO); +} \ No newline at end of file diff --git a/face-task/src/main/java/com/dkha/task/modual/mapper/SysUserTokenDao.java b/face-task/src/main/java/com/dkha/task/modual/mapper/SysUserTokenDao.java new file mode 100644 index 0000000..c9f2765 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/mapper/SysUserTokenDao.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.dkha.task.modual.mapper; + +import com.dkha.task.modual.BaseDao; +import com.dkha.task.modual.SysUserTokenEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * 系统用户Token + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysUserTokenDao extends BaseDao { + + SysUserTokenEntity getByToken(@Param("value") String value, @Param("time") String time); + + void updateToken(@Param("userId") Long userId, @Param("token") String token); +} diff --git a/face-task/src/main/java/com/dkha/task/modual/vo/BayonetVO.java b/face-task/src/main/java/com/dkha/task/modual/vo/BayonetVO.java new file mode 100644 index 0000000..36b1ce2 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/vo/BayonetVO.java @@ -0,0 +1,30 @@ +package com.dkha.task.modual.vo; + +import com.dkha.common.modules.vo.warning.WarningPageVO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: PageMsgVO + * @Package com.dkha.task.modual.vo + * @author: panhui + * @date: 2020/1/3 15:14 + * @Copyright: 成都电科慧安 + */ +@AllArgsConstructor +@NoArgsConstructor +@Data +public class BayonetVO{ + //当前查询的数量 + private Long bayonetNum=-1L; + //摄像头id + private String carmeraId; + + +} diff --git a/face-task/src/main/java/com/dkha/task/modual/vo/FaceTrackVO.java b/face-task/src/main/java/com/dkha/task/modual/vo/FaceTrackVO.java new file mode 100644 index 0000000..ef0edb2 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/vo/FaceTrackVO.java @@ -0,0 +1,46 @@ +package com.dkha.task.modual.vo; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class FaceTrackVO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 图片url + */ + private String url; + /** + * 人像id + */ + private String faceId; + /** + * 摄像头id + */ + private Long idFaceCamera; + /** + * 库id + */ + private String startTime; + /** + * 人物数据 + */ + private String endTime; +} \ No newline at end of file diff --git a/face-task/src/main/java/com/dkha/task/modual/vo/ReturnVO.java b/face-task/src/main/java/com/dkha/task/modual/vo/ReturnVO.java new file mode 100644 index 0000000..d42c06f --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/modual/vo/ReturnVO.java @@ -0,0 +1,162 @@ +package com.dkha.task.modual.vo; + + +import com.dkha.common.enums.ErrEnum; +import com.dkha.common.exception.DkException; +import com.dkha.common.util.UtilValidate; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.validation.BindingResult; + +import java.io.Serializable; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ReturnVO + * @Package com.dkha.api.modules + * @author: panhui + * @date: 2019/12/2 13:34 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value="API通用返回", description="Api通用返回結構類") +public class ReturnVO implements Serializable { + + private Integer code; + private String message; + private String cmd; + private Object data; + private static final long serialVersionUID = 1L; + + + public ReturnVO(Object data, Integer code, String message) { + this.code = code; + this.data = data; + this.message = message; + } + + public ReturnVO(ErrEnum errEnum) { + this.code = errEnum.getCode(); + this.data = null; + this.message = errEnum.getMsg(); + } + public ReturnVO(ErrEnum errEnum,Object data) { + this.code = errEnum.getCode(); + this.data = data; + this.message = errEnum.getMsg(); + } + + public ReturnVO(Integer code, String message) { + this.code = code; + this.data = null; + this.message = message; + } + + /** + * 操作成功返回集 code为200 + */ + public ReturnVO successResult(Object data) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.OK.getCode(); + ReturnVO.data = data; + ReturnVO.message = ErrEnum.OK.getMsg(); + return ReturnVO; + } + + /** + * 操作成功返回集 code为200 + * @param message + * @param data + */ + public ReturnVO successResult(String message, Object data) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.OK.getCode(); + ReturnVO.data = data; + ReturnVO.message = UtilValidate.isEmpty(message) ? ErrEnum.OK.getMsg() : message; + return ReturnVO; + } + + /** + * 操作失败返回集 默认code 500 + * @param message + * @return + */ + public ReturnVO failResult(String message) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.ERROR.getCode(); + ReturnVO.data = null; + ReturnVO.message = message; + return ReturnVO; + } + + /** + * 参数不正确 默认code + * @param message + * @return + */ + public ReturnVO paramErrorResult(String message) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.BAD_REQUEST.getCode(); + ReturnVO.data = null; + ReturnVO.message = (UtilValidate.isEmpty(message)?ErrEnum.BAD_REQUEST.getMsg():message); + return ReturnVO; + } + + /** + * 没有查询到数据 默认code + * @param message + * @return + */ + public ReturnVO notInfoResult(String message) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.NOT_FOUND.getCode(); + ReturnVO.data = null; + ReturnVO.message = (UtilValidate.isEmpty(message)?ErrEnum.NOT_FOUND.getMsg():message); + return ReturnVO; + } + + /** + * 操作失败返回集 + * @param + * @return + */ + public ReturnVO fail() { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = ErrEnum.ERROR.getCode(); + ReturnVO.data = null; + ReturnVO.message = ErrEnum.ERROR.getMsg(); + return ReturnVO; + } + + /** + * 操作失败返回集 + * @param data + * @param message + * @param code + */ + public ReturnVO failResult(Integer code, String message, Object data) { + ReturnVO ReturnVO = new ReturnVO(); + ReturnVO.code = UtilValidate.isEmpty(code) ? ErrEnum.ERROR.getCode() : code; + ReturnVO.data = data; + ReturnVO.message = UtilValidate.isEmpty(message) ? ErrEnum.ERROR.getMsg() : message; + return ReturnVO; + } + + /** + * 用于Hibernate-validate vo校验 + * @param bindingResult + */ + public void validate(BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + throw new DkException(bindingResult.getFieldError().getDefaultMessage()); + } + } +} diff --git a/face-task/src/main/java/com/dkha/task/service/ApiDeelService.java b/face-task/src/main/java/com/dkha/task/service/ApiDeelService.java new file mode 100644 index 0000000..4a1b1e6 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/service/ApiDeelService.java @@ -0,0 +1,34 @@ +package com.dkha.task.service; + +import com.dkha.common.modules.vo.ApiVO; +import com.dkha.common.modules.vo.dto.FaceLibraryVO; +import org.springframework.stereotype.Service; + +/** + * @version V1.0 + * @Description: TODO(操作api的service层) + * All rights 成都电科慧安 + * @Title: ApiDeelService + * @Package com.dkha.task.service + * @author: panhui + * @date: 2020/1/9 17:00 + * @Copyright: 成都电科慧安 + */ +@Service +public interface ApiDeelService { + + + /** + * 创建一个人脸库 + * @return + */ + FaceLibraryVO addLib(FaceLibraryVO faceLibraryVO); + + /** + * 根据时间获取当天数据摄像头的es抓拍数据 + * @param cameraId + * @return + */ + void getApi(String cameraId,String time,Long bayonetNum,String libId); + +} diff --git a/face-task/src/main/java/com/dkha/task/service/FaceTrackService.java b/face-task/src/main/java/com/dkha/task/service/FaceTrackService.java new file mode 100644 index 0000000..32a26f9 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/service/FaceTrackService.java @@ -0,0 +1,44 @@ +package com.dkha.task.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dkha.task.modual.entity.FaceTrackEntity; +import com.dkha.task.modual.vo.FaceTrackVO; + +import java.util.List; + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +public interface FaceTrackService extends IService { + /** + * 新增 + * @param faceTrackEntity + * @return + */ + int addFaceTrackEntity(FaceTrackEntity faceTrackEntity); + /** + * 根据摄像头和分组时间查询 + * @param idFaceCamera + * @param packetTime + * @return + */ + List querByidCameraAndTime(Long idFaceCamera, String packetTime); + + /** + * 根据摄像头Id和开始,结束时间,人脸ID + * @param faceTrackVO + * @return + */ + List queryByidCamerAndFaceId(FaceTrackVO faceTrackVO); + + /** + * 根据图片路径和开始,结束时间 + * @param faceTrackVO + * @return + */ + List queryByurlAndTime(FaceTrackVO faceTrackVO); +} \ No newline at end of file diff --git a/face-task/src/main/java/com/dkha/task/service/IControlBayonetMidService.java b/face-task/src/main/java/com/dkha/task/service/IControlBayonetMidService.java new file mode 100644 index 0000000..92549e0 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/service/IControlBayonetMidService.java @@ -0,0 +1,57 @@ +package com.dkha.task.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.task.modual.entity.ControlBayonetMid; +import com.dkha.task.modual.entity.FaceCamera; + +import java.util.List; + +/** + *

+ * 布控和摄像头中间表 服务类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +public interface IControlBayonetMidService extends IService { + /** + * 根据任务ID删除任务和摄像头的中间表 + */ + Integer deletetaskandcarmerbytaskid(String taskID); + + /** + * 根据摄像头ID判断是否存在任务 + */ + long selectexistByCarmeID(String idcamera); + + /** + * 更新中间库摄像头状态 + */ + Integer updateCarmerValidaStateByTaskID(String taskID, String State, String UpdateBy); + + /** + * 根据任务ID获取摄像头列表 + */ + List selectFaceCameraBytaskID(String taskid); + + /** + * 查询所有有布控任务的摄像头 + */ + List selectCameraByTask(); + + /** + * 获取最新布控的一个摄像头 + */ + ControlBayonetMid selectFaceCameraByTime(); + + /** + * 根据区域获取布控任务 + * + * @param regionId + * @return + */ + int getControlByRegion(long regionId); + +} diff --git a/face-task/src/main/java/com/dkha/task/service/WebSocketContral.java b/face-task/src/main/java/com/dkha/task/service/WebSocketContral.java new file mode 100644 index 0000000..509aca4 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/service/WebSocketContral.java @@ -0,0 +1,174 @@ +package com.dkha.task.service; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArraySet; + +import javax.websocket.OnClose; +import javax.websocket.OnMessage; +import javax.websocket.OnOpen; +import javax.websocket.Session; +import javax.websocket.server.PathParam; +import javax.websocket.server.ServerEndpoint; + +import com.dkha.common.enums.ErrEnum; +import com.dkha.common.enums.SocketEnum; +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import com.dkha.common.util.UtilValidate; +import com.dkha.task.comm.TimerData; +import com.dkha.task.modual.SysUserTokenEntity; +import com.dkha.task.modual.mapper.SysUserTokenDao; +import com.dkha.task.modual.vo.BayonetVO; +import com.dkha.task.modual.vo.ReturnVO; +import com.google.gson.Gson; +import lombok.Data; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Component; + +import lombok.extern.slf4j.Slf4j; + +@Component +@ServerEndpoint("/webSocket") +@Slf4j +public class WebSocketContral { + + + private Session session; + private Gson gson=new Gson(); + + private static CopyOnWriteArraySet webSocketSet=new CopyOnWriteArraySet(); + public static Map myMap=new ConcurrentHashMap(); + + private RedisUtils redisUtils; + //此处是解决无法注入的关键 + private static ApplicationContext applicationContext; + //要注入的service或者dao + private SysUserTokenDao sysUserTokenDao; + + public static void setApplicationContext(ApplicationContext applicationContext) { + WebSocketContral.applicationContext = applicationContext; + } + + @OnOpen + public void opOpen(Session session) + { + redisUtils =applicationContext.getBean(RedisUtils.class); + this.session=session; + if(myMap.containsKey(session.getId())) + { + try { + this.session.close(); + } catch (IOException e) { + } +// log.error("已经存在"); + return; + } + sysUserTokenDao=applicationContext.getBean(SysUserTokenDao.class); + String time=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(System.currentTimeMillis()); + SysUserTokenEntity sysUserTokenEntity= null;//sysUserTokenDao.getByToken(token,time); + if(UtilValidate.isEmpty(sysUserTokenEntity)) + { + log.error("token过期"); + sessionSendMsg(session,gson.toJson(new ReturnVO(ErrEnum.UNAUTHORIZED))); + try { + this.session.close(); + } catch (Exception e) { + } + return; + } +// //广播使用 +// redisUtils.set("token",token); +// //对应使用 +// redisUtils.set(RedisKeys.getSessionIdKey(session.getId()),token); +// TimerData.tokens.put(session.getId(),token); + webSocketSet.add(this); + myMap.put(session.getId(), this); +// log.info(session.getId()+"【websocket消息】有新的连接,总数:{},{},{}",webSocketSet.size(),myMap.size(),token); + + } + @OnClose + public void onClose() + { +// log.info(this.session.getId()+"【websocket消息】连接断开,总数:{},{}",webSocketSet.size(),myMap.size()); + if(TimerData.bayonetMap.containsKey(this.session.getId())) { + TimerData.bayonetMap.remove(this.session.getId()); + } + myMap.remove(this.session.getId()); + webSocketSet.remove(this); +// log.info("关闭成功{},{},{}",webSocketSet.size(),myMap.size(),TimerData.bayonetMap.size()); + } + @OnMessage + public void onMessage(String message) + { +// log.error("接收数据:{}",message); + if(UtilValidate.isEmpty(this.session) || this.session.isOpen()==false){return;} + if(UtilValidate.isNotEmpty(message)) + { + ReturnVO returnVO=gson.fromJson(message,ReturnVO.class); + if(UtilValidate.isNotEmpty(returnVO) && returnVO.getCode().intValue()==ErrEnum.OK.getCode() && returnVO.getCmd().equals(SocketEnum.BAYONET.getCode())) + { + if(UtilValidate.isNotEmpty(returnVO.getData())) + { + Map myMap=gson.fromJson(gson.toJson(returnVO.getData()),Map.class); + if(UtilValidate.isNotEmpty(myMap) && myMap.containsKey("carmeraId")) + { + TimerData.bayonetMap.put(this.session.getId(), new BayonetVO(-1L,myMap.get("carmeraId"))); +// log.error("更换摄像头:{}",TimerData.bayonetMap.get(this.session.getId())); + } + } + } + } +// log.info("【websocket消息】收到客户端消息:{}",message); + } + + + /** + * 给指定id用户推送信息 + * @param message + */ + public void sendMessage(String id,String message) + { + for(WebSocketContral websocket:webSocketSet) + { + if(websocket.session.getId().equals(id)) + { +// log.info("【websocket消息】给ID={}发送消息,message={}",id,message); + sessionSendMsg(websocket.session,message); + break; + } + + } + } + /** + * 群发消息调用 + * @param message + */ + public void sendMessage(String message) + { + for(WebSocketContral websocket:webSocketSet) + { +// log.info("【websocket消息】广播消息,message={}",message); + sessionSendMsg(websocket.session,message); + } + } + + /** + * 发送消息 + * @param session + * @param message + */ + private void sessionSendMsg(Session session,String message) + { + try { + session.getBasicRemote().sendText(message); + } catch (Exception e) { + log.error("socket发送消息错误:"+e.getMessage()); + } + } + + +} diff --git a/face-task/src/main/java/com/dkha/task/service/impl/ApiDeelServiceImpl.java b/face-task/src/main/java/com/dkha/task/service/impl/ApiDeelServiceImpl.java new file mode 100644 index 0000000..a42932e --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/service/impl/ApiDeelServiceImpl.java @@ -0,0 +1,302 @@ +package com.dkha.task.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.dkha.common.enums.ApiUrlEnum; +import com.dkha.common.fileupload.MinioUtil; +import com.dkha.common.http.HttpUtil; +import com.dkha.common.modules.vo.ReturnVO; +import com.dkha.common.modules.vo.camera.BayOnetCameraVO; +import com.dkha.common.modules.vo.camera.PeopleVO; +import com.dkha.common.modules.vo.dto.FaceLibraryVO; +import com.dkha.common.modules.vo.face.*; +import com.dkha.common.modules.vo.warning.BayoneReturnListVO; +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import com.dkha.common.util.*; +import com.dkha.task.comm.TimerData; +import com.dkha.task.service.ApiDeelService; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: ApiDeelServiceImpl + * @Package com.dkha.task.service.impl + * @author: panhui + * @date: 2020/1/9 17:02 + * @Copyright: 成都电科慧安 + */ +@Component +@Slf4j +public class ApiDeelServiceImpl implements ApiDeelService { + + @Value("${api.server.prefix}") + private String link; + + @Autowired + private HttpUtil httpUtil; + + @Autowired + private Gson gson; + + @Override + public FaceLibraryVO addLib(FaceLibraryVO faceLibraryVO) { + try { + log.info("参数:==============================: " + faceLibraryVO.toString() +" json " + JSONObject.toJSONString(faceLibraryVO)); + ReturnVO faceLibrary1 = (ReturnVO) httpUtil.post(link + ApiUrlEnum.FACELIB_POSTURL.getUrl(), faceLibraryVO, ReturnVO.class); + /**调用API*/ + String json = gson.toJson(faceLibrary1.getData()); + return gson.fromJson(json, FaceLibraryVO.class); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + @Value("${face.bayonet-url}") + private String bayonetUrl; + + + @Autowired + private RedisUtils redisUtils; + + + @Autowired + private MinioUtil minioUtil; + + @Value("${face.minScore}") + private Double minScore; + + @Value("${face.maxRetNb}") + private Integer maxRetNb; + + /** + * 轨迹中人脸比对和数据存储 + * + * @param cameraId 摄像头id + * @param time 时间 + * @param bayonetNum 检索的数据 + * @param libId 关联人脸库的id + * @return + */ + @Override + public void getApi(String cameraId, String time, Long bayonetNum, String libId) { + +// bayonetNum +// log.error("bayonetNum:{}=={}",bayonetNum,libId); + AtomicReference nowNum = new AtomicReference<>(bayonetNum.longValue()); + //先求总数,判断总数 + String apiUrl = bayonetUrl + "/" + cameraId + "/" + 1; + BayoneReturnListVO bayoneReturnListVO = getRecord(apiUrl); + if (UtilValidate.isEmpty(bayoneReturnListVO)) { + return; + } + //判断数据是否系统能处理的数量 + Long resNum = bayoneReturnListVO.getToDaySnapShot() - bayonetNum; + if (resNum.intValue() == 0) { + return; + } + //如果条数大于50 就分批次处理。每次最大处理50/100根据系统情况来定 + if (resNum.intValue() <= TimerData.SYSTEM_DEEL_NUM.intValue()) { + //进行数据处理然后设置redis中的数量为今日数量 + String apiIfUrl = bayonetUrl + "/" + cameraId + "/" + resNum; + BayoneReturnListVO newBayone = getRecord(apiIfUrl); + if (UtilValidate.isEmpty(newBayone)) { + //如果异常可能会一直操作这几个数据,正常情况不会发生 下面如果异常就会自动跳过当前数据 +// setNum(time,cameraId,bayoneReturnListVO.getToDaySnapShot()); 暂时不需要 + return; + } + List myRecords = gson.fromJson(gson.toJson(newBayone.getResult()), new TypeToken>() { + }.getType()); + if (UtilValidate.isEmpty(myRecords)) { + return; + } + myRecords.forEach(e -> + { + nowNum.set(nowNum.get() + 1); + //当前人脸的数据 + if (e.getFaces().size() > 0) { + //需要绑定的人物基本信息 + PeopleVO peopleVO = new PeopleVO(); + peopleVO.setBgUrl(e.getFaceBgUrl()); + peopleVO.setEsId(e.getAlarmId()); + peopleVO.setTimestamp(TimeUtil.exchangeTime(e.getDate())); + peopleVO.setCameraId(cameraId); + ApiFaceVO apiFaceVO = e.getFaces().get(0); + peopleVO.setPosition(apiFaceVO.getFaceRect()); + peopleVO.setFeatureVO(apiFaceVO.getFeature()); + peopleVO.setTime(e.getDate()); + try { + try { + BufferedImage bufferedImage = Base64ImageUtils.urlToBufferImage(new URL(e.getFaceBgUrl())); + InputStream inputStream = Base64ImageUtils.encodeHeadImage(bufferedImage, apiFaceVO.getFaceRect()); + String fileName = "camera/" + this.generateFileName(e.getFaceBgUrl()); + JSONObject map = minioUtil.uploadFile(inputStream, fileName, null); + if (!map.getString("flag").equals("0")) { + return; + } + peopleVO.setFaceUrl(map.get("url").toString()); + }catch (Exception ex){ + return; + } + //将人脸的数据进行入库比对和数据redis绑定 +// { "url":"http://10.51.10.201:88/mytest/1.jpg", "libraryIds": [ "1210094601505505282" ], "minScore": 0.9 , "page": {"pageSize":1} } + //获取所有摄像头库的列表 + ApiFaceSearchVO apiFaceSearchVO = new ApiFaceSearchVO(); + apiFaceSearchVO.setUrl(peopleVO.getFaceUrl()); + apiFaceSearchVO.setLibraryIds(Arrays.asList(libId)); + apiFaceSearchVO.setMinScore(minScore); + PageVO pageVO = new PageVO(); + pageVO.setPageSize(1); + apiFaceSearchVO.setPageVO(pageVO); +// log.error("检索参数:{}",gson.toJson(apiFaceSearchVO)); + String json = UrlUtil.postApiData(link + ApiUrlEnum.FACE_SEARCH_LIB.getUrl(), apiFaceSearchVO, httpUtil, gson); + if (UtilValidate.isEmpty(json)) { + return; + } +// log.error("检索结果:{}",json); + ApiFaceSearchReturnVO apiFaceSearchReturnVO = gson.fromJson(json, ApiFaceSearchReturnVO.class); + if (UtilValidate.isEmpty(apiFaceSearchReturnVO) || UtilValidate.isEmpty(apiFaceSearchReturnVO.getFaces())) { + return; + } + //表示没有比分需要将人脸数据进行入库 + if (UtilValidate.isEmpty(apiFaceSearchReturnVO.getFaces().get(0).getFaceList())) { + //创建人脸到当前库中,同时绑定数据 + ImagesVO imageVO = new ImagesVO(); + imageVO.setUrl(peopleVO.getFaceUrl()); + imageVO.setLibraryId(libId); +// log.error("入库参数{}",gson.toJson(imageVO)); + String addJson = UrlUtil.postApiData(link + ApiUrlEnum.FACE_POSTURL.getUrl(), imageVO, httpUtil, gson); + if (UtilValidate.isEmpty(addJson)) { + return; + } + ImageReturnVO imageReturnVO = gson.fromJson(addJson, ImageReturnVO.class); +// log.error("添加库返回的数据"+addJson); + peopleVO.setFaceId(imageReturnVO.getFaceId()); //入库成功后设置faceid +// {"faceId":"1216603167224016897","libraryId":"1216584625997000705","faceRect":{"x":0,"y":0,"w":76,"h":100},"face":{"url":"http://10.51.10.201:9001/middleware/20200113/camera/1578895730480-2.jpg","faceUrl":"http://10.51.10.201:9001/middleware/173/ef7ec4b8b0214a7b9fe3648d3808982e.jpg"}} + } else { + //比中返回数据的id + peopleVO.setFaceId(apiFaceSearchReturnVO.getFaces().get(0).getFaceList().get(0).getFaceId()); + peopleVO.setScore(apiFaceSearchReturnVO.getFaces().get(0).getFaceList().get(0).getHitSimilarity()); + //将库中的id和数据进行绑定 +// log.error("已经在库里面{}",apiFaceSearchReturnVO.getFaces().get(0).getFaceList().get(0).getFaceId()); + } + dataBing(time, cameraId, peopleVO); + //如果在库中则绑定到redis中 + //不在库里面则新创建一个绑定的人物信息 + //检索库然后分组库 + } catch (Exception e1) { + e1.printStackTrace(); + return; + } + try { + Thread.sleep(50); + } catch (InterruptedException e1) { + e1.printStackTrace(); + } + } + setNum(time, cameraId, nowNum.get()); + }); + //对数据条数进行赋值 +// bayoneReturnListVO.getToDaySnapShot() + } + setNum(time, cameraId, bayoneReturnListVO.getToDaySnapShot()); + } + + + /** + * 对数据进行绑定 + * + * @param time + * @param cameraId + * @param peopleVO + */ + private void dataBing(String time, String cameraId, PeopleVO peopleVO) { +// log.error("绑定数据的时候{}",gson.toJson(peopleVO)); + if (redisUtils.exists(RedisKeys.getCameraByTrack(time, cameraId))) { + BayOnetCameraVO bayOnetCameraVO = gson.fromJson(redisUtils.get(RedisKeys.getCameraByTrack(time, cameraId)).toString(), BayOnetCameraVO.class); + List myList = new ArrayList<>(); + if (redisUtils.exists(RedisKeys.getCameraByFaceId(time, cameraId, peopleVO.getFaceId()))) { + List peopleVOList = gson.fromJson(redisUtils.get(RedisKeys.getCameraByFaceId(time, cameraId, peopleVO.getFaceId())).toString(), new TypeToken>() { + }.getType()); + myList.addAll(peopleVOList); + } + else + { +//// 将数据绑定在里面 + +// if(UtilValidate.isEmpty(bayOnetCameraVO.getPeopleVO())) +// { +// bayOnetCameraVO.setPeopleVO(peopleVO); +// } + bayOnetCameraVO.getFeatIds().add(peopleVO.getFaceId()); + redisUtils.set(RedisKeys.getCameraByTrack(time, cameraId),gson.toJson(bayOnetCameraVO)); + } + myList.add(peopleVO); + redisUtils.set(RedisKeys.getCameraByFaceId(time, cameraId, peopleVO.getFaceId()), myList); + } + } + + /** + * 生成唯一文件名 + * + * @param originFileName + * @return + */ + private String generateFileName(String originFileName) { + // todo 迁移到资源文件中 + //当前时间 + long timeMillis = System.currentTimeMillis(); + int shortUUID = IntUUID.getShortUUID(); + String[] originalFileNameCompose = originFileName.split("\\."); + //获取原文件后缀 + String originalFileNameSuffix = originalFileNameCompose[originalFileNameCompose.length - 1]; + return timeMillis + "-" + shortUUID + "." + originalFileNameSuffix; + } + + /** + * 设置redis的num + * + * @param time + * @param cameraId + * @param deelNum + */ + private void setNum(String time, String cameraId, Long deelNum) { + if (redisUtils.exists(RedisKeys.getCameraByTrack(time, cameraId))) { + BayOnetCameraVO bayOnetCameraVO = gson.fromJson(redisUtils.get(RedisKeys.getCameraByTrack(time, cameraId)).toString(), BayOnetCameraVO.class); + bayOnetCameraVO.setWarningNum(deelNum); + redisUtils.set(RedisKeys.getCameraByTrack(time, cameraId), gson.toJson(bayOnetCameraVO)); + } + } + + + private BayoneReturnListVO getRecord(String url) { + String jsonData = UrlUtil.getData(url, httpUtil, gson); + if (UtilValidate.isEmpty(jsonData)) { + return null; + } + if (UtilValidate.isNotEmpty(jsonData)) { +// //如果本次数据异常就暂时不继续处理了 + try { + return gson.fromJson(jsonData, BayoneReturnListVO.class); + } catch (Exception ex) { + return null; + } + } + return null; + } +} diff --git a/face-task/src/main/java/com/dkha/task/service/impl/AsyncServiceImpl.java b/face-task/src/main/java/com/dkha/task/service/impl/AsyncServiceImpl.java new file mode 100644 index 0000000..37f3079 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/service/impl/AsyncServiceImpl.java @@ -0,0 +1,190 @@ +package com.dkha.task.service.impl; + +import com.dkha.common.modules.vo.camera.BayOnetCameraVO; +import com.dkha.common.modules.vo.camera.PeopleVO; +import com.dkha.common.modules.vo.face.ApiAlarmVO; +import com.dkha.common.redis.RedisKeys; +import com.dkha.common.redis.RedisUtils; +import com.dkha.common.util.TimeUtil; +import com.dkha.common.util.UtilValidate; +import com.dkha.task.comm.TimerData; +import com.dkha.task.modual.entity.FaceTrackEntity; +import com.dkha.task.service.ApiDeelService; +import com.dkha.task.service.FaceTrackService; +import com.dkha.task.service.WebSocketContral; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.redis.core.TimeoutUtils; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: AsyncContral + * @Package com.dkha.task.contral + * @author: panhui + * @date: 2020/1/3 17:34 + * @Copyright: 成都电科慧安 + */ +@Component +@Slf4j +public class AsyncServiceImpl { + + + @Autowired + private WebSocketContral webSocketContral; + + /** + * 卡口信息 + * + * @return + */ +// @Async 多綫程抛出異常 + public void bayonetInfo(String a, String b) { + webSocketContral.sendMessage(a, b); +// System.out.println(a+"-----"+b); +// try { +// Thread.sleep(10000); +// }catch (Exception e){} +// return null; + } + + @Autowired + private Gson gson; + + @Autowired + private RedisUtils redisUtils; + + @Autowired + private ApiDeelService apiDeelService; + + @Autowired + private FaceTrackService faceTrackService; + @Value("${face.minScore}") + private Double minScore; + + /** + * 轨迹分析统计每个摄像头的分组信息 + */ + @Async + public void trackByCamera(String time, String cameraId) { + Long deelNum = 0L; + try { + while (true) { + String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis()); +// log.error("綫程任務{},{},{}",nowTime,time,cameraId); + if (!nowTime.equals(time)) { + //后续将redis里面的数据存到数据库做多时间的轨迹分析 + if (redisUtils.exists(RedisKeys.getCameraByTrack(time, cameraId))) { + BayOnetCameraVO bayOnetCameraVO = gson.fromJson(redisUtils.get(RedisKeys.getCameraByTrack(time, cameraId)).toString(), BayOnetCameraVO.class); + try { + List myList = new ArrayList<>(); + for (String faceId : bayOnetCameraVO.getFeatIds()) { + if (redisUtils.exists(RedisKeys.getCameraByFaceId(time, cameraId, faceId))) { + List peopleVOList = gson.fromJson(redisUtils.get(RedisKeys.getCameraByFaceId(time, cameraId, faceId)).toString(), new TypeToken>() { + }.getType()); + if (UtilValidate.isNotEmpty(peopleVOList)) { + FaceTrackEntity faceTrackEntity = new FaceTrackEntity(); + faceTrackEntity.setIdPortrait(new Long(faceId)); + faceTrackEntity.setIdFaceCamera(new Long(bayOnetCameraVO.getCameraId())); + faceTrackEntity.setIdFactory(new Long(bayOnetCameraVO.getAssociationLibraryId())); + faceTrackEntity.setCharacterData(gson.toJson(peopleVOList.get(0))); + faceTrackEntity.setLinkedData(gson.toJson(peopleVOList)); + faceTrackEntity.setPacketTime(time); + faceTrackEntity.setTrajectoryThreshold(minScore); + myList.add(faceTrackEntity); + } + } + } + if (UtilValidate.isNotEmpty(myList)) { + faceTrackService.saveBatch(myList); + } + }catch (Exception e){} + deelLastDayTask(time, cameraId, bayOnetCameraVO); + } else { + deelTaskState(time, cameraId, deelNum); + } + //后续可以增加一个任务根据将数据库中本月的人物的数据进行人物关联 + //清理掉没用的记录 + break; + } + //使用过期时间来做是否异常检验,因为可能会遇到这边还没处理结束,定时器那边认为当前方法结束的情况 + //30秒过期 + if (!redisUtils.exists(RedisKeys.getCameraByExpired(time, cameraId))) { + redisUtils.set(RedisKeys.getCameraByExpired(time, cameraId), "运行", TimerData.expireTime); + } else { + redisUtils.expire(RedisKeys.getCameraByExpired(time, cameraId), TimerData.expireTime); + } + //检索当前摄像头下所有预警的信息,处理的数据数量存入redis中防止程序重启后又要重新操作了 +// System.out.println("xxxxxxxxxxxx::"+redisUtils.get(RedisKeys.getCameraByTrack(time, cameraId)).toString()); + if(redisUtils.exists(RedisKeys.getCameraByTrack(time, cameraId))) + { + BayOnetCameraVO bayOnetCameraVO = gson.fromJson(redisUtils.get(RedisKeys.getCameraByTrack(time, cameraId)).toString(), BayOnetCameraVO.class); + deelNum = bayOnetCameraVO.getWarningNum(); + apiDeelService.getApi(cameraId, time, deelNum, bayOnetCameraVO.getAssociationLibraryId()); + } + try { + Thread.sleep(4000); + } catch (InterruptedException e) { + } + } + } catch (Exception e) { + deelTaskState(time, cameraId, deelNum); + } + } + + /** + * 时间过期清理多余的redis数据 + * + * @param time + * @param cameraId + * @param bayOnetCameraVO + */ + private void deelLastDayTask(String time, String cameraId, BayOnetCameraVO bayOnetCameraVO) { + try { + log.error("清理数据{},{}",time,cameraId); + if(UtilValidate.isNotEmpty(bayOnetCameraVO.getFeatIds())) + { + bayOnetCameraVO.getFeatIds().forEach(e -> + { + if (redisUtils.exists(RedisKeys.getCameraByFaceId(time, cameraId, e))) { + redisUtils.delete(RedisKeys.getCameraByFaceId(time, cameraId, e)); + } + }); + } + if (redisUtils.exists(RedisKeys.getCameraByTrack(time, cameraId))) { + redisUtils.delete(RedisKeys.getCameraByTrack(time, cameraId)); + } + } catch (Exception e) { + log.error("删除redis中过期数据异常{}", e.getMessage()); + } + } + + /** + * 处理任务状态和当前检测数量 + * + * @param time + * @param cameraId + * @param deelNum + */ + private void deelTaskState(String time, String cameraId, Long deelNum) { + if (redisUtils.exists(RedisKeys.getCameraByTrack(time, cameraId))) { + BayOnetCameraVO bayOnetCameraVO = gson.fromJson(redisUtils.get(RedisKeys.getCameraByTrack(time, cameraId)).toString(), BayOnetCameraVO.class); + bayOnetCameraVO.setWarningNum(deelNum); + redisUtils.set(RedisKeys.getCameraByTrack(time, cameraId), gson.toJson(bayOnetCameraVO)); + } + if (redisUtils.exists(RedisKeys.getCameraByExpired(time, cameraId))) { + redisUtils.delete(RedisKeys.getCameraByExpired(time, cameraId)); + } + } +} diff --git a/face-task/src/main/java/com/dkha/task/service/impl/ControlBayonetMidServiceImpl.java b/face-task/src/main/java/com/dkha/task/service/impl/ControlBayonetMidServiceImpl.java new file mode 100644 index 0000000..2dd2b19 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/service/impl/ControlBayonetMidServiceImpl.java @@ -0,0 +1,67 @@ +package com.dkha.task.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dkha.common.modules.vo.camera.CameraInfoVO; +import com.dkha.task.modual.entity.ControlBayonetMid; +import com.dkha.task.modual.entity.FaceCamera; +import com.dkha.task.modual.mapper.ControlBayonetMidMapper; +import com.dkha.task.service.IControlBayonetMidService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 布控和摄像头中间表 服务实现类 + *

+ * + * @author Spring + * @since 2019-12-09 + */ +@Service +public class ControlBayonetMidServiceImpl extends ServiceImpl implements IControlBayonetMidService { + + @Autowired + ControlBayonetMidMapper controlBayonetMidMapper; + + @Override + public Integer deletetaskandcarmerbytaskid(String taskID) { + return controlBayonetMidMapper.deletetaskandcarmerbytaskid(taskID); + } + + @Override + public long selectexistByCarmeID(String idcamera) { + long rs = controlBayonetMidMapper.selectexistByCarmeID(idcamera); + return rs; + } + + @Override + public Integer updateCarmerValidaStateByTaskID(String taskID, String State, String UpdateBy) { + return controlBayonetMidMapper.updateCarmerValidaStateByTaskID(taskID, State, UpdateBy); + } + + @Override + public List selectFaceCameraBytaskID(String taskid) { + return controlBayonetMidMapper.selectFaceCameraBytaskID(taskid); + } + + @Override + public List selectCameraByTask() { + return controlBayonetMidMapper.selectFaceCameraBytask(); + } + + @Override + public ControlBayonetMid selectFaceCameraByTime() { + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("is_valid", "Y").orderByDesc("create_time").last("limit 1"); + return controlBayonetMidMapper.selectOne(queryWrapper); + } + + @Override + public int getControlByRegion(long regionId) { + return controlBayonetMidMapper.getControlByRegion(regionId); + } +} diff --git a/face-task/src/main/java/com/dkha/task/service/impl/FaceTrackServiceImpl.java b/face-task/src/main/java/com/dkha/task/service/impl/FaceTrackServiceImpl.java new file mode 100644 index 0000000..3733575 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/service/impl/FaceTrackServiceImpl.java @@ -0,0 +1,71 @@ +package com.dkha.task.service.impl; + + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dkha.common.exception.DkException; +import com.dkha.task.modual.entity.FaceTrackEntity; +import com.dkha.task.modual.mapper.FaceTrackMapper; +import com.dkha.task.modual.vo.FaceTrackVO; +import com.dkha.task.service.FaceTrackService; + + +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + + +/** + * + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2020-01-10 + */ +@Service +public class FaceTrackServiceImpl extends ServiceImpl implements FaceTrackService { + + @Resource + private FaceTrackMapper faceTrackMapper; + @Override + public int addFaceTrackEntity(FaceTrackEntity faceTrackEntity) { + int count; + try{ + count = faceTrackMapper.insert(faceTrackEntity); + }catch (Exception e){ + throw new DkException("新增失败"); + } + return count; + } + + /** + *根据摄像头和分组时间查询 + * @param idFaceCamera + * @param packetTime + * @return + */ + @Override + public List querByidCameraAndTime(Long idFaceCamera, String packetTime) { + return faceTrackMapper.querByidCameraAndTime(idFaceCamera,packetTime); + } + + /** + *根据摄像头Id和开始,结束时间,人脸ID + * @param faceTrackVO + * @return + */ + @Override + public List queryByidCamerAndFaceId(FaceTrackVO faceTrackVO) { + return faceTrackMapper.queryByidCamerAndFaceId(faceTrackVO); + } + + /** + *根据图片路径和开始,结束时间 + * @param faceTrackVO + * @return + */ + @Override + public List queryByurlAndTime(FaceTrackVO faceTrackVO) { + return faceTrackMapper.queryByurlAndTime(faceTrackVO); + } +} \ No newline at end of file diff --git a/face-task/src/main/java/com/dkha/task/util/PeopleComparableUitl.java b/face-task/src/main/java/com/dkha/task/util/PeopleComparableUitl.java new file mode 100644 index 0000000..448e4f4 --- /dev/null +++ b/face-task/src/main/java/com/dkha/task/util/PeopleComparableUitl.java @@ -0,0 +1,43 @@ +package com.dkha.task.util; + +import com.dkha.common.modules.vo.camera.PeopleVO; +import com.dkha.common.modules.vo.face.FeatureVO; +import com.dkha.common.modules.vo.position.PositionVO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @version V1.0 + * @Description: TODO(please write your description) + * All rights 成都电科慧安 + * @Title: PeopleComparableUitl + * @Package com.dkha.task.util + * @author: panhui + * @date: 2020/1/14 16:09 + * @Copyright: 成都电科慧安 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PeopleComparableUitl implements Comparable{ + private String esId; + private String faceUrl; + private String bgUrl; + private PositionVO position; + private Long timestamp; + private String time; + private Double score; + private FeatureVO featureVO; + private String faceId; + + @Override + public int compareTo(PeopleComparableUitl peopleVO) { + + if(this.timestamp.intValue()!=peopleVO.getTimestamp().intValue()) + { + return (this.timestamp.intValue()-peopleVO.getTimestamp().intValue()); + } + return 0; + } +} diff --git a/face-task/src/main/resources/application-dev.yml b/face-task/src/main/resources/application-dev.yml new file mode 100644 index 0000000..37b665e --- /dev/null +++ b/face-task/src/main/resources/application-dev.yml @@ -0,0 +1,108 @@ +server: + port: 1993 + servlet: + context-path: /task +spring: + datasource: + druid: + #MySQL + driver-class-name: com.mysql.jdbc.Driver + url: jdbc:mysql://192.168.1.127:3306/face_application?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: Dkha123 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 6000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + login-username: admin + login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + redis: + database: 0 + host: 192.168.1.127 + port: 6379 + password: Dkha123 # 密码(默认为空) + timeout: 6000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 + +#mybatis +mybatis-plus: + mapper-locations: classpath:/mybatis/mapper/**/*.xml,classpath:/mappers/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.dkha.server.system.modules + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + # 如果入库为空值,则忽略掉控空值 + insert-strategy: not_empty + update-strategy: not_empty + select-strategy: not_empty + banner: false + #原生配置 + configuration: + #是否开启自动驼峰命名规则(camel case)映射 + map-underscore-to-camel-case: true + #全局地开启或关闭配置文件中的所有映射器已经配置的任何缓存,默认为 true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +# 用于控制swagger是否显示 +swagger: + show: true +face: + warning-url: http://192.168.1.127:8889/face/warning/alarm + bayonet-url: http://192.168.1.127:8889/face/warning/todayBayonetBySize + #用于轨迹中比对最小比中分值 + minScore: 0.8 + #返回一条比中数据即可 + maxRetNb: 1 + +#人脸API统一请求地址定义 +api: + server: + prefix: http://192.168.1.127:8013/dkha/ + #人脸检索最大返回值 + max: + result: 100 + #人脸分组最大支持图片数量 + group: + max: 30 + # 人脸分组最少图片数量 + min: 2 + # 图片支持格式 + picture: + type: (png|jpg|jpeg) + +#minio 配置 +minio: + url: http://192.168.1.127:9000 + accessKey: admin + secretKey: Dkha123. + bucketName: middleware diff --git a/face-task/src/main/resources/application-prod.yml b/face-task/src/main/resources/application-prod.yml new file mode 100644 index 0000000..b8fc51a --- /dev/null +++ b/face-task/src/main/resources/application-prod.yml @@ -0,0 +1,108 @@ +server: + port: 1993 + servlet: + context-path: /task +spring: + datasource: + druid: + #MySQL + driver-class-name: com.mysql.jdbc.Driver + url: jdbc:mysql://192.168.1.127:3306/face_application?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: Dkha123 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 6000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + login-username: admin + login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + redis: + database: 0 + host: 192.168.1.127 + port: 6379 + password: Dkha123 # 密码(默认为空) + timeout: 6000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 + +#mybatis +mybatis-plus: + mapper-locations: classpath:/mybatis/mapper/**/*.xml,classpath:/mappers/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.dkha.server.system.modules + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + # 如果入库为空值,则忽略掉控空值 + insert-strategy: not_empty + update-strategy: not_empty + select-strategy: not_empty + banner: false + #原生配置 + configuration: + #是否开启自动驼峰命名规则(camel case)映射 + map-underscore-to-camel-case: true + #全局地开启或关闭配置文件中的所有映射器已经配置的任何缓存,默认为 true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +# 用于控制swagger是否显示 +swagger: + show: true +face: + warning-url: http://127.0.0.1:8889/face/warning/alarm + bayonet-url: http://127.0.0.1:8889/face/warning/todayBayonetBySize + #用于轨迹中比对最小比中分值 + minScore: 0.8 + #返回一条比中数据即可 + maxRetNb: 1 + +#人脸API统一请求地址定义 +api: + server: + prefix: http://127.0.0.1:8013/dkha/ + #人脸检索最大返回值 + max: + result: 100 + #人脸分组最大支持图片数量 + group: + max: 30 + # 人脸分组最少图片数量 + min: 2 + # 图片支持格式 + picture: + type: (png|jpg|jpeg) + +#minio 配置 +minio: + url: http://192.168.1.127:9000 + accessKey: admin + secretKey: Dkha123. + bucketName: middleware diff --git a/face-task/src/main/resources/application-test.yml b/face-task/src/main/resources/application-test.yml new file mode 100644 index 0000000..5c2c3e1 --- /dev/null +++ b/face-task/src/main/resources/application-test.yml @@ -0,0 +1,108 @@ +server: + port: 1993 + servlet: + context-path: /task +spring: + datasource: + druid: + #MySQL + driver-class-name: com.mysql.jdbc.Driver + url: jdbc:mysql://192.168.1.122:3306/face_application?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: Dkha123 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 6000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + login-username: admin + login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + redis: + database: 0 + host: 192.168.1.122 + port: 6379 + password: Dkha123 # 密码(默认为空) + timeout: 6000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 + +#mybatis +mybatis-plus: + mapper-locations: classpath:/mybatis/mapper/**/*.xml,classpath:/mappers/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.dkha.server.system.modules + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + # 如果入库为空值,则忽略掉控空值 + insert-strategy: not_empty + update-strategy: not_empty + select-strategy: not_empty + banner: false + #原生配置 + configuration: + #是否开启自动驼峰命名规则(camel case)映射 + map-underscore-to-camel-case: true + #全局地开启或关闭配置文件中的所有映射器已经配置的任何缓存,默认为 true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +# 用于控制swagger是否显示 +swagger: + show: true +face: + warning-url: http://192.168.1.122:8889/face/warning/alarm + bayonet-url: http://192.168.1.122:8889/face/warning/todayBayonetBySize + #用于轨迹中比对最小比中分值 + minScore: 0.8 + #返回一条比中数据即可 + maxRetNb: 1 + +#人脸API统一请求地址定义 +api: + server: + prefix: http://192.168.1.122:8013/dkha/ + #人脸检索最大返回值 + max: + result: 100 + #人脸分组最大支持图片数量 + group: + max: 30 + # 人脸分组最少图片数量 + min: 2 + # 图片支持格式 + picture: + type: (png|jpg|jpeg) + +#minio 配置 +minio: + url: http://192.168.1.122:9000 + accessKey: admin + secretKey: Dkha123. + bucketName: middleware diff --git a/face-task/src/main/resources/application.yml b/face-task/src/main/resources/application.yml new file mode 100644 index 0000000..c688559 --- /dev/null +++ b/face-task/src/main/resources/application.yml @@ -0,0 +1,4 @@ +spring: + # 环境 dev|test|prod + profiles: + active: dev diff --git a/face-task/src/main/resources/logback-spring.xml b/face-task/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..5277d76 --- /dev/null +++ b/face-task/src/main/resources/logback-spring.xml @@ -0,0 +1,59 @@ + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + /mnt/appSystems/logs/${app_name}/%d{yyyy-MM, aux}/trace.%d{yyyy-MM-dd}.%i.log + + 500MB + + 10 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + /appSystems/logs/error.%d{yyyy-MM-dd}.%i.log + + /mnt/appSystems/logs/${app_name}/%d{yyyy-MM, aux}/error.%d{yyyy-MM-dd}.%i.log + + 500MB + + 10 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + ERROR + ACCEPT + DENY + + + + + + + + + + + \ No newline at end of file diff --git a/face-task/src/main/resources/mybatis/mapper/ControlBayonetMidMapper.xml b/face-task/src/main/resources/mybatis/mapper/ControlBayonetMidMapper.xml new file mode 100644 index 0000000..1b45829 --- /dev/null +++ b/face-task/src/main/resources/mybatis/mapper/ControlBayonetMidMapper.xml @@ -0,0 +1,33 @@ + + + + + + update control_bayonet_mid set is_valid=#{State},update_time=now(),update_by=#{UpdateBy} where id_control_task=#{taskID} + + + + DELETE FROM control_bayonet_mid WHERE id_control_task =#{taskID} + + + + + + + + diff --git a/face-task/src/main/resources/mybatis/mapper/FaceTrackMapper.xml b/face-task/src/main/resources/mybatis/mapper/FaceTrackMapper.xml new file mode 100644 index 0000000..b87da89 --- /dev/null +++ b/face-task/src/main/resources/mybatis/mapper/FaceTrackMapper.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/face-task/src/main/resources/mybatis/mapper/sys/SysUserTokenDao.xml b/face-task/src/main/resources/mybatis/mapper/sys/SysUserTokenDao.xml new file mode 100644 index 0000000..331f6ab --- /dev/null +++ b/face-task/src/main/resources/mybatis/mapper/sys/SysUserTokenDao.xml @@ -0,0 +1,15 @@ + + + + + + id,user_id,token,expire_date,update_date,create_date + + + + + update sys_user_token set token = #{token} where user_id = #{userId} + + \ No newline at end of file diff --git a/face-task/src/main/resources/mybatis/mybatis.cfg.xml b/face-task/src/main/resources/mybatis/mybatis.cfg.xml new file mode 100644 index 0000000..bcdf41a --- /dev/null +++ b/face-task/src/main/resources/mybatis/mybatis.cfg.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/face-task/src/main/resources/static/images/Ink_Note.ico b/face-task/src/main/resources/static/images/Ink_Note.ico new file mode 100644 index 0000000..c6824f8 Binary files /dev/null and b/face-task/src/main/resources/static/images/Ink_Note.ico differ diff --git a/face-task/src/main/resources/static/images/a64.ico b/face-task/src/main/resources/static/images/a64.ico new file mode 100644 index 0000000..ef9bc39 Binary files /dev/null and b/face-task/src/main/resources/static/images/a64.ico differ diff --git a/face-task/src/main/resources/static/images/bg.png b/face-task/src/main/resources/static/images/bg.png new file mode 100644 index 0000000..d9ae250 Binary files /dev/null and b/face-task/src/main/resources/static/images/bg.png differ diff --git a/face-task/src/main/resources/static/images/bg_blue.png b/face-task/src/main/resources/static/images/bg_blue.png new file mode 100644 index 0000000..d9ae250 Binary files /dev/null and b/face-task/src/main/resources/static/images/bg_blue.png differ diff --git a/face-task/src/main/resources/static/images/bg_green.png b/face-task/src/main/resources/static/images/bg_green.png new file mode 100644 index 0000000..4acb45d Binary files /dev/null and b/face-task/src/main/resources/static/images/bg_green.png differ diff --git a/face-task/src/main/resources/static/images/bg_red.png b/face-task/src/main/resources/static/images/bg_red.png new file mode 100644 index 0000000..253014f Binary files /dev/null and b/face-task/src/main/resources/static/images/bg_red.png differ diff --git a/face-task/src/main/resources/static/images/deskicon.ico b/face-task/src/main/resources/static/images/deskicon.ico new file mode 100644 index 0000000..2ccf37c Binary files /dev/null and b/face-task/src/main/resources/static/images/deskicon.ico differ diff --git a/face-task/src/main/resources/static/images/favicon.ico b/face-task/src/main/resources/static/images/favicon.ico new file mode 100644 index 0000000..fb5aaf3 Binary files /dev/null and b/face-task/src/main/resources/static/images/favicon.ico differ diff --git a/face-task/src/main/resources/static/images/jt.png b/face-task/src/main/resources/static/images/jt.png new file mode 100644 index 0000000..3257616 Binary files /dev/null and b/face-task/src/main/resources/static/images/jt.png differ diff --git a/face-task/src/main/resources/static/images/pulse.ico b/face-task/src/main/resources/static/images/pulse.ico new file mode 100644 index 0000000..20f0ea3 Binary files /dev/null and b/face-task/src/main/resources/static/images/pulse.ico differ diff --git a/face-task/src/main/resources/static/images/ringtones.ico b/face-task/src/main/resources/static/images/ringtones.ico new file mode 100644 index 0000000..dfc5da3 Binary files /dev/null and b/face-task/src/main/resources/static/images/ringtones.ico differ diff --git a/face-task/src/main/resources/static/images/settings.ico b/face-task/src/main/resources/static/images/settings.ico new file mode 100644 index 0000000..77784fc Binary files /dev/null and b/face-task/src/main/resources/static/images/settings.ico differ diff --git a/face-task/src/main/resources/static/index.html b/face-task/src/main/resources/static/index.html new file mode 100644 index 0000000..4a2e3d0 --- /dev/null +++ b/face-task/src/main/resources/static/index.html @@ -0,0 +1,76 @@ + + + + + + + + + + + + + +测试websocket!! + +
V
+ + \ No newline at end of file diff --git a/face-task/src/main/resources/static/index1.html b/face-task/src/main/resources/static/index1.html new file mode 100644 index 0000000..667baf6 --- /dev/null +++ b/face-task/src/main/resources/static/index1.html @@ -0,0 +1,57 @@ + + + + + + + + + + +
+ ~ +
+ + \ No newline at end of file diff --git a/face-task/src/main/resources/static/index2.html b/face-task/src/main/resources/static/index2.html new file mode 100644 index 0000000..a262d5b --- /dev/null +++ b/face-task/src/main/resources/static/index2.html @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + +测试websocket!! +
+
+
+
+
+
+ + +
+ + \ No newline at end of file diff --git a/face-task/src/main/resources/static/index4.html b/face-task/src/main/resources/static/index4.html new file mode 100644 index 0000000..92254b2 --- /dev/null +++ b/face-task/src/main/resources/static/index4.html @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + +测试websocket!! + + + + + + + + + + + +
+
+
+
+
+
+ + +
+ + \ No newline at end of file diff --git a/face-task/src/main/resources/static/indexline.html b/face-task/src/main/resources/static/indexline.html new file mode 100644 index 0000000..0f8a2e6 --- /dev/null +++ b/face-task/src/main/resources/static/indexline.html @@ -0,0 +1,44 @@ + + + + + + + + +ٶȵͼ·; + + +
+ + + + \ No newline at end of file diff --git a/face-task/src/main/resources/static/indexmove.html b/face-task/src/main/resources/static/indexmove.html new file mode 100644 index 0000000..e7f2ce6 --- /dev/null +++ b/face-task/src/main/resources/static/indexmove.html @@ -0,0 +1,66 @@ + + + + + + + +ٶȵͼ·; + + +
+ + + \ No newline at end of file diff --git a/face-task/src/main/resources/static/js/baidu.js b/face-task/src/main/resources/static/js/baidu.js new file mode 100644 index 0000000..ec31bc8 --- /dev/null +++ b/face-task/src/main/resources/static/js/baidu.js @@ -0,0 +1 @@ +var getRandomColor=function(){return(function(a,b,c){return(c?arguments.callee(a,b,c-1):'#')+b[a.floor(a.random()*16)]})(Math,'0123456789abcdef',5)};function showPoly(a){var b=new BMap.Map("allmap");b.centerAndZoom(new BMap.Point(114.253477,30.606323),13);b.enableScrollWheelZoom(true);a=JSON.parse(a);var d=a[0].split(',');for(c=0;cxxxxxxxxx"); +//var str="
"; +var str="
"+$("#msgContent").html()+"
"; +k.setContent(str); +//k. setStyle({ color : "red", fontSize : "12px" }) ; + k.setStyle({ + color: "#000", + border: "0px", + backgroundColor: "0.000000000001", //通过这个方法,去掉背景色 + fontSize: "12px", + height: "20px", + lineHeight: "20px" + }); +k.setTitle("标题"); +k.addEventListener("click", function(){alert(this.getPosition().lng+","+this.getPosition().lat)}); +i.setLabel(k) +}; +var e = Math.floor(a.length / 11); +var f = a.length % 11; +var g = new BMap.DrivingRoute(b, { +onSearchComplete: function(i) { +if (g.getStatus() == BMAP_STATUS_SUCCESS) { +var j = g.getResults().getPlan(0); +var k = j.getNumRoutes(); +for (var l = 0; l < k; l++) { +var m = j.getRoute(l).getPath(); +var n = new BMap.Polyline(m); +var o = getColor(); +n.setStrokeColor(o); +//线的粗细 +n.setStrokeWeight(4); +b.addOverlay(n) +} +} +} +}); +for (var h = 0; h < e; h++) { +var i = a.slice(h * 11 + 1, (h + 1) * 11); +g.search(a[h * 11], a[(h + 1) * 11 - 1], { +waypoints: i +}) +}; +if (f != 0) { +var i = a.slice(e * 11, a.length - 1); +g.search(a[e * 11], a[a.length - 1], { +waypoints: i +}) +} +} \ No newline at end of file diff --git a/face-task/src/main/resources/static/js/jiemi2.js b/face-task/src/main/resources/static/js/jiemi2.js new file mode 100644 index 0000000..b4bce0d --- /dev/null +++ b/face-task/src/main/resources/static/js/jiemi2.js @@ -0,0 +1,90 @@ +var getColor=function(a) +{ + if(a==0) + { + return "red"; + }else + { + return "green"; + } +} +function showPoly(a,b) { + //去掉点击某个点弹出东西 +for (var c = 0; c < a.data.length; c++) { + var adlength=a.data[c].length; + var posistionarr=[]; + for(var c1=0;c1"+task.taskName+"-"+task.cmName+"
"); + k.setStyle({ + color: "red", + border: "0px", + backgroundColor: "0.000000000001", //通过这个方法,去掉背景色 + fontSize: "16px", + height: "20px", + lineHeight: "20px" + }); + k.setTitle("标题"); + k.addEventListener("click", function(){alert(this.getPosition().lng+","+this.getPosition().lat)}); + i.setLabel(k) +} + +//划线 +function lines(posistionarr,b,type) +{ + // var driving2 = new BMap.DrivingRoute(b, {renderOptions:{map: b, autoViewport: true}}); //驾车实例 + // driving2.search(posistionarr[0], posistionarr[1]); //显示一条公交线路 + + if(1==1){ + var e = Math.floor(posistionarr.length / 11); + var f = posistionarr.length % 11; + var g = new BMap.DrivingRoute(b, { + onSearchComplete: function(i) { + if (g.getStatus() == BMAP_STATUS_SUCCESS) { + var j = g.getResults().getPlan(0); + var k = j.getNumRoutes(); + for (var l = 0; l < k; l++) { + var m = j.getRoute(l).getPath(); + var n = new BMap.Polyline(m); + var o = getColor(type); + n.setStrokeColor(o); + //线的粗细 + n.setStrokeWeight(4); + b.addOverlay(n) + } + } + } + }); + for (var h = 0; h < e; h++) { + var i = posistionarr.slice(h * 11 + 1, (h + 1) * 11); + g.search(posistionarr[h * 11], posistionarr[(h + 1) * 11 - 1], { + waypoints: i + }) + }; + if (f != 0) { + var i = posistionarr.slice(e * 11, posistionarr.length - 1); + g.search(posistionarr[e * 11], posistionarr[posistionarr.length - 1], { + waypoints: i + }) + } + } +} \ No newline at end of file diff --git a/face-task/src/main/resources/static/js/jquery-1.6.2.min.js b/face-task/src/main/resources/static/js/jquery-1.6.2.min.js new file mode 100644 index 0000000..ca044d4 --- /dev/null +++ b/face-task/src/main/resources/static/js/jquery-1.6.2.min.js @@ -0,0 +1,18 @@ +/*! + * jQuery JavaScript Library v1.6.2 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Jun 30 14:16:56 2011 -0400 + */ +(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. +shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j +)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/face-task/src/main/resources/static/js/jquery-3.2.1.slim.min.js b/face-task/src/main/resources/static/js/jquery-3.2.1.slim.min.js new file mode 100644 index 0000000..105d00e --- /dev/null +++ b/face-task/src/main/resources/static/js/jquery-3.2.1.slim.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.2.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/Tween,-effects/animatedSelector | (c) JS Foundation and other contributors | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/Tween,-effects/animatedSelector",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a); +}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S),a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}}),r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var _a,ab=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return T(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?_a:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),_a={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ab[b]||r.find.attr;ab[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ab[g],ab[g]=e,e=null!=c(a,b,d)?g:null,ab[g]=f),e}});var bb=/^(?:input|select|textarea|button)$/i,cb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function db(a){var b=a.match(L)||[];return b.join(" ")}function eb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,eb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=eb(c),d=1===c.nodeType&&" "+db(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=db(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,eb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=eb(c),d=1===c.nodeType&&" "+db(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=db(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,eb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=eb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+db(eb(c))+" ").indexOf(b)>-1)return!0;return!1}});var fb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(fb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:db(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var gb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!gb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,gb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var hb=/\[\]$/,ib=/\r?\n/g,jb=/^(?:submit|button|image|reset|file)$/i,kb=/^(?:input|select|textarea|keygen)/i;function lb(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||hb.test(a)?d(a,e):lb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d); +});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)lb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)lb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&kb.test(this.nodeName)&&!jb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ib,"\r\n")}}):{name:b.name,value:c.replace(ib,"\r\n")}}).get()}}),r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="
",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=C.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=qa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),b=f.ownerDocument,c=b.documentElement,e=b.defaultView,{top:d.top+e.pageYOffset-c.clientTop,left:d.left+e.pageXOffset-c.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),B(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||ra})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return T(this,function(a,d,e){var f;return r.isWindow(a)?f=a:9===a.nodeType&&(f=a.defaultView),void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Pa(o.pixelPosition,function(a,c){if(c)return c=Oa(a,b),Ma.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return T(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.holdReady=function(a){a?r.readyWait++:r.ready(!0)},r.isArray=Array.isArray,r.parseJSON=JSON.parse,r.nodeName=B,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var mb=a.jQuery,nb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=nb),b&&a.jQuery===r&&(a.jQuery=mb),r},b||(a.jQuery=a.$=r),r}); diff --git a/face-task/src/main/resources/static/js/yj.js b/face-task/src/main/resources/static/js/yj.js new file mode 100644 index 0000000..e473ce5 --- /dev/null +++ b/face-task/src/main/resources/static/js/yj.js @@ -0,0 +1,136 @@ +var getColor = function () { + return "green"; +} +var b; +var marker = new Map(); +var lable = new Map(); + +function showPoly(a1, b1) { + //去掉点击某个点弹出东西 + b = new BMap.Map("allmap", {enableMapClick: false}); + // {"cameraID":"1211828133370216450","cameraName":"创新中心北","lng":"103.907065","lat":"30.701563"} + b.centerAndZoom(new BMap.Point(a1[0].lng, a1[0].lat), b1); + b.enableScrollWheelZoom(true); + for (var c = 0; c < a1.length; c++) { + var i = new BMap.Marker(new BMap.Point(a1[c].lng, a1[c].lat)); + //i.setTitle(a1[c].cameraName); + var k = new BMap.Label("arms", { + //距离点的左右位置和上下位置 + offset: new BMap.Size(0, 28) + }); + k.setStyle({ + color: "white", + border: "0px", + // backgroundColor: "0.000000000001", //通过这个方法,去掉背景色 + backgroundColor: "#9DB7F2", //通过这个方法,去掉背景色 + fontSize: "12px", + height: "20px", + // border:"1px solid black", + lineHeight: "20px" + }); + k.setContent("  "+a1[c].cameraName+"  "); + b.addOverlay(i); + i.setLabel(k); + // i.addEventListener("mouseover", function () { + // this.setLabel(k); + // }); + // i.addEventListener("mouseout",function () { + // if(k!=undefined) + // { + // this.getMap().removeOverlay(k); + // } + // }); + marker.set(a1[c].cameraID, i); + } +} + +function showArm(jsonval) { + marker.get(jsonval.data.cameraId).getMap().removeOverlay(lable.get(jsonval.data.cameraId)); + // var randomWidthNum=Math.floor(Math.random()*50+1); + // var randomHeightNum=Math.floor(Math.random()*50+1); + var randomWidthNum=0; + var randomHeightNum=0; + var k = new BMap.Label("arms" + jsonval.data.cameraId, { + //距离点的左右位置和上下位置 + offset: new BMap.Size(-105-randomWidthNum, -115+randomHeightNum) + }); + var str = "
\n" + + "
\n" + + // "
" + + "
" + + // ""+ + " " + + "
\n" + + "
\n" + + "
\n" + + " 姓   名:" + jsonval.data.name + "\n" + + "
\n" + + "
\n" + + " 性   别:" + jsonval.data.sex + "\n" + + "
\n" + + "
\n" + + " 人像库:" + jsonval.data.libName + "\n" + + "
\n" + + "
\n" + + " 比   分:" + jsonval.data.score + "\n" + + "
\n" + + "
\n" + + " 时  间:" + jsonval.data.time + "\n" + + "
" + + "
\n" + + "
"; + k.setContent(str); + k.setStyle({ + color: "#000", + border: "0px", + backgroundColor: "0.000000000001", //通过这个方法,去掉背景色 + fontSize: "12px", + height: "20px", + lineHeight: "20px" + }); + k.addEventListener("click", function () { + alert("详细数据展示一个窗体:" + this.getPosition().lng + "," + this.getPosition().lat) + }); + marker.get(jsonval.data.cameraId).setLabel(k); + lable.set(jsonval.data.cameraId, k); + var i = 0; + var canvas= document.getElementById("imgicon"+jsonval.data.cameraId); + var cxt = canvas.getContext("2d"); + cxt.clearRect(0,0,120,120); + // //绘制图片 + var img = new Image(); + img.src = jsonval.data.bgImg; + img.onload = function() { + cxt.drawImage(img,jsonval.data.positionVO.x,jsonval.data.positionVO.y,jsonval.data.positionVO.w,jsonval.data.positionVO.h,0,0,120,120); + } + var timer = setInterval(function () { + document.getElementById("notice").play(); + if (i % 2 == 0) { + $("#msgContent" + jsonval.data.cameraId).removeClass("msg_bg_blue"); + $("#msgContent" + jsonval.data.cameraId).addClass("msg_bg_red"); + } else { + $("#msgContent" + jsonval.data.cameraId).removeClass("msg_bg_red"); + $("#msgContent" + jsonval.data.cameraId).addClass("msg_bg_blue"); + } + if (i > 10) { + $("#msgContent" + jsonval.data.cameraId).removeClass("msg_bg_red", "msg_bg_blue"); + clearInterval(timer); + } + i++; + }, 500) + + // alert("#msgContent"+jsonval.data.cameraId); + // $("#msgContent"+jsonval.data.cameraId).show() + // // var json={"code":200,"message":"成功","cmd":"WARNING","data":{"bgImg":"http://10.51.10.203:32080/g10203/M00/40/C1/CjMKy14ULjyADahlAAEjVYElPnw887.jpg","positionVO":{"x":199,"y":209,"w":25,"h":34},"score":0.81317765,"time":"2020-01-07 15:07:48","faceUrl":"http://10.51.10.201:9001/middleware/20191227/787a39d0ee114a68b627812153222bcd.jpg","name":"7","sex":"男","idCard":"150981198409254695","age":35,"taskId":"1211831416948211713","taskName":"小会议室走廊","taskType":"3","libName":"10000人像库","libId":"1210121197004161026"}}; + // if(jsonval.code==200) + // { + // $("#msgContent"+jsonval.data.cameraId).show(); + // $("#msgContent_img1"+jsonval.data.cameraId).attr("src",jsonval.data.bgImg); + // $("#msgContent_img2"+jsonval.data.cameraId).attr("src",jsonval.data.faceUrl); + // $("#msgContent_name"+jsonval.data.cameraId).html(jsonval.data.name); + // $("#msgContent_sex"+jsonval.data.cameraId).html(jsonval.data.sex); + // $("#msgContent_lib"+jsonval.data.cameraId).html(jsonval.data.libName); + // $("#msgContent_time"+jsonval.data.cameraId).html(jsonval.data.time); + // + // } +} \ No newline at end of file diff --git a/face-task/src/main/resources/static/map.html b/face-task/src/main/resources/static/map.html new file mode 100644 index 0000000..9c84444 --- /dev/null +++ b/face-task/src/main/resources/static/map.html @@ -0,0 +1,222 @@ + + + + + + + + + + 百度地图路线途经点 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + \ No newline at end of file diff --git a/face-task/src/main/resources/static/mp3/song.mp3 b/face-task/src/main/resources/static/mp3/song.mp3 new file mode 100644 index 0000000..e69de29 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..2127140 --- /dev/null +++ b/pom.xml @@ -0,0 +1,245 @@ + + + 4.0.0 + + com.dkha + face-application + pom + 1.0-SNAPSHOT + + face-common + face-server + face-snapShot + face-task + + + + org.springframework.boot + spring-boot-starter-parent + 2.1.4.RELEASE + + + + + 2.7.0 + 3.1.2 + 3.1.2 + 5.1.38 + 1.18.4 + 1.1.10 + 2.9.0 + 1.2.45 + 3.5 + 6.0.8 + 1.3.5 + 4.1.34.Final + Greenwich.SR1 + 3.2.0 + 2.6 + 3.1.0 + 0.0.9 + 1.2.1 + 2.2.2 + 3.2.0 + 1.2.8.RELEASE + 1.4.0 + 1.11.3 + 2.6 + 1.9.1 + 20.0 + 1.9.1 + 2.0.1.Final + 6.1.0.Final + 2.6 + 3.9 + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${cloud-version} + pom + import + + + + commons-lang + commons-lang + ${commons-lang.version} + + + + + io.springfox + springfox-swagger2 + ${swagger.version} + + + io.springfox + springfox-swagger-ui + ${swagger.version} + + + + javax.validation + validation-api + ${javax-validation.version} + + + + org.hibernate + hibernate-validator + + + + org.projectlombok + lombok + ${lombok.version} + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + redis.clients + jedis + ${jedis.version} + + + com.alibaba + fastjson + ${fastjson.version} + + + org.apache.commons + commons-lang3 + ${commons.lang.version} + + + io.minio + minio + ${minio.version} + + + com.auth0 + java-jwt + ${jwt-version} + + + cn.afterturn + easypoi-base + ${easypoi.version} + + + cn.afterturn + easypoi-web + ${easypoi.version} + + + cn.afterturn + easypoi-annotation + ${easypoi.version} + + + + com.github.axet + kaptcha + ${kaptcha.version} + + + com.baomidou + mybatis-plus-generator + ${mybatisplusgenerator.version} + + + com.baomidou + mybatis-plus-boot-starter + ${mybatisplus.version} + + + com.ecwid.consul + consul-api + ${version.consul-api} + + + + net.sf.json-lib + json-lib + ${net.sf.json-lib.version} + jdk15 + + + com.auth0 + java-jwt + ${jwt-version} + + + org.springframework + springloaded + ${springloaded.version} + + + org.apache.shiro + shiro-core + ${shiro.version} + + + org.apache.shiro + shiro-spring + ${shiro.version} + + + org.jsoup + jsoup + ${jsoup.version} + + + commons-io + commons-io + ${commons-io-version} + + + org.aspectj + aspectjrt + ${aspectjrt.version} + + + io.netty + netty-all + ${netty.version} + + + com.google.guava + guava + ${guava.version} + + + org.aspectj + aspectjrt + ${aspectj.version} + + + + org.apache.poi + poi + ${poi.version} + + + org.apache.poi + poi-ooxml + ${poi.version} + + + org.apache.poi + poi-ooxml-schemas + ${poi.version} + + + + \ No newline at end of file