Thiết kế mô đun quản lý đăng kí tài khoản công dân, doanh nghiệp, tổ chức - VietOpenCPS/doc GitHub Wiki

Thiết kế backend

Danh sách các hàm trong backend

Thiết kế chi tiết có thể download tại đây

Thêm mới tài khoản công dân

addCitizen(String fullName, String personalId, int gender, Date birthdate, String address, String cityCode, String districtCode, String wardCode, String telNo, String email, long attachFile).

Cập nhật tài khoản công dân không yêu cầu mật khẩu cũ - áp dụng cho quản trị

updateCitizen(long citizenId, String address, String cityCode, String districtCode, String wardCode, String telNo, String newPassword, String reTypePassword)

Cập nhật tài khoản công dân

updateCitizen(long citizenId, String address, String cityCode, String districtCode, String wardCode, String telNo, String olderPassword, String newPassword, String reTypePassword)

Cập nhật trạng thái của tài khoản công dân

updateStatus(long citizenId, int status)

Thêm mới tài khoản doanh nghiệp/tổ chức

addBusiness(String name, String enName, String shortName, String businessType, String idNumber, String [] businessDomains, String address, String cityCode, String districtCode, String wardCode, String email, String telNo, String representativeName, String representativeRole, String attachFile)

Cập nhật tài khoản doanh nghiệp/tổ chức

updateBusiness(long businessId, String name, String enName, String shortName, String businessType, String idNumber, String [] businessDomains, String address, String cityCode, String districtCode, String wardCode, String telNo, String representativeName, String representativeRole, String attachFile, String olderPassword, String newPassword, String reTypePassword)

Cập nhật tài khoản của DN/TC không yêu cầu mật khẩu cũ

updateBusiness(long businessId, String name, String enName, String shortName, String businessType, String idNumber, String [] businessDomains, String address, String cityCode, String districtCode, String wardCode, String telNo, String representativeName, String representativeRole, String attachFile, String newPassword, String reTypePassword)

Cập nhật trạng thái tài khoản doanh nghiệp/tổ chức

updateStatus(long businessId, int status)

Thêm tài khoản phụ doanh nghiệp/tổ chức

addSubAccBusiness(long businessId, String fullName, String workingRole, String telNo, String email, )

Cập nhật tài khoản phụ doanh nghiệp/tổ chức

updateSubAccBusiness(long businessAccoutId, String telNo, String olderPassword, String newPassword, retypeNewPassword)

Cập nhật trạng thái tài khoản phụ doanh nghiệp/tổ chức

updateStatus(long businessAccountId, int accountStatus)

Tìm kiếm danh sách công dân

searchCitizen(String keyword, int accountStatus, int start, int end, OrderByComparator obc)

Đếm danh sách công dân

countCitizen(String keyword, int accountStatus)

Tìm kiếm danh sách doanh nghiệp

searchBusiness(String keyword, int accountStatus)

Đếm số doanh nghiệp tổ chức

countBusiness(String keyword, int accountStatus)

Lấy số danh sách tài khoản phụ thuộc doanh nghiệp

getBusinessAccounts(ong businessId, int start, int end)

Đếm số tài khoản thuộc doanh nghiệp/tổ chức

countBusiness(long businessId)

Xóa tài khoản chưa được kích hoạt qua email

deleteCitizens(long [] citizenIds)

deleteBusiness(long [] businessIds)

Thiết kế chi tiết xem tại đây

service.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd">
<service-builder package-path="org.opencps.accountmgt">
<author>khoavd</author>
<namespace>accountmgt</namespace>

<entity name="Citizen" local-service="true"
	remote-service="true" table="opencps_acc_citizen">

	<!-- PK fields -->

	<column name="citizenId" type="long" primary="true" />

	<!-- Audit fields -->

	<column name="companyId" type="long" />
	<column name="groupId" type="long" />
	<column name="userId" type="long" />
	<column name="createDate" type="Date" />
	<column name="modifiedDate" type="Date" />

	<!-- Other fields -->

	<column name="uuid" type="String" />
	<column name="fullName" type="String" />
	<column name="personalId" type="String"/>
	<column name="gender" type="int"/>
	<column name="birthdate" type="Date" />
	<column name="address" type="String"/>
	<column name="cityCode" type="String" />
	<column name="districtCode" type="String" />
	<column name="wardCode" type="String" />
	<column name="telNo" type="String" />
	<column name="email" type="String" />
	<column name="attachFile" type="long" />
	<column name="mappingUserId" type="long" />
	<column name="accountStatus" type="int" />


	<!-- Order -->
	<order by="desc">
		<order-column name="createDate" />
	</order>

	<!-- Finder methods -->
	<finder name="GroupId" return-type="Collection">
		<finder-column name="groupId" />
	</finder>
	
	<finder name="G_S" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="accountStatus" />
	</finder>
	
	<finder name="G_S_C" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="accountStatus" />
		<finder-column name="cityCode" />
	</finder>
	
	<finder name="G_S_D" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="accountStatus" />
		<finder-column name="districtCode" />
	</finder>
	
	<finder name="G_S_W" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="accountStatus" />
		<finder-column name="wardCode" />
	</finder>
	
	<reference entity="User" package-path="com.liferay.portal" />
	
</entity>

<entity name="Business" local-service="true" remote-service="true"
	table="opencps_acc_business">

	<!-- PK fields -->

	<column name="businessId" type="long" primary="true" />

	<!-- Audit fields -->

	<column name="companyId" type="long" />
	<column name="groupId" type="long" />
	<column name="userId" type="long" />
	<column name="createDate" type="Date" />
	<column name="modifiedDate" type="Date" />

	<!-- Other fields -->

	<column name="uuid" type="String" />
	<column name="name" type="String" />
	<column name="enName" type="String" />
	<column name="shortName" type="String" />
	<column name="businessType" type="String" />
	<column name="businessDomains" type="String" />
	<column name="address" type="String" />
	<column name="cityCode" type="String" />
	<column name="districtCode" type="String" />
	<column name="wardCode" type="String" />
	<column name="telNo" type="String" />
	<column name="email" type="String" />
	<column name="representativeName" type="String" />
	<column name="representativeRole" type="String" />
	<column name="attachFile" type="long" />
	<column name="mappingOrganizationId" type="long" />
	<column name="mappingUserId" type="long" />
	<column name="accountStatus" type="int" />
	
	<!-- Order -->
	<order by="desc">
		<order-column name="createDate" />
	</order>

	<!-- Finder methods -->
	<finder name="GroupId" return-type="Collection">
		<finder-column name="groupId" />
	</finder>
	
	<finder name="G_S" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="accountStatus" />
	</finder>

	<finder name="G_S_C" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="accountStatus" />
		<finder-column name="cityCode" />
	</finder>

	<finder name="G_S_D" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="accountStatus" />
		<finder-column name="districtCode"/>
	</finder>

	<finder name="G_T" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="businessType" />
	</finder>
	
	<finder name="G_D" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="businessDomains" />
	</finder>
	
	<reference package-path="com.liferay.portal" entity="Organization" />
	<reference package-path="com.liferay.portal" entity="User" />
</entity>

<entity name="BusinessAccount" local-service="true" remote-service="true"
	table="opencps_acc_business_account">

	<!-- PK fields -->

	<column name="businessAccountId" type="long" primary="true" />

	<!-- Audit fields -->

	<column name="companyId" type="long" />
	<column name="groupId" type="long" />
	<column name="userId" type="long" />
	<column name="createDate" type="Date" />
	<column name="modifiedDate" type="Date" />

	<!-- Other fields -->

	<column name="businessId" type="long" />
	<column name="fullName" type="String" />
	<column name="workingRole" type="String" />
	<column name="telNo" type="String" />
	<column name="email" type="String" />
	<column name="mappingUserId" type="long" />
	<column name="hasPermissions" type="String" />
	<column name="accountStatus" type="int" />
	
	<!-- Order -->
	<order by="asc">
		<order-column name="fullName" />
	</order>

	<!-- Finder methods -->
	<finder name="GroupId" return-type="Collection">
		<finder-column name="groupId" />
	</finder>
	
	<finder name="GroupBusiness" return-type="Collection">
		<finder-column name="groupId" />
		<finder-column name="businessId" />
	</finder>

	<reference entity="User" package-path="com.liferay.portal" />
</entity>

<exceptions>
	<exception>EmptyCitizenName</exception>
	<exception>EmptyBusinessName</exception>
	<exception>OutOfLengthCitizenName</exception>
	<exception>OutOfLengthBusinessName</exception>
	<exception>OutOfLengthBusinessEnName</exception>
	<exception>OutOfLengthBusinessShortName</exception>
</exceptions>
</service-builder>

portlet-model-hints.xml

<model name="org.opencps.usermgt.model.WorkingUnit">
	<field name="workingunitId" type="long" />
	<field name="companyId" type="long" />
	<field name="groupId" type="long" />
	<field name="userId" type="long" />
	<field name="createDate" type="Date" />
	<field name="modifiedDate" type="Date" />
	<field name="name" type="String">
		<hint name="max-length">255</hint>
	</field>
	<field name="enName" type="String">
		<hint name="max-length">255</hint>
	</field>
	<field name="govAgencyCode" type="String" />
	<field name="managerWorkingUnitId" type="long" />
	<field name="parentWorkingUnitId" type="long" />
	<field name="sibling" type="int" />
	<field name="treeIndex" type="String" />
	<field name="address" type="String" />
	<field name="cityCode" type="String" />
	<field name="districtCode" type="String" />
	<field name="wardCode" type="String" />
	<field name="telNo" type="String" />
	<field name="faxNo" type="String" />
	<field name="email" type="String" />
	<field name="website" type="String">
		<hint-collection name="URL"/>
	</field>
	<field name="isEmployer" type="boolean" />
	<field name="mappingOrganisationId" type="long" />
</model>
<model name="org.opencps.accountmgt.model.Business">
	<field name="businessId" type="long" />
	<field name="companyId" type="long" />
	<field name="groupId" type="long" />
	<field name="userId" type="long" />
	<field name="createDate" type="Date" />
	<field name="modifiedDate" type="Date" />
	<field name="uuid" type="String" />
	<field name="name" type="String" >
		<hint name="display-width">255</hint>
	</field>
	<field name="enName" type="String" >
		<hint name="display-width">255</hint>
	</field>
	<field name="shortName" type="String">
		<hint name="display-width">255</hint>
	</field>
	<field name="businessType" type="String" />
	<field name="businessDomains" type="String" />
	<field name="address" type="String">
		<hint name="display-width">255</hint>
	</field>
	<field name="cityCode" type="String" />
	<field name="districtCode" type="String" />
	<field name="wardCode" type="String" />
	<field name="telNo" type="String" />
	<field name="email" type="String" />
	<field name="representativeName" type="String" />
	<field name="representativeRole" type="String" />
	<field name="attachFile" type="long" />
	<field name="mappingOrganizationId" type="long" />
	<field name="mappingUserId" type="long" />
	<field name="accountStatus" type="int" />
</model>
<model name="org.opencps.accountmgt.model.BusinessAccount">
	<field name="businessAccountId" type="long" />
	<field name="companyId" type="long" />
	<field name="groupId" type="long" />
	<field name="userId" type="long" />
	<field name="createDate" type="Date" />
	<field name="modifiedDate" type="Date" />
	<field name="businessId" type="long" />
	<field name="fullName" type="String" >
		<hint name="display-width">255</hint>
	</field>
	<field name="workingRole" type="String" />
	<field name="telNo" type="String" />
	<field name="email" type="String" />
	<field name="mappingUserId" type="long" />
	<field name="hasPermissions" type="String" />
	<field name="accountStatus" type="int" />
</model>
<model name="org.opencps.accountmgt.model.Citizen">
	<field name="citizenId" type="long" />
	<field name="companyId" type="long" />
	<field name="groupId" type="long" />
	<field name="userId" type="long" />
	<field name="createDate" type="Date" />
	<field name="modifiedDate" type="Date" />
	<field name="uuid" type="String" />
	<field name="fullName" type="String" >
		<hint name="display-width">255</hint>
	</field>
	<field name="personalId" type="String" />
	<field name="gender" type="int" />
	<field name="birthdate" type="Date" />
	<field name="address" type="String" />
	<field name="cityCode" type="String" />
	<field name="districtCode" type="String" />
	<field name="wardCode" type="String" />
	<field name="telNo" type="String" />
	<field name="email" type="String" />
	<field name="attachFile" type="long" />
	<field name="mappingUserId" type="long" />
	<field name="accountStatus" type="int" />
</model>

Module fontend

⚠️ **GitHub.com Fallback** ⚠️