diff --git a/src/main/java/cn/palmte/work/controller/backend/AccountController.java b/src/main/java/cn/palmte/work/controller/backend/AccountController.java index a359ce1..49f931b 100644 --- a/src/main/java/cn/palmte/work/controller/backend/AccountController.java +++ b/src/main/java/cn/palmte/work/controller/backend/AccountController.java @@ -224,7 +224,7 @@ public class AccountController extends BaseController { Map searchInfo = getSearchInfo(keywords); downloadHeader(httpServletResponse, Utils.generateExcelName("人员信息"), "application/octet-stream"); String[] headers = {"工号", "手机号码", "姓名", "常驻地", "一级部门", "直接主管", "职位", "所属角色", "公司邮件地址"}; - String[] exportColumns = {"empCode", "telephone", "realName", "workLocation", "deptName", "directManager", "positionName", "roleName", "companyEmail"}; + String[] exportColumns = {"userName", "telephone", "realName", "workLocation", "deptName", "directManager", "positionName", "roleName", "companyEmail"}; ExportUtils.exportToExcel(headers, exportColumns, 1, 10000, httpServletResponse.getOutputStream(), (pN, pS) -> accountService.list(searchInfo, pN, pS).getList()); } @@ -235,7 +235,7 @@ public class AccountController extends BaseController { @RequestMapping("/template") public void template(HttpServletResponse response) throws Exception { - String[] headers = new String[]{"工号", "手机号码", "登录名称", "姓名", "常驻地", "一级部门", "直接主管", "职位", "所属角色", "公司邮件地址"}; + String[] headers = new String[]{"工号", "手机号码", "姓名", "常驻地", "一级部门", "直接主管", "职位", "所属角色", "公司邮件地址"}; downloadHeader(response, Utils.generateExcelName("人员信息批量导入模板")); ExportUtils exportUtils = new ExportUtils(headers); exportUtils.write(response.getOutputStream()); diff --git a/src/main/java/cn/palmte/work/service/AccountService.java b/src/main/java/cn/palmte/work/service/AccountService.java index 4e63ac6..45f08e5 100644 --- a/src/main/java/cn/palmte/work/service/AccountService.java +++ b/src/main/java/cn/palmte/work/service/AccountService.java @@ -134,7 +134,7 @@ public class AccountService { oldAdmin.setRealName(admin.getRealName()); oldAdmin.setDeptName(dept.getName()); oldAdmin.setPositionName(userPosition.getPositionName()); - oldAdmin.setEmpCode(admin.getEmpCode()); + //oldAdmin.setEmpCode(admin.getEmpCode()); oldAdmin.setWorkLocation(admin.getWorkLocation()); oldAdmin.setDirectManager(admin.getDirectManager()); oldAdmin.setCompanyEmail(admin.getCompanyEmail()); @@ -174,7 +174,7 @@ public class AccountService { } //工号重复校验 - Admin empCode = adminRepository.findByEmpCode(admin.getEmpCode()); + /*Admin empCode = adminRepository.findByEmpCode(admin.getEmpCode()); if (userId == -1) { if (null != empCode) { message = "该工号已存在!"; @@ -185,7 +185,7 @@ public class AccountService { message = "该工号已存在!"; return message; } - } + }*/ //手机号重复校验 Admin byTelephoneEquals = adminRepository.findByTelephone(phone); @@ -202,18 +202,18 @@ public class AccountService { } if (StringUtils.isEmpty(admin.getUserName())) { - message = "登录名不能为空!"; + message = "工号不能为空!"; return message; } Admin existAdmin = adminRepository.getAdminByUsername(admin.getUserName()); if (userId == -1) { if (existAdmin != null) { - message = "该登录名称已存在!"; + message = "该工号已存在!"; return message; } } else { if (existAdmin != null && existAdmin.getId() != userId) { - message = "该登录名称已存在!"; + message = "该工号已存在!"; return message; } } @@ -304,7 +304,7 @@ public class AccountService { throw new Exception("工号不能为空"); } - Admin byEmpCode = adminRepository.findByEmpCode(empCode.toString()); + Admin byEmpCode = adminRepository.getAdminByUsername(empCode.toString()); if (null != byEmpCode) { throw new Exception("工号" + empCode.toString() + "已存在"); @@ -320,7 +320,7 @@ public class AccountService { throw new Exception("手机号码" + telephone.toString() + "已存在"); } - Object userName = m.get("登录名称"); + /*Object userName = m.get("登录名称"); if (userName == null || StrKit.isBlank(userName.toString())) { throw new Exception("登录名称不能为空"); } @@ -328,7 +328,7 @@ public class AccountService { Admin byUsername = adminRepository.getAdminByUsername(userName.toString()); if (null != byUsername) { throw new Exception("登录名称" + byUsername.toString() + "已存在"); - } + }*/ Object realName = m.get("姓名"); if (realName == null || StrKit.isBlank(realName.toString())) { @@ -389,9 +389,10 @@ public class AccountService { } admin = new Admin(); - admin.setEmpCode(empCode.toString()); + //admin.setEmpCode(empCode.toString()); admin.setTelephone(telephone.toString()); - admin.setUserName(userName.toString()); + admin.setUserName(empCode.toString()); + admin.setRealName(realName.toString()); admin.setWorkLocation(workLocation.toString()); admin.setDeptId(dept.getId()); admin.setDeptName(dept.getName()); @@ -399,7 +400,7 @@ public class AccountService { admin.setPositionId(userPosition.getId()); admin.setPositionName(userPosition.getPositionName()); admin.setRoleId(role.getId()); - admin.setRealName(role.getName()); + admin.setRoleName(role.getName()); admin.setCompanyEmail(companyEmail.toString()); String salt = RandomStringUtils.randomAlphanumeric(6).toUpperCase(); diff --git a/src/main/resources/templates/admin/account_input.ftl b/src/main/resources/templates/admin/account_input.ftl index e0231d0..d10a2aa 100644 --- a/src/main/resources/templates/admin/account_input.ftl +++ b/src/main/resources/templates/admin/account_input.ftl @@ -28,9 +28,9 @@ 工号
- readonly placeholder="请输入工号"/> @@ -56,7 +56,7 @@
-
+ <#--
* 登录名称 @@ -70,7 +70,7 @@ placeholder="请输入登录名称(20字符以内)"/>
-
+
-->
diff --git a/src/main/resources/templates/admin/account_list.ftl b/src/main/resources/templates/admin/account_list.ftl index dd7f0bc..7c0fbc5 100644 --- a/src/main/resources/templates/admin/account_list.ftl +++ b/src/main/resources/templates/admin/account_list.ftl @@ -157,7 +157,7 @@ <#list pager.list as list> - ${list.empCode!} + ${list.userName!} ${list.telephone!} ${list.realName!} ${list.workLocation!} diff --git a/src/main/resources/templates/admin/month_statistics.ftl b/src/main/resources/templates/admin/month_statistics.ftl index 3cd292e..1d7d488 100644 --- a/src/main/resources/templates/admin/month_statistics.ftl +++ b/src/main/resources/templates/admin/month_statistics.ftl @@ -41,17 +41,17 @@ <#list primaryIndicatorList as list> ${list.title!} - ${list.incomeDevice!} - ${list.incomeEngineer!} - ${list.incomeService!} - ${list.costPurchaseDevice!} - ${list.costPurchaseBuild!} - ${list.costPurchaseService!} - ${list.costPurchaseOther!} - ${list.costOtherOther!} - ${list.costProjectManage!} - ${list.costExpropriation!} - ${list.costCompanyManage!} + ${(list.incomeDevice!0)?string("0.##")} + ${(list.incomeEngineer!0)?string("0.##")} + ${(list.incomeService!0)?string("0.##")} + ${(list.costPurchaseDevice!0)?string("0.##")} + ${(list.costPurchaseBuild!0)?string("0.##")} + ${(list.costPurchaseService!0)?string("0.##")} + ${(list.costPurchaseOther!0)?string("0.##")} + ${(list.costOtherOther!0)?string("0.##")} + ${(list.costProjectManage!0)?string("0.##")} + ${(list.costExpropriation!0)?string("0.##")} + ${(list.costCompanyManage!0)?string("0.##")} @@ -137,20 +137,20 @@ <#list cashFlowList as list> ${list.title!} - ${list.saleIncomeCash!} - ${list.taxReturn!} - ${list.earnestMoneyIncome!} - ${list.purchaseCost!} - ${list.taxCost!} - ${list.earnestMoneyCost!} - ${list.netCashFlow!} - ${list.cashInflowFromInvestingActivities!} - ${list.cashOutflowFromInvestingActivities!} - ${list.netCashFromInvestingActivities!} - ${list.financingCapitalInflow!} - ${list.financingCapitalOutflow!} - ${list.financingCapitalCashflow!} - ${list.netIncreaseMonetaryFunds!} + ${(list.saleIncomeCash!0)?string("0.##")} + ${(list.taxReturn!0)?string("0.##")} + ${(list.earnestMoneyIncome!0)?string("0.##")} + ${(list.purchaseCost!0)?string("0.##")} + ${(list.taxCost!0)?string("0.##")} + ${(list.earnestMoneyCost!0)?string("0.##")} + ${(list.netCashFlow!0)?string("0.##")} + ${(list.cashInflowFromInvestingActivities!0)?string("0.##")} + ${(list.cashOutflowFromInvestingActivities!0)?string("0.##")} + ${(list.netCashFromInvestingActivities!0)?string("0.##")} + ${(list.financingCapitalInflow!0)?string("0.##")} + ${(list.financingCapitalOutflow!0)?string("0.##")} + ${(list.financingCapitalCashflow!0)?string("0.##")} + ${(list.netIncreaseMonetaryFunds!0)?string("0.##")}