禅道BUG修改-云服务器配置
This commit is contained in:
parent
7c74c48c9d
commit
493d60d185
|
|
@ -551,6 +551,8 @@ public class BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
protected InPostItemMapper inPostItemMapper;
|
protected InPostItemMapper inPostItemMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected InPostMapper inPostMapper;
|
||||||
|
|
||||||
//企业周边情况
|
//企业周边情况
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -570,6 +570,21 @@ public class PersonalController extends BaseController{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成企业行业清单(未生成的企业)
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
@ApiOperation(value = "生成企业行业清单(未生成的企业)", notes = "生成企业行业清单(未生成的企业)")
|
||||||
|
@GetMapping("/importInEntList")
|
||||||
|
@ResponseBody
|
||||||
|
public String importInEntList() throws Exception {
|
||||||
|
List<SysEnterprise>enterprises = sysEnterpriseMapper.selectNoEntList();
|
||||||
|
for (SysEnterprise s:enterprises) {
|
||||||
|
saveEntInList(s.getBaseinclassid(),s.getSysenterpriseid());
|
||||||
|
}
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成企业法人岗位和法人用户(未生产的企业)
|
* 生成企业法人岗位和法人用户(未生产的企业)
|
||||||
* @return list
|
* @return list
|
||||||
|
|
@ -583,6 +598,9 @@ public class PersonalController extends BaseController{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成企业岗位清单和岗位任务
|
* 生成企业岗位清单和岗位任务
|
||||||
* @return list
|
* @return list
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import com.common.utils.model.Code;
|
||||||
import com.common.utils.model.Message;
|
import com.common.utils.model.Message;
|
||||||
import com.common.utils.model.SingleResult;
|
import com.common.utils.model.SingleResult;
|
||||||
import com.rzyc.bean.OaTaskTime;
|
import com.rzyc.bean.OaTaskTime;
|
||||||
import com.rzyc.controller.BaseController;
|
|
||||||
import com.rzyc.enums.DelState;
|
import com.rzyc.enums.DelState;
|
||||||
import com.rzyc.mapper.EntPostListMapper;
|
import com.rzyc.mapper.EntPostListMapper;
|
||||||
import com.rzyc.mapper.EntPostTaskMapper;
|
import com.rzyc.mapper.EntPostTaskMapper;
|
||||||
|
|
@ -25,7 +24,6 @@ import com.rzyc.model.dto.AddOrUpdateEntUserPostListDto;
|
||||||
import com.rzyc.model.ent.EntPost;
|
import com.rzyc.model.ent.EntPost;
|
||||||
import com.rzyc.model.ent.EntUser;
|
import com.rzyc.model.ent.EntUser;
|
||||||
import com.rzyc.model.ent.InEntList;
|
import com.rzyc.model.ent.InEntList;
|
||||||
import com.rzyc.model.user.SysUser;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -107,23 +105,7 @@ public class AssignmentTaskThread implements Runnable{
|
||||||
addOrUpdateEntUserPostTaskDto.setStandard(ie.getStandard());
|
addOrUpdateEntUserPostTaskDto.setStandard(ie.getStandard());
|
||||||
insertListAndTask(addOrUpdateEntUserPostTaskDto,createByUserId);
|
insertListAndTask(addOrUpdateEntUserPostTaskDto,createByUserId);
|
||||||
}
|
}
|
||||||
//企业对应岗位的清单
|
//企业对应岗位的清单(这里是法人,不需要岗位履职)
|
||||||
EntPost entPost = entPostMapper.selectById(postId);
|
|
||||||
InPostItem inPostItem = inPostItemMapper.selectByPostId(entPost.getPublicPostId());
|
|
||||||
List<InPostList>inPostLists = inPostListMapper.selectByListId(null,inPostItem.getInPostItemId());
|
|
||||||
for (InPostList ipl:inPostLists) {
|
|
||||||
AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto = new AddOrUpdateEntUserPostListDto();
|
|
||||||
addOrUpdateEntUserPostTaskDto.setEntUserId(userId);
|
|
||||||
addOrUpdateEntUserPostTaskDto.setEnterpriseId(enterpriseId);
|
|
||||||
addOrUpdateEntUserPostTaskDto.setPostId(postId);
|
|
||||||
addOrUpdateEntUserPostTaskDto.setEntListId(ipl.getPublicPostListId());
|
|
||||||
addOrUpdateEntUserPostTaskDto.setFrequency(ipl.getFrequency());
|
|
||||||
addOrUpdateEntUserPostTaskDto.setItemContent(ipl.getPublicItemContent());
|
|
||||||
addOrUpdateEntUserPostTaskDto.setItemTitle(ipl.getPublicItemTitle());
|
|
||||||
addOrUpdateEntUserPostTaskDto.setListId(ipl.getListId());
|
|
||||||
addOrUpdateEntUserPostTaskDto.setStandard(ipl.getStandard());
|
|
||||||
insertListAndTask(addOrUpdateEntUserPostTaskDto,createByUserId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SingleResult insertListAndTask(AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto,String createByUserId) throws Exception {
|
private SingleResult insertListAndTask(AddOrUpdateEntUserPostListDto addOrUpdateEntUserPostTaskDto,String createByUserId) throws Exception {
|
||||||
|
|
@ -134,8 +116,8 @@ public class AssignmentTaskThread implements Runnable{
|
||||||
entPostList.setCreateBy(createByUserId);
|
entPostList.setCreateBy(createByUserId);
|
||||||
entPostList.setCreateTime(new Date());
|
entPostList.setCreateTime(new Date());
|
||||||
entPostList.setDelState(DelState.NOT_DEL.getState());
|
entPostList.setDelState(DelState.NOT_DEL.getState());
|
||||||
//默认当前年
|
|
||||||
entPostList.setPostListId(RandomNumber.getUUid());
|
entPostList.setPostListId(RandomNumber.getUUid());
|
||||||
|
//默认清单时间当前年
|
||||||
entPostList.setYearNum(calendar.get(Calendar.YEAR));
|
entPostList.setYearNum(calendar.get(Calendar.YEAR));
|
||||||
int result = entPostListMapper.insert(entPostList);
|
int result = entPostListMapper.insert(entPostList);
|
||||||
if (result != 1 ){
|
if (result != 1 ){
|
||||||
|
|
|
||||||
|
|
@ -848,7 +848,6 @@ public class PcBusinessService extends BaseController {
|
||||||
double finishPercent = Arith.div(finishCount,total) * 100;
|
double finishPercent = Arith.div(finishCount,total) * 100;
|
||||||
singleResult.setData(new BigDecimal(finishPercent).setScale(2, RoundingMode.DOWN).doubleValue());
|
singleResult.setData(new BigDecimal(finishPercent).setScale(2, RoundingMode.DOWN).doubleValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
return singleResult;
|
return singleResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1278,14 +1277,17 @@ public class PcBusinessService extends BaseController {
|
||||||
SingleResult singleResult = new SingleResult();
|
SingleResult singleResult = new SingleResult();
|
||||||
List<SysEnterprise>sysEnterprises = sysEnterpriseMapper.selectNoLegalPersonPost();
|
List<SysEnterprise>sysEnterprises = sysEnterpriseMapper.selectNoLegalPersonPost();
|
||||||
CopyOnWriteArrayList copyOnWriteArrayList = new CopyOnWriteArrayList();
|
CopyOnWriteArrayList copyOnWriteArrayList = new CopyOnWriteArrayList();
|
||||||
for (SysEnterprise s:sysEnterprises) {
|
for (SysEnterprise sysEnterprise:sysEnterprises) {
|
||||||
//创建或者修改企业用户
|
//创建或者修改企业用户
|
||||||
String userId = RandomNumber.getUUid();
|
String userId = RandomNumber.getUUid();
|
||||||
String postId = RandomNumber.getUUid();
|
String postId = RandomNumber.getUUid();
|
||||||
|
|
||||||
SaveEntPostAndUserThread SaveEntPostAndUserThread = new SaveEntPostAndUserThread(s.getSysenterpriseid(),getUserId(),entPostMapper,entUserMapper,constantsConfigure,s.getLegalrepre(),
|
SaveEntPostAndUserThread SaveEntPostAndUserThread = new SaveEntPostAndUserThread(sysEnterprise.getSysenterpriseid(),getUserId(),sysEnterprise.getWorkClassId(),entPostMapper,entUserMapper,constantsConfigure,sysEnterprise.getLegalrepre(),sysEnterprise.getLrlinktel(),sysEnterprise.getEntname(),userId,postId,copyOnWriteArrayList,inListMapper,inListItemMapper,entPostDutyMapper);
|
||||||
s.getLrlinktel(),s.getEntname(),copyOnWriteArrayList,postId,userId);
|
|
||||||
executor.execute(SaveEntPostAndUserThread);
|
executor.execute(SaveEntPostAndUserThread);
|
||||||
|
|
||||||
|
//创建多个行业岗位
|
||||||
|
SaveIndustryPostThread saveIndustryPost = new SaveIndustryPostThread(sysEnterprise.getWorkClassId(),sysEnterprise.getSysenterpriseid(),inPostMapper,inPostItemMapper,inPostListMapper,inListItemMapper,sysEnterpriseMapper,entPostMapper, entPostDutyMapper,false);
|
||||||
|
executor.execute(saveIndustryPost);
|
||||||
}
|
}
|
||||||
return singleResult;
|
return singleResult;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.rzyc.service;
|
||||||
|
|
||||||
import com.common.utils.RandomNumber;
|
import com.common.utils.RandomNumber;
|
||||||
import com.common.utils.copy.ObjectConversion;
|
import com.common.utils.copy.ObjectConversion;
|
||||||
|
import com.rzyc.enums.PostListType;
|
||||||
import com.rzyc.mapper.ent.InEntListMapper;
|
import com.rzyc.mapper.ent.InEntListMapper;
|
||||||
import com.rzyc.mapper.ent.InListItemMapper;
|
import com.rzyc.mapper.ent.InListItemMapper;
|
||||||
import com.rzyc.model.ent.InEntList;
|
import com.rzyc.model.ent.InEntList;
|
||||||
|
|
@ -53,7 +54,7 @@ public class SaveEntListThread implements Runnable{
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void saveEntInList(String industryId,String companyId)throws Exception{
|
public void saveEntInList(String industryId,String companyId)throws Exception{
|
||||||
List<InListItem> inListItem = inListItemMapper.selectContents(industryId,null,null);
|
List<InListItem> inListItem = inListItemMapper.selectContents(industryId,null, PostListType.LIST_TYPE_NO.getType());
|
||||||
List<InEntList> entLists = ObjectConversion.copy(inListItem,InEntList.class);
|
List<InEntList> entLists = ObjectConversion.copy(inListItem,InEntList.class);
|
||||||
for (InEntList in:entLists) {
|
for (InEntList in:entLists) {
|
||||||
in.setEnterpriseId(companyId);
|
in.setEnterpriseId(companyId);
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,24 @@
|
||||||
package com.rzyc.service;
|
package com.rzyc.service;
|
||||||
|
|
||||||
|
import com.alibaba.excel.util.ListUtils;
|
||||||
import com.common.utils.RandomNumber;
|
import com.common.utils.RandomNumber;
|
||||||
import com.common.utils.encryption.MD5;
|
import com.common.utils.encryption.MD5;
|
||||||
import com.rzyc.config.ConstantsConfigure;
|
import com.rzyc.config.ConstantsConfigure;
|
||||||
|
import com.rzyc.enums.PostListType;
|
||||||
import com.rzyc.mapper.EntPostDutyMapper;
|
import com.rzyc.mapper.EntPostDutyMapper;
|
||||||
import com.rzyc.mapper.ent.EntPostMapper;
|
import com.rzyc.mapper.ent.EntPostMapper;
|
||||||
import com.rzyc.mapper.ent.EntUserMapper;
|
import com.rzyc.mapper.ent.EntUserMapper;
|
||||||
import com.rzyc.mapper.ent.InEntListMapper;
|
import com.rzyc.mapper.ent.InListItemMapper;
|
||||||
|
import com.rzyc.mapper.ent.InListMapper;
|
||||||
import com.rzyc.model.EntPostDuty;
|
import com.rzyc.model.EntPostDuty;
|
||||||
|
import com.rzyc.model.InPost;
|
||||||
|
import com.rzyc.model.InPostItem;
|
||||||
import com.rzyc.model.ent.EntPost;
|
import com.rzyc.model.ent.EntPost;
|
||||||
import com.rzyc.model.ent.EntUser;
|
import com.rzyc.model.ent.EntUser;
|
||||||
import com.rzyc.model.ent.InEntList;
|
import com.rzyc.model.ent.InList;
|
||||||
|
import com.rzyc.model.ent.InListItem;
|
||||||
|
import com.rzyc.utils.SpringUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
@ -45,21 +51,39 @@ public class SaveEntPostAndUserThread implements Runnable {
|
||||||
|
|
||||||
private String entName;
|
private String entName;
|
||||||
|
|
||||||
private CopyOnWriteArrayList copyOnWriteArrayList;
|
|
||||||
|
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|
||||||
|
private String industryId;
|
||||||
|
|
||||||
private String postId;
|
private String postId;
|
||||||
|
|
||||||
|
private CopyOnWriteArrayList copyOnWriteArrayList;
|
||||||
|
|
||||||
|
private InListMapper inListMapper;
|
||||||
|
|
||||||
|
private InListItemMapper inListItemMapper;
|
||||||
|
|
||||||
|
private EntPostDutyMapper entPostDutyMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每隔5条存储数据库,实际使用中可以100条,然后清理list ,方便内存回收
|
||||||
|
*/
|
||||||
|
private static final int BATCH_COUNT = 100;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业岗位职责-缓存数据
|
||||||
|
* */
|
||||||
|
private List<EntPostDuty>entPostDutyList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
|
||||||
|
|
||||||
|
|
||||||
|
public SaveEntPostAndUserThread(String enterpriseId, String createBy, String industryId,EntPostMapper entPostMapper, EntUserMapper entUserMapper, ConstantsConfigure constantsConfigure,
|
||||||
public SaveEntPostAndUserThread(String enterpriseId, String createBy, EntPostMapper entPostMapper, EntUserMapper entUserMapper, ConstantsConfigure constantsConfigure,
|
String name, String phone, String entName,String userId,String postId, CopyOnWriteArrayList copyOnWriteArrayList,
|
||||||
String name, String phone, String entName, CopyOnWriteArrayList copyOnWriteArrayList, String postId, String userId) {
|
InListMapper inListMapper,InListItemMapper inListItemMapper,EntPostDutyMapper entPostDutyMapper) {
|
||||||
this.enterpriseId = enterpriseId;
|
this.enterpriseId = enterpriseId;
|
||||||
if (null != createBy){
|
if (null != createBy){
|
||||||
this.createBy = createBy;
|
this.createBy = createBy;
|
||||||
}
|
}
|
||||||
|
this.industryId = industryId;
|
||||||
this.entPostMapper = entPostMapper;
|
this.entPostMapper = entPostMapper;
|
||||||
this.entUserMapper = entUserMapper;
|
this.entUserMapper = entUserMapper;
|
||||||
this.constantsConfigure = constantsConfigure;
|
this.constantsConfigure = constantsConfigure;
|
||||||
|
|
@ -67,8 +91,11 @@ public class SaveEntPostAndUserThread implements Runnable {
|
||||||
this.phone = phone;
|
this.phone = phone;
|
||||||
this.entName = entName;
|
this.entName = entName;
|
||||||
this.copyOnWriteArrayList = copyOnWriteArrayList;
|
this.copyOnWriteArrayList = copyOnWriteArrayList;
|
||||||
this.postId = postId;
|
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
|
this.postId = postId;
|
||||||
|
this.inListMapper = inListMapper;
|
||||||
|
this.inListItemMapper = inListItemMapper;
|
||||||
|
this.entPostDutyMapper = entPostDutyMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -93,7 +120,6 @@ public class SaveEntPostAndUserThread implements Runnable {
|
||||||
entPostMapper.deletePostOfLegalPerson(legalPerson,enterpriseId);
|
entPostMapper.deletePostOfLegalPerson(legalPerson,enterpriseId);
|
||||||
entPostMapper.insertEntPost(entPost);
|
entPostMapper.insertEntPost(entPost);
|
||||||
|
|
||||||
|
|
||||||
//存企业用户
|
//存企业用户
|
||||||
EntUser entUser = new EntUser();
|
EntUser entUser = new EntUser();
|
||||||
entUser.setEntUserId(userId);
|
entUser.setEntUserId(userId);
|
||||||
|
|
@ -118,6 +144,44 @@ public class SaveEntPostAndUserThread implements Runnable {
|
||||||
copyOnWriteArrayList.add(phone);
|
copyOnWriteArrayList.add(phone);
|
||||||
entUserMapper.deleteLegalPerson(legalPerson,enterpriseId);
|
entUserMapper.deleteLegalPerson(legalPerson,enterpriseId);
|
||||||
entUserMapper.insert(entUser);
|
entUserMapper.insert(entUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void doing(){
|
||||||
|
List<InList> inLists = inListMapper.findAll(industryId);
|
||||||
|
for (InList i:inLists) {
|
||||||
|
//批量插入企业岗位职责
|
||||||
|
List<InListItem> list = inListItemMapper.selectContents(null,i.getListId(), PostListType.LIST_TYPE_NO.getType());
|
||||||
|
for (InListItem ili:list) {
|
||||||
|
addEntPostDuty(ili,postId,enterpriseId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finishLastList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void addEntPostDuty(InListItem ili,String postId,String sysEnterpriseId){
|
||||||
|
if (entPostDutyList.size() == BATCH_COUNT){
|
||||||
|
entPostDutyMapper.insertList(entPostDutyList);
|
||||||
|
entPostDutyList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
|
||||||
|
}else {
|
||||||
|
EntPostDuty entPostDuty = new EntPostDuty();
|
||||||
|
entPostDuty.setDutyId(RandomNumber.getUUid());
|
||||||
|
entPostDuty.setPostId(postId);
|
||||||
|
entPostDuty.setDutyItem(ili.getItemContent());
|
||||||
|
entPostDuty.setSortId(ili.getSortId());
|
||||||
|
entPostDuty.setEnterpriseId(sysEnterpriseId);
|
||||||
|
entPostDuty.setCreateTime(new Date());
|
||||||
|
entPostDuty.setCreateBy("导入");
|
||||||
|
entPostDutyList.add(entPostDuty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void finishLastList(){
|
||||||
|
if (null != entPostDutyList && entPostDutyList.size() > 0){
|
||||||
|
entPostDutyMapper.insertList(entPostDutyList);
|
||||||
|
entPostDutyList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,20 @@ package com.rzyc.service;
|
||||||
|
|
||||||
import com.alibaba.excel.util.ListUtils;
|
import com.alibaba.excel.util.ListUtils;
|
||||||
import com.common.utils.RandomNumber;
|
import com.common.utils.RandomNumber;
|
||||||
import com.rzyc.mapper.EntPostDutyMapper;
|
import com.rzyc.enums.PostListType;
|
||||||
import com.rzyc.mapper.InPostItemMapper;
|
import com.rzyc.mapper.*;
|
||||||
import com.rzyc.mapper.InPostListMapper;
|
|
||||||
import com.rzyc.mapper.InPostMapper;
|
|
||||||
import com.rzyc.mapper.ent.EntPostMapper;
|
import com.rzyc.mapper.ent.EntPostMapper;
|
||||||
import com.rzyc.mapper.ent.InListItemMapper;
|
import com.rzyc.mapper.ent.InListItemMapper;
|
||||||
import com.rzyc.mapper.ent.SysEnterpriseMapper;
|
import com.rzyc.mapper.ent.SysEnterpriseMapper;
|
||||||
import com.rzyc.model.EntPostDuty;
|
import com.rzyc.model.*;
|
||||||
import com.rzyc.model.InPost;
|
import com.rzyc.model.EasyExcel.EasyExcelEnterprise;
|
||||||
import com.rzyc.model.InPostItem;
|
import com.rzyc.model.ent.InEntList;
|
||||||
|
import com.rzyc.model.ent.InList;
|
||||||
import com.rzyc.model.ent.InListItem;
|
import com.rzyc.model.ent.InListItem;
|
||||||
import com.rzyc.model.ent.SysEnterprise;
|
import com.rzyc.model.ent.SysEnterprise;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -77,6 +77,8 @@ public class SaveIndustryPostThread implements Runnable {
|
||||||
* */
|
* */
|
||||||
private String sysEnterpriseId;
|
private String sysEnterpriseId;
|
||||||
|
|
||||||
|
private boolean batch;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 每隔5条存储数据库,实际使用中可以100条,然后清理list ,方便内存回收
|
* 每隔5条存储数据库,实际使用中可以100条,然后清理list ,方便内存回收
|
||||||
*/
|
*/
|
||||||
|
|
@ -89,7 +91,7 @@ public class SaveIndustryPostThread implements Runnable {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public SaveIndustryPostThread(String industryId,String sysEnterpriseId,InPostMapper inPostMapper, InPostItemMapper inPostItemMapper, InPostListMapper inPostListMapper,
|
public SaveIndustryPostThread(String industryId,String sysEnterpriseId,InPostMapper inPostMapper, InPostItemMapper inPostItemMapper, InPostListMapper inPostListMapper,
|
||||||
InListItemMapper inListItemMapper, SysEnterpriseMapper sysEnterpriseMapper, EntPostMapper entPostMapper, EntPostDutyMapper entPostDutyMapper) {
|
InListItemMapper inListItemMapper, SysEnterpriseMapper sysEnterpriseMapper, EntPostMapper entPostMapper, EntPostDutyMapper entPostDutyMapper,boolean batch) {
|
||||||
this.industryId = industryId;
|
this.industryId = industryId;
|
||||||
this.inPostMapper = inPostMapper;
|
this.inPostMapper = inPostMapper;
|
||||||
this.inPostItemMapper = inPostItemMapper;
|
this.inPostItemMapper = inPostItemMapper;
|
||||||
|
|
@ -99,9 +101,32 @@ public class SaveIndustryPostThread implements Runnable {
|
||||||
this.entPostMapper = entPostMapper;
|
this.entPostMapper = entPostMapper;
|
||||||
this.entPostDutyMapper = entPostDutyMapper;
|
this.entPostDutyMapper = entPostDutyMapper;
|
||||||
this.sysEnterpriseId = sysEnterpriseId;
|
this.sysEnterpriseId = sysEnterpriseId;
|
||||||
|
this.batch = batch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void batchSave(){
|
||||||
|
List<SysEnterprise> sysEnterprise = sysEnterpriseMapper.findAll();
|
||||||
|
for (SysEnterprise s:sysEnterprise) {
|
||||||
|
List<InPost> inPost = inPostMapper.selectByIndustryId(s.getWorkClassId());
|
||||||
|
if (null != inPost && inPost.size() > 0){
|
||||||
|
//批量插入岗位
|
||||||
|
entPostMapper.insertEntPostBatch(inPost,s.getSysenterpriseid());
|
||||||
|
|
||||||
|
for (InPost i:inPost) {
|
||||||
|
//查询中间表企业岗位清单
|
||||||
|
InPostItem inPostItems = inPostItemMapper.selectByPostId(i.getPublicPostId());
|
||||||
|
|
||||||
|
//批量插入企业岗位职责
|
||||||
|
List<InListItem> list = inListItemMapper.selectContents(null,inPostItems.getInPostItemId(), PostListType.LIST_TYPE_IS.getType());
|
||||||
|
for (InListItem ili:list) {
|
||||||
|
addEntPostDuty(ili,i.getUuid(),s.getSysenterpriseid());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finishLastList();
|
||||||
|
}
|
||||||
|
|
||||||
public void doing(){
|
public void doing(){
|
||||||
List<InPost> inPost = inPostMapper.selectByIndustryId(industryId);
|
List<InPost> inPost = inPostMapper.selectByIndustryId(industryId);
|
||||||
|
|
@ -113,13 +138,15 @@ public class SaveIndustryPostThread implements Runnable {
|
||||||
InPostItem inPostItems = inPostItemMapper.selectByPostId(i.getPublicPostId());
|
InPostItem inPostItems = inPostItemMapper.selectByPostId(i.getPublicPostId());
|
||||||
|
|
||||||
//批量插入企业岗位职责
|
//批量插入企业岗位职责
|
||||||
List<InListItem> list = inListItemMapper.selectContents(null,inPostItems.getInPostItemId(),null);
|
List<InListItem> list = inListItemMapper.selectContents(null,inPostItems.getInPostItemId(), PostListType.LIST_TYPE_IS.getType());
|
||||||
for (InListItem ili:list) {
|
for (InListItem ili:list) {
|
||||||
addEntPostDuty(ili,i.getUuid(),sysEnterpriseId);
|
addEntPostDuty(ili,i.getUuid(),sysEnterpriseId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
finishLastList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void addEntPostDuty(InListItem ili,String postId,String sysEnterpriseId){
|
private void addEntPostDuty(InListItem ili,String postId,String sysEnterpriseId){
|
||||||
if (entPostDutyList.size() == BATCH_COUNT){
|
if (entPostDutyList.size() == BATCH_COUNT){
|
||||||
entPostDutyMapper.insertList(entPostDutyList);
|
entPostDutyMapper.insertList(entPostDutyList);
|
||||||
|
|
@ -137,9 +164,19 @@ public class SaveIndustryPostThread implements Runnable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void finishLastList(){
|
||||||
|
entPostDutyMapper.insertList(entPostDutyList);
|
||||||
|
entPostDutyList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (batch == true){
|
||||||
|
batchSave();
|
||||||
|
}else {
|
||||||
doing();
|
doing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3,12 +3,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
redis:
|
redis:
|
||||||
host: 42.193.40.239
|
host: 42.193.40.239
|
||||||
Auth: redis@rzyc123456
|
port: 6378
|
||||||
# 进入哨兵项目-这个端口就不用了,除非是单体
|
|
||||||
# port: 6379
|
|
||||||
sentinel:
|
|
||||||
master: mymaster
|
|
||||||
nodes: 42.193.40.239:26379,42.193.40.239:26380,42.193.40.239:26381
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: 8
|
max-active: 8
|
||||||
|
|
@ -16,6 +11,7 @@ spring:
|
||||||
min-idle: 0
|
min-idle: 0
|
||||||
max-wait: 100
|
max-wait: 100
|
||||||
shutdown-timeout: 50000
|
shutdown-timeout: 50000
|
||||||
|
Auth: redis@rzyc123456
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
redis:
|
redis:
|
||||||
host: 42.193.40.239
|
host: 42.193.40.239
|
||||||
Auth: redis@rzyc123456
|
port: 6378
|
||||||
# 进入哨兵项目-这个端口就不用了,除非是单体
|
|
||||||
# port: 6379
|
|
||||||
sentinel:
|
|
||||||
master: mymaster
|
|
||||||
nodes: 42.193.40.239:26379,42.193.40.239:26380,42.193.40.239:26381
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: 8
|
max-active: 8
|
||||||
|
|
@ -17,6 +12,7 @@ spring:
|
||||||
min-idle: 0
|
min-idle: 0
|
||||||
max-wait: 100
|
max-wait: 100
|
||||||
shutdown-timeout: 50000
|
shutdown-timeout: 50000
|
||||||
|
Auth: redis@rzyc123456
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ spring:
|
||||||
min-idle: 0
|
min-idle: 0
|
||||||
max-wait: 100
|
max-wait: 100
|
||||||
shutdown-timeout: 50000
|
shutdown-timeout: 50000
|
||||||
password: gzQdzRedis
|
Auth: gzQdzRedis
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: yun #设定打包配置文件
|
active: dev #设定打包配置文件
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,7 @@ spring:
|
||||||
max-request-size: 100MB
|
max-request-size: 100MB
|
||||||
redis:
|
redis:
|
||||||
host: 42.193.40.239
|
host: 42.193.40.239
|
||||||
Auth: redis@rzyc123456
|
port: 6378
|
||||||
# 进入哨兵项目-这个端口就不用了,除非是单体
|
|
||||||
# port: 6379
|
|
||||||
sentinel:
|
|
||||||
master: mymaster
|
|
||||||
nodes: 42.193.40.239:26379,42.193.40.239:26380,42.193.40.239:26381
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: 8
|
max-active: 8
|
||||||
|
|
@ -22,6 +17,7 @@ spring:
|
||||||
min-idle: 0
|
min-idle: 0
|
||||||
max-wait: 100
|
max-wait: 100
|
||||||
shutdown-timeout: 50000
|
shutdown-timeout: 50000
|
||||||
|
Auth: redis@rzyc123456
|
||||||
mvc:
|
mvc:
|
||||||
view:
|
view:
|
||||||
prefix: classpath:/templates/
|
prefix: classpath:/templates/
|
||||||
|
|
@ -29,6 +25,17 @@ spring:
|
||||||
devtools:
|
devtools:
|
||||||
restart:
|
restart:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
thymeleaf:
|
thymeleaf:
|
||||||
cache: false
|
cache: false
|
||||||
resources:
|
resources:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: yun #设定打包配置文件
|
active: dev #设定打包配置文件
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user