516 lines
19 KiB
Java
516 lines
19 KiB
Java
package weaver.hrm.excelimport;
|
||
|
||
import com.engine.common.service.impl.HrmCommonServiceImpl;
|
||
import com.engine.hrm.entity.RuleCodeType;
|
||
import com.engine.hrm.util.CodeRuleManager;
|
||
import com.engine.hrm.util.HrmTriggerUtil;
|
||
import com.engine.hrm.util.face.HrmFaceCheckManager;
|
||
import org.apache.commons.lang3.StringUtils;
|
||
import weaver.conn.RecordSet;
|
||
import weaver.general.BaseBean;
|
||
import weaver.general.Util;
|
||
import weaver.hrm.common.AjaxManager;
|
||
import weaver.hrm.company.DepartmentComInfo;
|
||
import weaver.hrm.company.SubCompanyComInfo;
|
||
import weaver.matrix.MatrixUtil;
|
||
import weaver.rtx.OrganisationCom;
|
||
import weaver.systeminfo.SysMaintenanceLog;
|
||
import weaver.systeminfo.SystemEnv;
|
||
import weaver.hrm.common.DbFunctionUtil;
|
||
|
||
/**
|
||
* 分部部门信息类
|
||
* @author lvyi
|
||
*
|
||
*/
|
||
public class HrmCompany extends BaseBean {
|
||
private RecordSet recordSet=new RecordSet();
|
||
private OrganisationCom rtxService=new OrganisationCom();; //添加到rtx
|
||
private int id;
|
||
private String subcompanyname="";
|
||
private String departmentname="";
|
||
private String subcompanycode = "";
|
||
private Float subcompanyshoworder;
|
||
private String departmentcode = "";
|
||
private Float departmentshoworder;
|
||
private int userlanguage = 7;
|
||
private int pid;
|
||
private String operateType;
|
||
private String message = "";
|
||
|
||
public void setPid(int pid) {
|
||
this.pid = pid;
|
||
}
|
||
|
||
public void setUserLanguage(String userlanguage){
|
||
this.userlanguage = Util.getIntValue((String)userlanguage);
|
||
}
|
||
/**
|
||
* 校验数据有效性
|
||
* @return
|
||
*/
|
||
public String valExcelData(){
|
||
String errorInfo = "";
|
||
if(Util.null2String(this.subcompanyname).length()==0){
|
||
errorInfo = SystemEnv.getHtmlLabelName(125704,userlanguage);
|
||
return errorInfo;
|
||
}
|
||
if (StringUtils.isNotEmpty(operateType) && operateType.equals("add")) {
|
||
if (!verifySubCompanyCode(subcompanycode)) return subcompanycode + "编号重复";
|
||
if (!verifyDeptCode(departmentcode)) return departmentcode + "编号重复";
|
||
}
|
||
return errorInfo;
|
||
}
|
||
|
||
/**
|
||
* 保存数据
|
||
*/
|
||
public String save(){
|
||
boolean flag = false;
|
||
try{
|
||
if(StringUtils.isNotEmpty(operateType)) {
|
||
if (operateType.equals("add")) {
|
||
int subcompanyid = 0;
|
||
int departmentid = 0;
|
||
if(Util.null2String(this.subcompanyname).length()>0){
|
||
//取分部
|
||
subcompanyid = getSubCompanyId(this.subcompanyname);
|
||
}
|
||
departmentid = getDeptId(this.departmentname,subcompanyid);
|
||
if(Util.null2String(this.departmentname).length()>0){
|
||
if(departmentid!=0)flag=true;
|
||
}else{
|
||
if(subcompanyid!=0)flag=true;
|
||
}
|
||
} else if (operateType.equals("update")) {
|
||
int subcompanyid = updateSubCompany();
|
||
if (subcompanyid == -1) return String.valueOf(flag);
|
||
int deptid = updateDept(subcompanyid);
|
||
if (deptid == -1) return String.valueOf(flag);
|
||
flag = true;
|
||
}
|
||
}
|
||
}catch(Exception e){
|
||
writeLog(e);
|
||
}
|
||
|
||
return String.valueOf(flag);
|
||
}
|
||
|
||
private boolean verifySubCompanyCode(String code) {
|
||
if (StringUtils.isEmpty(code)) return true;
|
||
RecordSet recordSet = new RecordSet();
|
||
String sql = "select id from HrmSubCompany where subcompanycode = ?";
|
||
recordSet.executeQuery(sql, code);
|
||
if (recordSet.getCounts() > 0) return false;
|
||
return true;
|
||
}
|
||
|
||
private boolean verifySubCompanyCode(String code, String name, int supsubcomid) {
|
||
if (StringUtils.isEmpty(code)) return true;
|
||
RecordSet recordSet = new RecordSet();
|
||
String sql = "select id from HrmSubCompany where ltrim(rtrim(convToMultiLang(ltrim(rtrim(subcompanyname)),"+userlanguage+"))) = ? and supsubcomid = ?";
|
||
if("sqlserver".equalsIgnoreCase(recordSet.getDBType())){
|
||
sql = "select id from HrmSubCompany where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(subcompanyname)),"+userlanguage+"))) = ? and supsubcomid = ?";
|
||
}
|
||
recordSet.executeQuery(sql, name, supsubcomid);
|
||
if (recordSet.next()) {
|
||
String id = recordSet.getString("id");
|
||
sql = "select id from HrmSubCompany where subcompanycode = ? and id != ?";
|
||
recordSet.executeQuery(sql, code, id);
|
||
if (recordSet.getCounts() > 0) return false;
|
||
return true;
|
||
}
|
||
return verifySubCompanyCode(code);
|
||
}
|
||
|
||
private boolean verifyDeptCode(String code) {
|
||
if (StringUtils.isEmpty(code)) return true;
|
||
RecordSet recordSet = new RecordSet();
|
||
String sql = "select id from HrmDepartment where departmentcode = ?";
|
||
recordSet.executeQuery(sql, code);
|
||
if (recordSet.getCounts() > 0) return false;
|
||
return true;
|
||
}
|
||
|
||
private boolean verifyDeptCode(String code, String name, int subcompanyid, int supdepid) {
|
||
if (StringUtils.isEmpty(code)) return true;
|
||
RecordSet recordSet = new RecordSet();
|
||
String sql = "select id from HrmDepartment where ltrim(rtrim(convToMultiLang(ltrim(rtrim(departmentname)),"+userlanguage+"))) = ? and subcompanyid1 = ? and supdepid = ?";
|
||
if("sqlserver".equalsIgnoreCase(recordSet.getDBType())){
|
||
sql = "select id from HrmDepartment where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(departmentname)),"+userlanguage+"))) = ? and subcompanyid1 = ? and supdepid = ?";
|
||
}
|
||
recordSet.executeQuery(sql, name, subcompanyid, supdepid);
|
||
if (recordSet.next()) {
|
||
String id = recordSet.getString("id");
|
||
sql = "select id from HrmDepartment where departmentcode = ? and id != ?";
|
||
recordSet.executeQuery(sql, code, id);
|
||
if (recordSet.getCounts() > 0) return false;
|
||
return true;
|
||
}
|
||
return verifyDeptCode(code);
|
||
}
|
||
|
||
private int updateDept(int subcompanyid) {
|
||
String deptNames[] = departmentname.split(">");
|
||
int currentId = 0;
|
||
int parentId = 0;
|
||
String departmentcode = "";
|
||
Float departmentshoworder = null;
|
||
for (int i = 0; i < deptNames.length; i++) {
|
||
if (StringUtils.isEmpty(deptNames[i])) continue;
|
||
String sql = "select * from HrmDepartment where subcompanyid1="+ subcompanyid + " and ltrim(rtrim(convToMultiLang(ltrim(rtrim(departmentname)),"+userlanguage+")))='"+ deptNames[i].trim() + "' and supdepid=" + parentId +" and (canceled !=1 or canceled is null)";
|
||
if("sqlserver".equalsIgnoreCase(recordSet.getDBType())){
|
||
sql = "select * from HrmDepartment where subcompanyid1="+ subcompanyid + " and ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(departmentname)),"+userlanguage+")))='"+ deptNames[i].trim() + "' and supdepid=" + parentId +" and (canceled !=1 or canceled is null)";
|
||
}
|
||
currentId = getResultSetId(sql);
|
||
if (currentId == 0) {
|
||
// 部门不存在
|
||
// 不存在
|
||
this.setMessage("," + deptNames[i] + "部门不存在");
|
||
return -1;
|
||
}
|
||
if (i == deptNames.length - 1) {
|
||
// 最后一层级 赋值编码和顺序
|
||
departmentcode = this.departmentcode;
|
||
departmentshoworder = this.departmentshoworder;
|
||
}
|
||
if (StringUtils.isNotEmpty(departmentcode) || departmentshoworder != null) {
|
||
recordSet.executeQuery(sql);
|
||
recordSet.next();
|
||
if (departmentshoworder == null) departmentshoworder = Float.valueOf(Util.null2s(recordSet.getString("showorder"), "0"));
|
||
if (StringUtils.isEmpty(departmentcode)) departmentcode = Util.null2String(recordSet.getString("departmentcode"), "");
|
||
if (verifyDeptCode(departmentcode, deptNames[i], subcompanyid, parentId)) {
|
||
sql = "update hrmdepartment set departmentcode = ? , showorder = ? where ltrim(rtrim(convToMultiLang(ltrim(rtrim(departmentname)),"+userlanguage+"))) = ? and subcompanyid1 = ? and supdepid = ? and (canceled !=1 or canceled is null)";
|
||
if("sqlserver".equalsIgnoreCase(recordSet.getDBType())){
|
||
sql = "update hrmdepartment set departmentcode = ? , showorder = ? where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(departmentname)),"+userlanguage+"))) = ? and subcompanyid1 = ? and supdepid = ? and (canceled !=1 or canceled is null)";
|
||
}
|
||
recordSet.executeUpdate(sql, departmentcode, departmentshoworder, deptNames[i], subcompanyid, parentId);
|
||
} else {
|
||
setMessage("," + departmentcode + "编号重复");
|
||
return -1;
|
||
}
|
||
}
|
||
parentId = currentId;
|
||
}
|
||
return currentId;
|
||
}
|
||
private int updateSubCompany(){
|
||
String subcompanynames[] = subcompanyname.split(">");
|
||
int parentId = 0;
|
||
int currentId = 0;
|
||
String subcompanycode = "";
|
||
Float subcompanyshoworder = null;
|
||
for (int i = 0; i < subcompanynames.length; i++) {
|
||
if (StringUtils.isEmpty(subcompanynames[i])) continue;
|
||
String sql = "select * from HrmSubCompany where ltrim(rtrim(convToMultiLang(ltrim(rtrim(subcompanyname)),"+userlanguage+")))='"
|
||
+ subcompanynames[i].trim() + "' and supsubcomid=" + parentId;
|
||
if("sqlserver".equalsIgnoreCase(recordSet.getDBType())){
|
||
sql = "select * from HrmSubCompany where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(subcompanyname)),"+userlanguage+")))='"
|
||
+ subcompanynames[i].trim() + "' and supsubcomid=" + parentId;
|
||
}
|
||
currentId = getResultSetId(sql);
|
||
if (currentId == 0) {
|
||
// 不存在
|
||
this.setMessage("," + subcompanynames[i] + "分部不存在");
|
||
return -1;
|
||
}
|
||
if (i == subcompanynames.length - 1) {
|
||
// 最后一层级 赋值编码和顺序
|
||
subcompanycode = this.subcompanycode;
|
||
subcompanyshoworder = this.subcompanyshoworder;
|
||
}
|
||
// 如果编码和顺序不存在则不更新
|
||
if (StringUtils.isNotEmpty(subcompanycode) || subcompanyshoworder != null) {
|
||
recordSet.executeQuery(sql);
|
||
recordSet.next();
|
||
if (subcompanyshoworder == null) subcompanyshoworder = Float.valueOf(Util.null2s(recordSet.getString("showorder"), "0"));
|
||
if (StringUtils.isEmpty(subcompanycode)) subcompanycode = Util.null2String(recordSet.getString("subcompanycode"), "");
|
||
if (verifySubCompanyCode(subcompanycode, subcompanynames[i], parentId)) {
|
||
sql = "update HrmSubCompany set subcompanycode= ? , showorder = ? where ltrim(rtrim(convToMultiLang(ltrim(rtrim(subcompanyname)),"+userlanguage+"))) = ? and supsubcomid = ?";
|
||
if("sqlserver".equalsIgnoreCase(recordSet.getDBType())){
|
||
sql = "update HrmSubCompany set subcompanycode= ? , showorder = ? where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(subcompanyname)),"+userlanguage+"))) = ? and supsubcomid = ?";
|
||
}
|
||
recordSet.executeUpdate(sql, subcompanycode, subcompanyshoworder, subcompanynames[i], parentId);
|
||
} else {
|
||
setMessage("," + subcompanycode + "编号重复");
|
||
return -1;
|
||
}
|
||
}
|
||
parentId = currentId;
|
||
}
|
||
return currentId;
|
||
}
|
||
|
||
/**
|
||
* 根据分部名称获取分部Id,不存在就创建
|
||
* @param subCompanyName 分部名称 eg:泛微广东>泛微深圳
|
||
* @return
|
||
*/
|
||
public int getSubCompanyId(String subcompanyname) {
|
||
String subcompanynames[] = subcompanyname.split(">");
|
||
int currentId = 0;
|
||
int parentId = 0;
|
||
String sql = "";
|
||
String sqlInsert = "";
|
||
String subcompanycode = "";
|
||
Float subcompanyshoworder = null;
|
||
for (int i = 0; i < subcompanynames.length; i++) {
|
||
if(subcompanynames[i] ==null && subcompanynames[i].equals("")){
|
||
continue;
|
||
}
|
||
sql = "select id from HrmSubCompany where ltrim(rtrim(convToMultiLang(ltrim(rtrim(subcompanyname)),"+userlanguage+")))='"
|
||
+ subcompanynames[i].trim() + "' and supsubcomid=" + parentId;
|
||
if("sqlserver".equalsIgnoreCase(recordSet.getDBType())){
|
||
sql = "select id from HrmSubCompany where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(subcompanyname)),"+userlanguage+")))='"
|
||
+ subcompanynames[i].trim() + "' and supsubcomid=" + parentId;
|
||
}
|
||
|
||
currentId = getResultSetId(sql);
|
||
|
||
//added by wcd 2015-02-06 [限制分部数]
|
||
if (currentId == 0) {
|
||
if (i == subcompanynames.length - 1) {
|
||
// 最后一层级 赋值编码和顺序
|
||
subcompanycode = this.subcompanycode;
|
||
subcompanyshoworder = this.subcompanyshoworder;
|
||
if (subcompanyshoworder == null) subcompanyshoworder = 0.00F;
|
||
}
|
||
if(AjaxManager.getData("", "getLnScCount;mf").equals("true")){
|
||
// 如果编码为空 自动生成编码
|
||
try {
|
||
subcompanycode = CodeRuleManager.getCodeRuleManager().generateRuleCode(RuleCodeType.SUBCOMPANY, subcompanycode);
|
||
} catch (Exception e) {
|
||
setMessage("," + e.getMessage());
|
||
writeLog(e);
|
||
return -1;
|
||
}
|
||
sqlInsert = "insert into HrmSubCompany(subcompanyname,subcompanydesc,companyid,supsubcomid,subcompanycode,showorder,"+DbFunctionUtil.getInsertColumnSql()+") values('"
|
||
+ subcompanynames[i] +"','"+subcompanynames[i]+"',1" + "," + parentId + ",'" + subcompanycode+ "'," + subcompanyshoworder + ","+DbFunctionUtil.getInsertColumnValueSql(new RecordSet().getDBType(), 1)+")"; // 创建
|
||
boolean isSuccess = execSql(sqlInsert);
|
||
HrmTriggerUtil.generateSubcompanyPinyin(subcompanynames[i], null);
|
||
currentId = getResultSetId(sql);
|
||
HrmTriggerUtil.Tri_I_SubComKPICheckFlow(String.valueOf(currentId));
|
||
sql = "insert into leftmenuconfig (userid,infoid,visible,viewindex,resourceid,resourcetype,locked,lockedbyid,usecustomname,customname,customname_e) select distinct userid,infoid,visible,viewindex," + currentId + ",2,locked,lockedbyid,usecustomname,customname,customname_e from leftmenuconfig where resourcetype=1 and resourceid=1";
|
||
execSql(sql);
|
||
sql = "insert into mainmenuconfig (userid,infoid,visible,viewindex,resourceid,resourcetype,locked,lockedbyid,usecustomname,customname,customname_e) select distinct userid,infoid,visible,viewindex," + currentId + ",2,locked,lockedbyid,usecustomname,customname,customname_e from mainmenuconfig where resourcetype=1 and resourceid=1";
|
||
execSql(sql);
|
||
|
||
if(isSuccess){
|
||
//同步分部数据到矩阵
|
||
MatrixUtil.updateSubcompayData("" + currentId);
|
||
HrmFaceCheckManager.sync(currentId+"",HrmFaceCheckManager.getOptInsert(),"hrm_import_subcompany",HrmFaceCheckManager.getOaSubcompany());
|
||
}
|
||
|
||
insertSysLog(subcompanynames[i],"12");
|
||
} else {
|
||
currentId = -1;
|
||
}
|
||
}
|
||
parentId = currentId;
|
||
if(currentId != -1)
|
||
rtxService.addSubCompany(parentId); //同步RTX
|
||
}
|
||
return currentId;
|
||
}
|
||
|
||
/**
|
||
* 获取部门id,不存在就创建
|
||
* @param deptNames 部门名称
|
||
* @param subCompanyId 所属分部id
|
||
* @return
|
||
*/
|
||
public int getDeptId(String deptNames, int subCompanyId){
|
||
String deptName[] = deptNames.split(">");
|
||
int currentId = 0;
|
||
int parentId = 0;
|
||
|
||
String sql = "";
|
||
String sqlInsert = "";
|
||
String departmentcode = "";
|
||
Float departmentshoworder = null;
|
||
for (int i = 0; i < deptName.length; i++) {
|
||
if(deptName[i] == null || deptName[i].equals("")){
|
||
continue;
|
||
}
|
||
sql = "select id from HrmDepartment where subcompanyid1="+ subCompanyId + " and ltrim(rtrim(convToMultiLang(ltrim(rtrim(departmentname)),"+userlanguage+")))='"+ deptName[i].trim() + "' and supdepid=" + parentId +" and (canceled !=1 or canceled is null)";
|
||
if("sqlserver".equalsIgnoreCase(recordSet.getDBType())){
|
||
sql = "select id from HrmDepartment where subcompanyid1="+ subCompanyId + " and ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(departmentname)),"+userlanguage+")))='"+ deptName[i].trim() + "' and supdepid=" + parentId +" and (canceled !=1 or canceled is null)";
|
||
}
|
||
currentId = getResultSetId(sql);
|
||
|
||
if (currentId == 0) {
|
||
if (i == deptName.length -1) {
|
||
departmentcode = this.departmentcode;
|
||
departmentshoworder = this.departmentshoworder;
|
||
if (departmentshoworder == null) departmentshoworder = 0.00F;
|
||
}
|
||
// 如果编码为空 自动生成编码
|
||
departmentcode = "";
|
||
try {
|
||
departmentcode = CodeRuleManager.getCodeRuleManager().generateRuleCode(RuleCodeType.DEPARTMENT, String.valueOf(subCompanyId), departmentcode,String.valueOf(parentId));
|
||
} catch (Exception e) {
|
||
setMessage("," + e.getMessage());
|
||
writeLog(e);
|
||
return -1;
|
||
}
|
||
sqlInsert = "insert into HrmDepartment (departmentname,Departmentmark,subcompanyid1,supdepid,departmentcode,showorder,"+DbFunctionUtil.getInsertColumnSql()+") values('"
|
||
+ deptName[i]+"','"+deptName[i]+"',"+ subCompanyId+ ","+ parentId + ",'"+ departmentcode + "',"+ departmentshoworder + ","+DbFunctionUtil.getInsertColumnValueSql(new RecordSet().getDBType(), 1)+")"; // 创建
|
||
boolean isSuccess = execSql(sqlInsert);
|
||
HrmTriggerUtil.generateDepartmentPinyin(deptName[i], null);
|
||
currentId = getResultSetId(sql);
|
||
HrmTriggerUtil.Tri_I_DeptKPICheckFlow(String.valueOf(currentId));
|
||
if(isSuccess){
|
||
//同步部门数据到矩阵
|
||
MatrixUtil.updateDepartmentData("" + currentId);
|
||
HrmFaceCheckManager.sync(currentId+"",HrmFaceCheckManager.getOptInsert(),"hrm_import_deptment",HrmFaceCheckManager.getOaDepartment());
|
||
}
|
||
|
||
insertSysLog(deptName[i],"12");
|
||
rtxService.addDepartment(currentId); //同步RTX
|
||
}
|
||
parentId = currentId;
|
||
}
|
||
return currentId;
|
||
}
|
||
|
||
/**
|
||
* 获得查询结果Id
|
||
* @param sql 查询语句
|
||
* @return
|
||
*/
|
||
public int getResultSetId(String sql) {
|
||
int currentId = 0;
|
||
recordSet.execute(sql);
|
||
try {
|
||
while (recordSet.next()) {
|
||
currentId = recordSet.getInt("id");
|
||
}
|
||
} catch (Exception e) {
|
||
e.printStackTrace();
|
||
}
|
||
return currentId;
|
||
}
|
||
|
||
/**
|
||
* 执行插入操作
|
||
* @param sql
|
||
* @return
|
||
*/
|
||
|
||
public boolean execSql(String sql) {
|
||
if(recordSet.execute(sql)){
|
||
return true;
|
||
}
|
||
else{
|
||
return false;
|
||
}
|
||
}
|
||
|
||
public void removeCache(){
|
||
try{
|
||
|
||
MatrixUtil.sysSubcompayData();
|
||
MatrixUtil.sysDepartmentData();
|
||
|
||
SubCompanyComInfo SubCompanyComInfo = new SubCompanyComInfo();
|
||
SubCompanyComInfo.removeCompanyCache();
|
||
|
||
DepartmentComInfo DepartmentComInfo = new DepartmentComInfo();
|
||
DepartmentComInfo.removeCompanyCache();
|
||
//初始化应用分权
|
||
new weaver.hrm.appdetach.AppDetachComInfo().initSubDepAppData();
|
||
}catch (Exception e) {
|
||
writeLog(e);
|
||
}
|
||
}
|
||
|
||
public int getId() {
|
||
return id;
|
||
}
|
||
|
||
public void setId(int id) {
|
||
this.id = id;
|
||
}
|
||
|
||
public String getSubcompanyname() {
|
||
return subcompanyname;
|
||
}
|
||
|
||
public void setSubcompanyname(String subcompanyname) {
|
||
this.subcompanyname = subcompanyname;
|
||
}
|
||
|
||
public String getDepartmentname() {
|
||
return departmentname;
|
||
}
|
||
|
||
public void setDepartmentname(String departmentname) {
|
||
this.departmentname = departmentname;
|
||
}
|
||
|
||
public String getSubcompanycode() {
|
||
return subcompanycode;
|
||
}
|
||
|
||
public void setSubcompanycode(String subcompanycode) {
|
||
this.subcompanycode = subcompanycode;
|
||
}
|
||
|
||
public Float getSubcompanyshoworder() {
|
||
return subcompanyshoworder;
|
||
}
|
||
|
||
public void setSubcompanyshoworder(Float subcompanyshoworder) {
|
||
this.subcompanyshoworder = subcompanyshoworder;
|
||
}
|
||
|
||
public String getDepartmentcode() {
|
||
return departmentcode;
|
||
}
|
||
|
||
public void setDepartmentcode(String departmentcode) {
|
||
this.departmentcode = departmentcode;
|
||
}
|
||
|
||
public Float getDepartmentshoworder() {
|
||
return departmentshoworder;
|
||
}
|
||
|
||
public void setDepartmentshoworder(Float departmentshoworder) {
|
||
this.departmentshoworder = departmentshoworder;
|
||
}
|
||
|
||
public String getOperateType() {
|
||
return operateType;
|
||
}
|
||
|
||
public void setOperateType(String operateType) {
|
||
this.operateType = operateType;
|
||
}
|
||
|
||
public String getMessage() {
|
||
return message;
|
||
}
|
||
|
||
public void setMessage(String message) {
|
||
this.message = message;
|
||
}
|
||
|
||
private void insertSysLog(String name, String operateItem) {
|
||
SysMaintenanceLog syslog = new SysMaintenanceLog();
|
||
syslog.resetParameter();
|
||
syslog.setRelatedId(pid);
|
||
syslog.setOperateType("-1");
|
||
syslog.setOperateItem(operateItem);
|
||
syslog.setOperateUserid(0);
|
||
syslog.setRelatedName(name);
|
||
try {
|
||
syslog.setSysLogInfo();
|
||
} catch (Exception e) {
|
||
writeLog(e);
|
||
}
|
||
}
|
||
|
||
}
|