oracle环境存入版本bug修复

pull/105/head
Mlin 3 years ago
parent afe4813427
commit a5cc902c10

@ -0,0 +1,18 @@
package com.engine.organization.entity.version;
import lombok.Data;
@Data
public class HrmDepartmentDto {
int id;
String departmentmark;
String departmentcode;
String departmentname;
String subcompanyid1;
String supdepid;
String bmfzr;
String showorder;
String canceled;
}

@ -0,0 +1,25 @@
package com.engine.organization.entity.version;
import lombok.Data;
@Data
public class HrmResourceDto {
private Integer id;
private Integer departmentid;
private String dsporder;
private Integer subcompanyid1;
private Integer jobtitle;
private String mobile;
private String telephone;
private String managerid;
private String lastname;
}

@ -0,0 +1,15 @@
package com.engine.organization.entity.version;
import lombok.Data;
@Data
public class HrmSubCompanyDto {
int id;
String subcompanydesc;
String subcompanycode;
String subcompanyname;
String supsubcomid;
String showorder;
String canceled;
}

@ -1,15 +1,10 @@
package com.engine.organization.mapper.version; package com.engine.organization.mapper.version;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.engine.common.entity.HrmDepartmentEntity; import com.engine.organization.entity.version.*;
import com.engine.common.entity.HrmSubCompanyEntity;
import com.engine.organization.entity.version.HrmDepartmentVersion;
import com.engine.organization.entity.version.HrmResourceVersion;
import com.engine.organization.entity.version.HrmSubCompanyVersion;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Author weaver_cl * @Author weaver_cl
@ -45,7 +40,7 @@ public interface CompanyVersionMapper {
/** /**
* *
*/ */
HrmResourceVersion getMaxHrmVersion(@Param("getMaxHrmVersion") String getMaxHrmVersion); HrmResourceVersion getMaxHrmVersion(@Param("resourceid") String resourceid);
/** /**
* *
@ -55,17 +50,17 @@ public interface CompanyVersionMapper {
/** /**
* *
*/ */
JSONObject getHrmSubComp(@Param("id") String id); HrmSubCompanyDto getHrmSubComp(@Param("id") String id);
/** /**
* *
*/ */
JSONObject getHrmDepartment(@Param("id") String id); HrmDepartmentDto getHrmDepartment(@Param("id") String id);
/** /**
* *
*/ */
JSONObject getHrmResource(@Param("id") String id); HrmResourceDto getHrmResource(@Param("id") String id);
/** /**
* *

@ -39,9 +39,9 @@
<insert id="insertHrmSubComVersion"> <insert id="insertHrmSubComVersion">
insert into hrmsubcompany_version insert into hrmsubcompany_version
(subcomid ,subcompanydesc ,subcompanycode ,subcompanyname ,supsubcomid , (id, subcomid ,subcompanydesc ,subcompanycode ,subcompanyname ,supsubcomid ,
showorder ,canceled ,description ,operator ,version ,operate_time) showorder ,canceled ,description ,operator ,version ,operate_time)
values (#{subComId}, #{subCompanyDesc}, #{subCompanyCode}, #{subCompanyName}, #{supSubComId}, values (#{id},#{subComId}, #{subCompanyDesc}, #{subCompanyCode}, #{subCompanyName}, #{supSubComId},
#{showOrder}, #{canceled}, #{description}, #{operator}, #{version}, #{operateTime}) #{showOrder}, #{canceled}, #{description}, #{operator}, #{version}, #{operateTime})
</insert> </insert>
@ -57,9 +57,9 @@
<insert id="insertHrmDeptVersion"> <insert id="insertHrmDeptVersion">
insert into hrmdepartment_version insert into hrmdepartment_version
(departmentid, departmentmark, departmentcode, departmentname, subcompanyid1, supdepid, (id,departmentid, departmentmark, departmentcode, departmentname, subcompanyid1, supdepid,
bmfzr, showorder, canceled, description, operator, version, operate_time) bmfzr, showorder, canceled, description, operator, version, operate_time)
VALUES (#{departmentId}, #{departmentMark}, #{departmentCode}, #{departmentName}, #{subCompanyId1}, #{supDepId}, VALUES (#{id},#{departmentId}, #{departmentMark}, #{departmentCode}, #{departmentName}, #{subCompanyId1}, #{supDepId},
#{bmfzr}, #{showOrder}, #{canceled}, #{description}, #{operator}, #{version}, #{operateTime}) #{bmfzr}, #{showOrder}, #{canceled}, #{description}, #{operator}, #{version}, #{operateTime})
</insert> </insert>
@ -71,7 +71,6 @@
</select> </select>
<select id="getMaxHrmVersion" resultType="com.engine.organization.entity.version.HrmResourceVersion" databaseId="sqlserver"> <select id="getMaxHrmVersion" resultType="com.engine.organization.entity.version.HrmResourceVersion" databaseId="sqlserver">
select top 1 * from hrmresource_version where resourceid=#{resourceid} order by version desc select top 1 * from hrmresource_version where resourceid=#{resourceid} order by version desc
</select> </select>
<insert id="insertHrmResourceVersion" keyColumn="id" keyProperty="id" parameterType="com.engine.organization.entity.version.HrmResourceVersion" useGeneratedKeys="true"> <insert id="insertHrmResourceVersion" keyColumn="id" keyProperty="id" parameterType="com.engine.organization.entity.version.HrmResourceVersion" useGeneratedKeys="true">
@ -234,15 +233,15 @@
</trim> </trim>
</insert> </insert>
<select id="getHrmSubComp" resultType="com.alibaba.fastjson.JSONObject"> <select id="getHrmSubComp" resultType="com.engine.organization.entity.version.HrmSubCompanyDto">
select id,subcompanyname, subcompanydesc,companyid,supsubcomid,url,canceled,subcompanycode,outkey,showorder from HrmSubCompany select id ,subcompanyname, subcompanydesc,companyid,supsubcomid,url,canceled,subcompanycode,outkey,showorder from HrmSubCompany
where id=#{id} where id=#{id}
</select> </select>
<select id="getHrmDepartment" resultType="com.alibaba.fastjson.JSONObject"> <select id="getHrmDepartment" resultType="com.engine.organization.entity.version.HrmDepartmentDto">
select id,departmentmark,departmentname,subcompanyid1,supdepid,canceled,departmentcode,outkey,showorder,coadjutant,bmfzr from HrmDepartment select id,departmentmark,departmentname,subcompanyid1,supdepid,canceled,departmentcode,outkey,showorder,coadjutant,bmfzr from HrmDepartment
where id=#{id} where id=#{id}
</select> </select>
<select id="getHrmResource" resultType="com.alibaba.fastjson.JSONObject"> <select id="getHrmResource" resultType="com.engine.organization.entity.version.HrmResourceDto">
select id,loginid,password,lastname,sex,birthday,nationality,systemlanguage, select id,loginid,password,lastname,sex,birthday,nationality,systemlanguage,
maritalstatus,telephone,mobile,mobilecall,email,locationid,workroom,homeaddress, maritalstatus,telephone,mobile,mobilecall,email,locationid,workroom,homeaddress,
resourcetype,startdate,enddate,jobtitle,jobactivitydesc,joblevel,seclevel,departmentid, resourcetype,startdate,enddate,jobtitle,jobactivitydesc,joblevel,seclevel,departmentid,
@ -257,7 +256,7 @@
needdynapass,dsporder,passwordstate,accounttype,belongto,dactylogram,assistantdactylogram, needdynapass,dsporder,passwordstate,accounttype,belongto,dactylogram,assistantdactylogram,
passwordlock,sumpasswordwrong,oldpassword1,oldpassword2,msgStyle,messagerurl,pinyinlastname, passwordlock,sumpasswordwrong,oldpassword1,oldpassword2,msgStyle,messagerurl,pinyinlastname,
tokenkey,userUsbType,outkey,adsjgs,adgs,adbm,mobileshowtype,usbstate,totalSpace,occupySpace, tokenkey,userUsbType,outkey,adsjgs,adgs,adbm,mobileshowtype,usbstate,totalSpace,occupySpace,
ecology_pinyin_search,isADAccount,accountname,notallot,beforefrozen,resourcefrom,isnewuser, ecology_pinyin_search,isADAccount,accountname,
haschangepwd,created,creater,modified,modifier,passwordlocktime,mobilecaflag,salt,companystartdate, haschangepwd,created,creater,modified,modifier,passwordlocktime,mobilecaflag,salt,companystartdate,
workstartdate,secondaryPwd,useSecondaryPwd,classification,uuid,passwordLockReason,companyworkyear, workstartdate,secondaryPwd,useSecondaryPwd,classification,uuid,passwordLockReason,companyworkyear,
workyear,DISMISSDATE,encKey,crc,usbscope,tenant_key,clauthtype,hashData,signData from HrmResource workyear,DISMISSDATE,encKey,crc,usbscope,tenant_key,clauthtype,hashData,signData from HrmResource

@ -4,10 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.entity.hrmresource.po.HrmResourcePO; import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
import com.engine.organization.entity.map.JclOrgMap; import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.version.HrmDepartmentVersion; import com.engine.organization.entity.version.*;
import com.engine.organization.entity.version.HrmResourceVersion;
import com.engine.organization.entity.version.HrmSubCompanyVersion;
import com.engine.organization.entity.version.VersionData;
import com.engine.organization.enums.ModuleTypeEnum; import com.engine.organization.enums.ModuleTypeEnum;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper; import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.resource.ResourceMapper; import com.engine.organization.mapper.resource.ResourceMapper;
@ -16,6 +13,7 @@ import com.engine.organization.service.VersionManageService;
import com.engine.organization.util.OrganizationDateUtil; import com.engine.organization.util.OrganizationDateUtil;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.docx4j.wml.U;
import weaver.common.DateUtil; import weaver.common.DateUtil;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.general.Util; import weaver.general.Util;
@ -49,18 +47,18 @@ public class VersionManageServiceImpl extends Service implements VersionManageSe
switch (moduleTypeEnum.getValue()) { switch (moduleTypeEnum.getValue()) {
case 1: case 1:
paramMap = getCompanyVersionMapper().getHrmSubComp(id); HrmSubCompanyDto hrmSubComp = getCompanyVersionMapper().getHrmSubComp(id);
saveSubComToVersion(paramMap, user); saveSubComToVersion(hrmSubComp, user);
// saveSubComToMap(paramMap); // saveSubComToMap(paramMap);
break; break;
case 2: case 2:
paramMap = getCompanyVersionMapper().getHrmDepartment(id); HrmDepartmentDto hrmDepartmentDto = getCompanyVersionMapper().getHrmDepartment(id);
saveDeptToVersion(paramMap, user); saveDeptToVersion(hrmDepartmentDto, user);
// saveDeptToMap(paramMap); // saveDeptToMap(paramMap);
break; break;
case 4: case 4:
paramMap = getCompanyVersionMapper().getHrmResource(id); HrmResourceDto hrmResourceDto = getCompanyVersionMapper().getHrmResource(id);
saveHrmToVersion(paramMap, user); saveHrmToVersion(hrmResourceDto, user);
// saveHrmToMap(paramMap); // saveHrmToMap(paramMap);
break; break;
} }
@ -324,27 +322,30 @@ public class VersionManageServiceImpl extends Service implements VersionManageSe
/** /**
* *
*/ */
void saveSubComToVersion(JSONObject params, User user) { void saveSubComToVersion(HrmSubCompanyDto hrmSubComp, User user) {
String currentDate = OrganizationDateUtil.getFormatLocalDateTime(new java.util.Date()); String currentDate = OrganizationDateUtil.getFormatLocalDateTime(new java.util.Date());
String id = params.getString("id"); int id = hrmSubComp.getId();
HrmSubCompanyVersion hrmSubCompanyVersion = new HrmSubCompanyVersion(); HrmSubCompanyVersion hrmSubCompanyVersion = new HrmSubCompanyVersion();
hrmSubCompanyVersion.setSubComId(Integer.parseInt(id)); hrmSubCompanyVersion.setSubComId(id);
hrmSubCompanyVersion.setSubCompanyDesc(params.getString("subcompanydesc")); hrmSubCompanyVersion.setSubCompanyDesc(hrmSubComp.getSubcompanydesc());
hrmSubCompanyVersion.setSubCompanyCode(params.getString("subcompanycode")); hrmSubCompanyVersion.setSubCompanyCode(hrmSubComp.getSubcompanycode());
hrmSubCompanyVersion.setSubCompanyName(params.getString("subcompanyname")); hrmSubCompanyVersion.setSubCompanyName(hrmSubComp.getSubcompanyname());
String supSubComId = params.getString("supsubcomid"); String supSubComId = hrmSubComp.getSupsubcomid();
hrmSubCompanyVersion.setSupSubComId(StringUtils.isNotBlank(supSubComId) ? Integer.parseInt(supSubComId) : null); hrmSubCompanyVersion.setSupSubComId(StringUtils.isNotBlank(supSubComId) ? Integer.parseInt(supSubComId) : null);
String showOrder = params.getString("showorder"); String showOrder = hrmSubComp.getShoworder();
if (showOrder != null) { if (showOrder != null && !showOrder.equals("0")) {
showOrder = showOrder.substring(0, showOrder.indexOf(".")); int length = showOrder.indexOf(".");
if (length>0){
showOrder = showOrder.substring(0, length);
}
} }
hrmSubCompanyVersion.setShowOrder(null == showOrder ? null : Integer.parseInt(showOrder)); hrmSubCompanyVersion.setShowOrder(null == showOrder ? null : Integer.parseInt(showOrder));
String canceled = params.getString("canceled"); String canceled = hrmSubComp.getCanceled();
; ;
hrmSubCompanyVersion.setCanceled(StringUtils.isNotBlank(canceled) ? Integer.parseInt(canceled) : null); hrmSubCompanyVersion.setCanceled(StringUtils.isNotBlank(canceled) ? Integer.parseInt(canceled) : null);
hrmSubCompanyVersion.setDescription(null); hrmSubCompanyVersion.setDescription(null);
hrmSubCompanyVersion.setOperator(user.getUsername()); hrmSubCompanyVersion.setOperator(user.getUsername());
hrmSubCompanyVersion.setVersion(genVersionId(1, id)); hrmSubCompanyVersion.setVersion(genVersionId(1, Util.null2String(id)));
hrmSubCompanyVersion.setOperateTime(new Timestamp(OrganizationDateUtil.stringToDateTime(currentDate).getTime())); hrmSubCompanyVersion.setOperateTime(new Timestamp(OrganizationDateUtil.stringToDateTime(currentDate).getTime()));
getCompanyVersionMapper().insertHrmSubComVersion(hrmSubCompanyVersion); getCompanyVersionMapper().insertHrmSubComVersion(hrmSubCompanyVersion);
} }
@ -352,35 +353,38 @@ public class VersionManageServiceImpl extends Service implements VersionManageSe
/** /**
* *
*/ */
void saveDeptToVersion(JSONObject params, User user) { void saveDeptToVersion(HrmDepartmentDto hrmDepartmentDto, User user) {
String id = params.getString("id"); int id = hrmDepartmentDto.getId();
String currentDate = OrganizationDateUtil.getFormatLocalDateTime(new java.util.Date()); String currentDate = OrganizationDateUtil.getFormatLocalDateTime(new java.util.Date());
HrmDepartmentVersion hrmDepartmentVersion = new HrmDepartmentVersion(); HrmDepartmentVersion hrmDepartmentVersion = new HrmDepartmentVersion();
hrmDepartmentVersion.setDepartmentId(Integer.parseInt(id)); hrmDepartmentVersion.setDepartmentId(id);
hrmDepartmentVersion.setDepartmentMark(params.getString("departmentmark")); hrmDepartmentVersion.setDepartmentMark(hrmDepartmentDto.getDepartmentmark());
hrmDepartmentVersion.setDepartmentCode(params.getString("departmentcode")); hrmDepartmentVersion.setDepartmentCode(hrmDepartmentDto.getDepartmentcode());
hrmDepartmentVersion.setDepartmentName(params.getString("departmentname")); hrmDepartmentVersion.setDepartmentName(hrmDepartmentDto.getDepartmentname());
String subCompanyId1 = params.getString("subcompanyid1"); String subCompanyId1 = hrmDepartmentDto.getSubcompanyid1();
hrmDepartmentVersion.setSubCompanyId1(StringUtils.isNotBlank(subCompanyId1) ? Integer.parseInt(subCompanyId1) : null); hrmDepartmentVersion.setSubCompanyId1(StringUtils.isNotBlank(subCompanyId1) ? Integer.parseInt(subCompanyId1) : null);
String supDepId = params.getString("supdepid"); String supDepId = hrmDepartmentDto.getSupdepid();
if (supDepId != null) { if (supDepId != null) {
hrmDepartmentVersion.setSupDepId(Integer.parseInt(supDepId)); hrmDepartmentVersion.setSupDepId(Integer.parseInt(supDepId));
} }
String bmfzr = params.getString("bmfzr"); String bmfzr = hrmDepartmentDto.getBmfzr();
if (!"".equals(bmfzr) && bmfzr != null) { if (!"".equals(bmfzr) && bmfzr != null) {
hrmDepartmentVersion.setBmfzr(Integer.parseInt(bmfzr)); hrmDepartmentVersion.setBmfzr(Integer.parseInt(bmfzr));
} }
String showOrder = params.getString("showorder"); String showOrder = hrmDepartmentDto.getShoworder();
if (showOrder != null) { if (showOrder != null && !showOrder.equals("0")) {
showOrder = showOrder.substring(0, showOrder.indexOf(".")); int length = showOrder.indexOf(".");
if (length>0){
showOrder = showOrder.substring(0, length);
}
} }
hrmDepartmentVersion.setShowOrder(null == showOrder ? null : Integer.parseInt(showOrder)); hrmDepartmentVersion.setShowOrder(null == showOrder ? null : Integer.parseInt(showOrder));
String canceled = params.getString("canceled"); String canceled = hrmDepartmentDto.getCanceled();
hrmDepartmentVersion.setCanceled(StringUtils.isNotBlank(canceled) ? Integer.parseInt(canceled) : null); hrmDepartmentVersion.setCanceled(StringUtils.isNotBlank(canceled) ? Integer.parseInt(canceled) : null);
hrmDepartmentVersion.setDescription(null); hrmDepartmentVersion.setDescription(null);
hrmDepartmentVersion.setOperator(user.getLastname()); hrmDepartmentVersion.setOperator(user.getLastname());
hrmDepartmentVersion.setVersion(genVersionId(2, id)); hrmDepartmentVersion.setVersion(genVersionId(2, Util.null2String(id)));
hrmDepartmentVersion.setOperateTime(new Timestamp(OrganizationDateUtil.stringToDateTime(currentDate).getTime())); hrmDepartmentVersion.setOperateTime(new Timestamp(OrganizationDateUtil.stringToDateTime(currentDate).getTime()));
getCompanyVersionMapper().insertHrmDeptVersion(hrmDepartmentVersion); getCompanyVersionMapper().insertHrmDeptVersion(hrmDepartmentVersion);
@ -389,27 +393,27 @@ public class VersionManageServiceImpl extends Service implements VersionManageSe
/** /**
* *
*/ */
void saveHrmToVersion(JSONObject params, User user) { void saveHrmToVersion(HrmResourceDto hrmResourceDto, User user) {
String id = params.getString("id"); Integer id = hrmResourceDto.getId();
String currentDate = OrganizationDateUtil.getFormatLocalDateTime(new java.util.Date()); String currentDate = OrganizationDateUtil.getFormatLocalDateTime(new java.util.Date());
HrmResourceVersion hrmResourceVersion = new HrmResourceVersion(); HrmResourceVersion hrmResourceVersion = new HrmResourceVersion();
hrmResourceVersion.setResourceid(Integer.parseInt(id)); hrmResourceVersion.setResourceid(id);
/* hrmResourceVersion.setCompanystartdate(new Date(OrganizationDateUtil.stringToDate((String) params.get("companystartdate")).getTime())); /* hrmResourceVersion.setCompanystartdate(new Date(OrganizationDateUtil.stringToDate((String) params.get("companystartdate")).getTime()));
hrmResourceVersion.setCompanyworkyear(Integer.parseInt((String) params.get("companyworkyear"))); hrmResourceVersion.setCompanyworkyear(Integer.parseInt((String) params.get("companyworkyear")));
hrmResourceVersion.setWorkstartdate(new Date(OrganizationDateUtil.stringToDate((String) params.get("workstartdate")).getTime()));*/ hrmResourceVersion.setWorkstartdate(new Date(OrganizationDateUtil.stringToDate((String) params.get("workstartdate")).getTime()));*/
hrmResourceVersion.setDepartmentid(Integer.parseInt(params.getString("departmentid"))); hrmResourceVersion.setDepartmentid(hrmResourceDto.getDepartmentid());
hrmResourceVersion.setDsporder(Double.valueOf(params.getString("dsporder")).intValue()); hrmResourceVersion.setDsporder(Double.valueOf(hrmResourceDto.getDsporder()).intValue());
hrmResourceVersion.setSubcompanyid1(Integer.parseInt(params.getString("subcompanyid1"))); hrmResourceVersion.setSubcompanyid1(hrmResourceDto.getSubcompanyid1());
hrmResourceVersion.setJobtitle(Integer.parseInt(params.getString("jobtitle"))); hrmResourceVersion.setJobtitle(hrmResourceDto.getJobtitle());
hrmResourceVersion.setMobile(params.getString("mobile")); hrmResourceVersion.setMobile(hrmResourceDto.getMobile());
hrmResourceVersion.setTelephone(params.getString("telephone")); hrmResourceVersion.setTelephone(hrmResourceDto.getTelephone());
String managerid = params.getString("managerid"); String managerid = hrmResourceDto.getManagerid();
hrmResourceVersion.setManagerid(StringUtils.isNotBlank(managerid) ? Integer.parseInt(managerid) : null); hrmResourceVersion.setManagerid(StringUtils.isNotBlank(managerid) ? Integer.parseInt(managerid) : null);
hrmResourceVersion.setLastname(params.getString("lastname")); hrmResourceVersion.setLastname(hrmResourceDto.getLastname());
hrmResourceVersion.setOperator(user.getLastname()); hrmResourceVersion.setOperator(user.getLastname());
hrmResourceVersion.setVersion(genVersionId(4, id)); hrmResourceVersion.setVersion(genVersionId(4, String.valueOf(id)));
hrmResourceVersion.setOperateTime(new Timestamp(OrganizationDateUtil.stringToDateTime(currentDate).getTime())); hrmResourceVersion.setOperateTime(new Timestamp(OrganizationDateUtil.stringToDateTime(currentDate).getTime()));
getCompanyVersionMapper().insertHrmResourceVersion(hrmResourceVersion); getCompanyVersionMapper().insertHrmResourceVersion(hrmResourceVersion);
@ -435,7 +439,7 @@ public class VersionManageServiceImpl extends Service implements VersionManageSe
id = 0.1 + hrmDepartmentVersion.getVersion(); id = 0.1 + hrmDepartmentVersion.getVersion();
} }
break; break;
case 3: case 4:
HrmResourceVersion hrmResourceVersion = getCompanyVersionMapper().getMaxHrmVersion(sid); HrmResourceVersion hrmResourceVersion = getCompanyVersionMapper().getMaxHrmVersion(sid);
if (null != hrmResourceVersion) { if (null != hrmResourceVersion) {
id = 0.1 + hrmResourceVersion.getVersion(); id = 0.1 + hrmResourceVersion.getVersion();

Loading…
Cancel
Save