多语言支持

pull/250/head
dxfeng 1 year ago
parent 0b6c0ae11e
commit d802a3b200

@ -12,6 +12,7 @@ import com.engine.organization.util.OrganizationFormItemUtil;
import weaver.conn.RecordSet;
import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.systeminfo.SystemEnv;
import java.util.ArrayList;
import java.util.HashMap;
@ -32,10 +33,10 @@ public class GroupServiceImpl extends Service implements GroupService {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionItem> selectItems = new ArrayList<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
SearchConditionItem companyNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "总部名称", "companyname");
SearchConditionItem companyNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, 547172, "companyname");
companyNameItem.setRules("required|string");
SearchConditionItem companyDescItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "总部全称", "companydesc");
SearchConditionItem companyWebItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "公司网站", "companyweb");
SearchConditionItem companyDescItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, 547173, "companydesc");
SearchConditionItem companyWebItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, 547174, "companyweb");
// 赋值
String id = Util.null2String(params.get("id"));
@ -76,13 +77,12 @@ public class GroupServiceImpl extends Service implements GroupService {
public boolean updateGroup(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
String id = Util.null2String(params.get("id"));
OrganizationAssert.notNull(id, "数据有误");
OrganizationAssert.notNull(id, SystemEnv.getHtmlLabelName(547440,user.getLanguage()));
String companyname = (String) params.get("companyname");
String companydesc = (String) params.get("companydesc");
String companyweb = (String) params.get("companyweb");
RecordSet rs = new RecordSet();
boolean executeUpdate = rs.executeUpdate("update HrmCompany set COMPANYNAME = ?,COMPANYDESC=?,COMPANYWEB=? where id = ?", companyname, companydesc, companyweb, id);
//TODO new GroupTriggerRunnable(params).run();
return executeUpdate;
}
@ -93,10 +93,10 @@ public class GroupServiceImpl extends Service implements GroupService {
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
// 编辑
topMenuList.add(MenuBtn.builder().isTop("1").menuFun("doEdit").menuIcon("icon-coms-edit").menuName("编辑").type("BTN_EDIT").build());
topMenuList.add(MenuBtn.builder().isTop("1").menuFun("doEdit").menuIcon("icon-coms-edit").menuName(SystemEnv.getHtmlLabelName(547132,user.getLanguage())).type("BTN_EDIT").build());
btnDatas.put("topMenu", topMenuList);
// 编辑
rightMenuList.add(MenuBtn.builder().isTop("1").menuFun("doEdit").menuIcon("icon-coms-edit").menuName("编辑").type("BTN_EDIT").build());
rightMenuList.add(MenuBtn.builder().isTop("1").menuFun("doEdit").menuIcon("icon-coms-edit").menuName(SystemEnv.getHtmlLabelName(547132,user.getLanguage())).type("BTN_EDIT").build());
btnDatas.put("rightMenu", rightMenuList);
btnDatas.put("hasRight", HasRightUtil.hasRight(user, RIGHT_NAME, true));
return btnDatas;
@ -106,7 +106,7 @@ public class GroupServiceImpl extends Service implements GroupService {
public Map<String, Object> getTabInfo() {
Map<String, Object> apiDatas = new HashMap<>();
List<TopTab> topTabs = new ArrayList<>();
topTabs.add(TopTab.builder().title("总部信息").viewCondition("1").build());
topTabs.add(TopTab.builder().title(SystemEnv.getHtmlLabelName(547171 ,user.getLanguage())).viewCondition("1").build());
apiDatas.put("topTabs", topTabs);
return apiDatas;
}

@ -257,7 +257,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
public Integer saveSearchTemplate(SearchTemplateParam params) {
// 重复名称校验
SearchTemplatePO searchTemplateByName = getHrmResourceMapper().getSearchTemplateByName(user.getUID(), params.getShowname());
OrganizationAssert.isFalse("默认模板".equals(params.getShowname()) || null != searchTemplateByName, "该模板名称已存在");
OrganizationAssert.isFalse("默认模板".equals(params.getShowname()) || null != searchTemplateByName, SystemEnv.getHtmlLabelName(547439,user.getLanguage()));
SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields());
if (null == templatePO) {
return -1;
@ -280,7 +280,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
String templateId = Util.null2String(params.get("templateId"));
templateId = StringUtils.isBlank(templateId) ? "-1" : templateId;
String type = Util.null2String(params.get("type"));
OrganizationAssert.isTrue(StringUtils.isNotBlank(templateId), "数据有误,未找到对应数据");
OrganizationAssert.isTrue(StringUtils.isNotBlank(templateId), SystemEnv.getHtmlLabelName(547440, user.getLanguage()));
// 判断是否为搜索模板
SearchTemplatePO searchTemplateById;
List<String> selectKeys;
@ -330,7 +330,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
public Integer saveCustomTemplate(SearchTemplateParam params) {
// 重复名称校验
SearchTemplatePO searchTemplateByName = getHrmResourceMapper().getCustomTemplateByName(user.getUID(), params.getShowname());
OrganizationAssert.isFalse("默认模板".equals(params.getShowname()) || null != searchTemplateByName, "该模板名称已存在");
OrganizationAssert.isFalse("默认模板".equals(params.getShowname()) || null != searchTemplateByName, SystemEnv.getHtmlLabelName(547439,user.getLanguage()));
SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields());
if (null == templatePO) {
return -1;
@ -375,7 +375,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
allIds.remove(jclId);
} else {
//插入
OrganizationAssert.isFalse("".equals(name), "模板名称不能为空");
OrganizationAssert.isFalse("".equals(name), SystemEnv.getHtmlLabelName(547442,user.getLanguage()));
jclOrgCustomTemplatePO.setName(name);
jclOrgCustomTemplatePO.setCreator(user.getUID());
jclOrgCustomTemplatePO.setCreateTime(new java.sql.Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
@ -571,8 +571,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
if (HasRightUtil.hasRight(user, RIGHT_NAME, true)) {
topMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建人员").type("BTN_Addnew").build());
rightMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建人员").type("BTN_Addnew").build());
topMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName(SystemEnv.getHtmlLabelName(547443,user.getLanguage())).type("BTN_Addnew").build());
rightMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName(SystemEnv.getHtmlLabelName(547443,user.getLanguage())).type("BTN_Addnew").build());
}
topMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("customization").menuIcon("icon-coms-task-list").menuName(SystemEnv.getHtmlLabelName(547136,user.getLanguage())).type("BTN_COLUMN").build());
rightMenuList.add(MenuBtn.rightMenu_btnLog(user.getLanguage()));
@ -584,10 +584,6 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
@Override
public Map<String, Object> getTabForm(Map<String, Object> params) {
String viewAttrStr = (String) params.get("viewAttr");
OrganizationAssert.notBlank(viewAttrStr, "未指定操作类型,请确认");
String id = Util.null2String(params.get("id"));
OrganizationAssert.notBlank(id, "数据有误,请确认");
Map<String, Object> apiDatas = new HashMap<>();
return apiDatas;
}
@ -625,8 +621,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
@Override
public Map<String, Object> getCustomTemplate(Map<String, Object> params) {
List<ExtendInfoPO> infoPOList = new ArrayList<>();
infoPOList.add(ExtendInfoPO.builder().viewAttr(2).id(null).fieldName("name").fieldNameDesc("模板名称").fieldType("varchar(255)").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(1).isrequired(0).isSystemDefault(0).build());
infoPOList.add(ExtendInfoPO.builder().viewAttr(1).id(null).fieldName("createTime").fieldNameDesc("创建时间").fieldType("date").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(2).isrequired(0).isSystemDefault(0).build());
infoPOList.add(ExtendInfoPO.builder().viewAttr(2).id(null).fieldName("name").fieldNameDesc(SystemEnv.getHtmlLabelName(547580,user.getLanguage())).fieldType("varchar(255)").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(1).isrequired(0).isSystemDefault(0).build());
infoPOList.add(ExtendInfoPO.builder().viewAttr(1).id(null).fieldName("createTime").fieldNameDesc(SystemEnv.getHtmlLabelName(547521,user.getLanguage())).fieldType("date").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(2).isrequired(0).isSystemDefault(0).build());
Map<String, Object> tabInfoMap = new HashMap<>();
tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, false, true));
List<JclOrgCustomTemplatePO> jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAllByCreator(user.getUID());
@ -896,21 +892,21 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
List<CusFormFieldPO> hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId(HrmGroupEnum.HRM_BASIC.getGroupType().toString());
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, basicConditionItems);
if (CollectionUtils.isNotEmpty(basicConditionItems)) {
addGroups.add(new SearchConditionGroup("基本信息", true, basicConditionItems));
addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547175,user.getLanguage()), true, basicConditionItems));
}
// 个人信息1
hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId(HrmGroupEnum.HRM_PERSONAL.getGroupType().toString());
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, personalConditionItems);
if (CollectionUtils.isNotEmpty(personalConditionItems)) {
addGroups.add(new SearchConditionGroup("个人信息", true, personalConditionItems));
addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547578,user.getLanguage()), true, personalConditionItems));
}
// 工作信息3
hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId(HrmGroupEnum.HRM_WORK.getGroupType().toString());
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, workConditionItems);
if (CollectionUtils.isNotEmpty(workConditionItems)) {
addGroups.add(new SearchConditionGroup("工作信息", true, workConditionItems));
addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547579,user.getLanguage()), true, workConditionItems));
}
return addGroups;
}
@ -1039,16 +1035,16 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
private void buildSearchConditionGroup(SearchTemplatePO templatePO, HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo, List<SearchConditionGroup> addGroups) {
String[] basicFields = Util.null2String(templatePO.getBasicFields()).split(",");
if (basicFields.length > 0) {
getTemplateItems(hrmFieldSearchConditionComInfo, addGroups, "基本信息", HrmGroupEnum.HRM_BASIC.getGroupType(), basicFields);
getTemplateItems(hrmFieldSearchConditionComInfo, addGroups, SystemEnv.getHtmlLabelName(547175,user.getLanguage()), HrmGroupEnum.HRM_BASIC.getGroupType(), basicFields);
}
String[] personalFields = Util.null2String(templatePO.getPersonalFields()).split(",");
if (personalFields.length > 0) {
getTemplateItems(hrmFieldSearchConditionComInfo, addGroups, "个人信息", HrmGroupEnum.HRM_PERSONAL.getGroupType(), personalFields);
getTemplateItems(hrmFieldSearchConditionComInfo, addGroups, SystemEnv.getHtmlLabelName(547578,user.getLanguage()), HrmGroupEnum.HRM_PERSONAL.getGroupType(), personalFields);
}
String[] workFields = Util.null2String(templatePO.getWorkFields()).split(",");
if (workFields.length > 0) {
getTemplateItems(hrmFieldSearchConditionComInfo, addGroups, "工作信息", HrmGroupEnum.HRM_WORK.getGroupType(), workFields);
getTemplateItems(hrmFieldSearchConditionComInfo, addGroups, SystemEnv.getHtmlLabelName(547579,user.getLanguage()), HrmGroupEnum.HRM_WORK.getGroupType(), workFields);
}
}

@ -334,11 +334,11 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
}
Map<String, Object> item = new HashMap<String, Object>(2){{
put("index", 3);
put("value", "多个职等之间使用英文状态下逗号”,“隔开");
put("value",SystemEnv.getHtmlLabelName(547585,user.getLanguage()));
}};
Map<String, Object> item1 = new HashMap<String, Object>(2){{
put("index", 4);
put("value", "《等级方案、职等、职级》名称存在重复情况下暂时不支持导入功能");
put("value", SystemEnv.getHtmlLabelName(547586,user.getLanguage()));
}};
itemList.add(item);
itemList.add(item1);

@ -134,10 +134,10 @@ public class StaffServiceImpl extends Service implements StaffService {
public int saveStaff(StaffParams param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, "编制数不可小于0请更正");
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, SystemEnv.getHtmlLabelName(547449,user.getLanguage()));
List<StaffPO> verify = getStaffMapper().customSelect(param.getPlanId(), param.getEcCompany(), param.getEcDepartment(), param.getJobId());
if (!verify.isEmpty()) {
throw new OrganizationRunTimeException("同一编制方案下,同一维度的编制信息不可重复创建!");
throw new OrganizationRunTimeException(SystemEnv.getHtmlLabelName(547450,user.getLanguage()));
}
checkRequired(staffPO);
int ignoreNull = getStaffMapper().insertIgnoreNull(staffPO);
@ -151,7 +151,7 @@ public class StaffServiceImpl extends Service implements StaffService {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
List<StaffPO> verify = getStaffMapper().customSelect(param.getPlanId(), param.getEcCompany(), param.getEcDepartment(), param.getJobId());
if (verify.size() > 1) {
throw new OrganizationRunTimeException("同一编制方案下,同一维度的编制信息已存在!");
throw new OrganizationRunTimeException(SystemEnv.getHtmlLabelName(547451, user.getLanguage()));
}
StaffPO staffByID = getStaffMapper().getStaffByID(param.getId());
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
@ -172,10 +172,10 @@ public class StaffServiceImpl extends Service implements StaffService {
// 更新编制表
staffPO.setStaffNum(staffPO.getStaffNum() + changeNum);
}
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, "调整后编制数小于0请更正");
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, SystemEnv.getHtmlLabelName(547452,user.getLanguage()));
StaffBO.buildStaffDesc(staffPO);
if (staffPO.getControlPolicy().equals(HARDCONTROLLER) && staffPO.getStaffNum() < (staffPO.getPermanentNum() + staffPO.getFreezeNum())){
throw new OrganizationRunTimeException("存在编制超编风险,请先修改控制策略");
throw new OrganizationRunTimeException(SystemEnv.getHtmlLabelName(547453,user.getLanguage()));
}
// 更新主表
int updateStaff = getStaffMapper().updateStaff(staffPO);

@ -194,7 +194,7 @@ public class SequenceImportUtil {
}
Map<String,Object> map = new HashMap<String,Object>(2){{
put("index",3);
put("value","分部的层级关系用字符>分割。");
put("value",SystemEnv.getHtmlLabelName(547228,user.getLanguage()));
}};
itemList.add(map);
groupItem.put("items", itemList);

Loading…
Cancel
Save