禅道BUG修改-云服务器配置

This commit is contained in:
79493 2023-05-15 11:42:03 +08:00
parent 7c74c48c9d
commit 493d60d185
13 changed files with 174 additions and 69 deletions

View File

@ -551,6 +551,8 @@ public class BaseController {
@Autowired
protected InPostItemMapper inPostItemMapper;
@Autowired
protected InPostMapper inPostMapper;
//企业周边情况
@Autowired

View File

@ -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
@ -583,6 +598,9 @@ public class PersonalController extends BaseController{
}
/**
* 生成企业岗位清单和岗位任务
* @return list

View File

@ -8,7 +8,6 @@ import com.common.utils.model.Code;
import com.common.utils.model.Message;
import com.common.utils.model.SingleResult;
import com.rzyc.bean.OaTaskTime;
import com.rzyc.controller.BaseController;
import com.rzyc.enums.DelState;
import com.rzyc.mapper.EntPostListMapper;
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.EntUser;
import com.rzyc.model.ent.InEntList;
import com.rzyc.model.user.SysUser;
import org.springframework.beans.BeanUtils;
import java.util.*;
@ -35,7 +33,7 @@ import java.util.*;
* @author Xuwanxin
* @date 2022/12/8
* */
public class AssignmentTaskThread implements Runnable{
public class AssignmentTaskThread implements Runnable{
private String entUserId;
@ -61,7 +59,7 @@ public class AssignmentTaskThread implements Runnable{
private EntPostMapper entPostMapper;
public AssignmentTaskThread(String entUser, String enterpriseId, String postId, EntPostListMapper entPostListMapper, EntPostTaskMapper entPostTaskMapper,
InEntListMapper inEntListMapper, String createByUserId, InPostListMapper inPostListMapper, InPostItemMapper inPostItemMapper,EntUserMapper entUserMapper, EntPostMapper entPostMapper) {
InEntListMapper inEntListMapper, String createByUserId, InPostListMapper inPostListMapper, InPostItemMapper inPostItemMapper, EntUserMapper entUserMapper, EntPostMapper entPostMapper) {
this.entUserId = entUser;
this.enterpriseId = enterpriseId;
this.postId = postId;
@ -107,23 +105,7 @@ public class AssignmentTaskThread implements Runnable{
addOrUpdateEntUserPostTaskDto.setStandard(ie.getStandard());
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 {
@ -134,8 +116,8 @@ public class AssignmentTaskThread implements Runnable{
entPostList.setCreateBy(createByUserId);
entPostList.setCreateTime(new Date());
entPostList.setDelState(DelState.NOT_DEL.getState());
//默认当前年
entPostList.setPostListId(RandomNumber.getUUid());
//默认清单时间当前年
entPostList.setYearNum(calendar.get(Calendar.YEAR));
int result = entPostListMapper.insert(entPostList);
if (result != 1 ){

View File

@ -848,7 +848,6 @@ public class PcBusinessService extends BaseController {
double finishPercent = Arith.div(finishCount,total) * 100;
singleResult.setData(new BigDecimal(finishPercent).setScale(2, RoundingMode.DOWN).doubleValue());
}
return singleResult;
}
@ -1278,14 +1277,17 @@ public class PcBusinessService extends BaseController {
SingleResult singleResult = new SingleResult();
List<SysEnterprise>sysEnterprises = sysEnterpriseMapper.selectNoLegalPersonPost();
CopyOnWriteArrayList copyOnWriteArrayList = new CopyOnWriteArrayList();
for (SysEnterprise s:sysEnterprises) {
for (SysEnterprise sysEnterprise:sysEnterprises) {
//创建或者修改企业用户
String userId = RandomNumber.getUUid();
String postId = RandomNumber.getUUid();
SaveEntPostAndUserThread SaveEntPostAndUserThread = new SaveEntPostAndUserThread(s.getSysenterpriseid(),getUserId(),entPostMapper,entUserMapper,constantsConfigure,s.getLegalrepre(),
s.getLrlinktel(),s.getEntname(),copyOnWriteArrayList,postId,userId);
SaveEntPostAndUserThread SaveEntPostAndUserThread = new SaveEntPostAndUserThread(sysEnterprise.getSysenterpriseid(),getUserId(),sysEnterprise.getWorkClassId(),entPostMapper,entUserMapper,constantsConfigure,sysEnterprise.getLegalrepre(),sysEnterprise.getLrlinktel(),sysEnterprise.getEntname(),userId,postId,copyOnWriteArrayList,inListMapper,inListItemMapper,entPostDutyMapper);
executor.execute(SaveEntPostAndUserThread);
//创建多个行业岗位
SaveIndustryPostThread saveIndustryPost = new SaveIndustryPostThread(sysEnterprise.getWorkClassId(),sysEnterprise.getSysenterpriseid(),inPostMapper,inPostItemMapper,inPostListMapper,inListItemMapper,sysEnterpriseMapper,entPostMapper, entPostDutyMapper,false);
executor.execute(saveIndustryPost);
}
return singleResult;
}

View File

@ -2,6 +2,7 @@ package com.rzyc.service;
import com.common.utils.RandomNumber;
import com.common.utils.copy.ObjectConversion;
import com.rzyc.enums.PostListType;
import com.rzyc.mapper.ent.InEntListMapper;
import com.rzyc.mapper.ent.InListItemMapper;
import com.rzyc.model.ent.InEntList;
@ -53,7 +54,7 @@ public class SaveEntListThread implements Runnable{
* @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);
for (InEntList in:entLists) {
in.setEnterpriseId(companyId);

View File

@ -1,18 +1,24 @@
package com.rzyc.service;
import com.alibaba.excel.util.ListUtils;
import com.common.utils.RandomNumber;
import com.common.utils.encryption.MD5;
import com.rzyc.config.ConstantsConfigure;
import com.rzyc.enums.PostListType;
import com.rzyc.mapper.EntPostDutyMapper;
import com.rzyc.mapper.ent.EntPostMapper;
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.InPost;
import com.rzyc.model.InPostItem;
import com.rzyc.model.ent.EntPost;
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.List;
import java.util.concurrent.CopyOnWriteArrayList;
@ -45,21 +51,39 @@ public class SaveEntPostAndUserThread implements Runnable {
private String entName;
private CopyOnWriteArrayList copyOnWriteArrayList;
private String userId;
private String industryId;
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, EntPostMapper entPostMapper, EntUserMapper entUserMapper, ConstantsConfigure constantsConfigure,
String name, String phone, String entName, CopyOnWriteArrayList copyOnWriteArrayList, String postId, String userId) {
public SaveEntPostAndUserThread(String enterpriseId, String createBy, String industryId,EntPostMapper entPostMapper, EntUserMapper entUserMapper, ConstantsConfigure constantsConfigure,
String name, String phone, String entName,String userId,String postId, CopyOnWriteArrayList copyOnWriteArrayList,
InListMapper inListMapper,InListItemMapper inListItemMapper,EntPostDutyMapper entPostDutyMapper) {
this.enterpriseId = enterpriseId;
if (null != createBy){
this.createBy = createBy;
}
this.industryId = industryId;
this.entPostMapper = entPostMapper;
this.entUserMapper = entUserMapper;
this.constantsConfigure = constantsConfigure;
@ -67,8 +91,11 @@ public class SaveEntPostAndUserThread implements Runnable {
this.phone = phone;
this.entName = entName;
this.copyOnWriteArrayList = copyOnWriteArrayList;
this.postId = postId;
this.userId = userId;
this.postId = postId;
this.inListMapper = inListMapper;
this.inListItemMapper = inListItemMapper;
this.entPostDutyMapper = entPostDutyMapper;
}
@Override
@ -93,7 +120,6 @@ public class SaveEntPostAndUserThread implements Runnable {
entPostMapper.deletePostOfLegalPerson(legalPerson,enterpriseId);
entPostMapper.insertEntPost(entPost);
//存企业用户
EntUser entUser = new EntUser();
entUser.setEntUserId(userId);
@ -118,6 +144,44 @@ public class SaveEntPostAndUserThread implements Runnable {
copyOnWriteArrayList.add(phone);
entUserMapper.deleteLegalPerson(legalPerson,enterpriseId);
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);
}
}
}

View File

@ -3,20 +3,20 @@ package com.rzyc.service;
import com.alibaba.excel.util.ListUtils;
import com.common.utils.RandomNumber;
import com.rzyc.mapper.EntPostDutyMapper;
import com.rzyc.mapper.InPostItemMapper;
import com.rzyc.mapper.InPostListMapper;
import com.rzyc.mapper.InPostMapper;
import com.rzyc.enums.PostListType;
import com.rzyc.mapper.*;
import com.rzyc.mapper.ent.EntPostMapper;
import com.rzyc.mapper.ent.InListItemMapper;
import com.rzyc.mapper.ent.SysEnterpriseMapper;
import com.rzyc.model.EntPostDuty;
import com.rzyc.model.InPost;
import com.rzyc.model.InPostItem;
import com.rzyc.model.*;
import com.rzyc.model.EasyExcel.EasyExcelEnterprise;
import com.rzyc.model.ent.InEntList;
import com.rzyc.model.ent.InList;
import com.rzyc.model.ent.InListItem;
import com.rzyc.model.ent.SysEnterprise;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -77,6 +77,8 @@ public class SaveIndustryPostThread implements Runnable {
* */
private String sysEnterpriseId;
private boolean batch;
/**
* 每隔5条存储数据库实际使用中可以100条然后清理list 方便内存回收
*/
@ -88,8 +90,8 @@ public class SaveIndustryPostThread implements Runnable {
private List<EntPostDuty>entPostDutyList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Autowired
public SaveIndustryPostThread(String industryId, String sysEnterpriseId, InPostMapper inPostMapper, InPostItemMapper inPostItemMapper, InPostListMapper inPostListMapper,
InListItemMapper inListItemMapper, SysEnterpriseMapper sysEnterpriseMapper, EntPostMapper entPostMapper, EntPostDutyMapper entPostDutyMapper) {
public SaveIndustryPostThread(String industryId,String sysEnterpriseId,InPostMapper inPostMapper, InPostItemMapper inPostItemMapper, InPostListMapper inPostListMapper,
InListItemMapper inListItemMapper, SysEnterpriseMapper sysEnterpriseMapper, EntPostMapper entPostMapper, EntPostDutyMapper entPostDutyMapper,boolean batch) {
this.industryId = industryId;
this.inPostMapper = inPostMapper;
this.inPostItemMapper = inPostItemMapper;
@ -99,9 +101,32 @@ public class SaveIndustryPostThread implements Runnable {
this.entPostMapper = entPostMapper;
this.entPostDutyMapper = entPostDutyMapper;
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(){
List<InPost> inPost = inPostMapper.selectByIndustryId(industryId);
@ -113,13 +138,15 @@ public class SaveIndustryPostThread implements Runnable {
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) {
addEntPostDuty(ili,i.getUuid(),sysEnterpriseId);
}
}
finishLastList();
}
private void addEntPostDuty(InListItem ili,String postId,String sysEnterpriseId){
if (entPostDutyList.size() == BATCH_COUNT){
entPostDutyMapper.insertList(entPostDutyList);
@ -137,9 +164,19 @@ public class SaveIndustryPostThread implements Runnable {
}
}
private void finishLastList(){
entPostDutyMapper.insertList(entPostDutyList);
entPostDutyList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
@Override
public void run() {
doing();
if (batch == true){
batchSave();
}else {
doing();
}
}
}

View File

@ -3,12 +3,7 @@ server:
spring:
redis:
host: 42.193.40.239
Auth: redis@rzyc123456
# 进入哨兵项目-这个端口就不用了,除非是单体
# port: 6379
sentinel:
master: mymaster
nodes: 42.193.40.239:26379,42.193.40.239:26380,42.193.40.239:26381
port: 6378
lettuce:
pool:
max-active: 8
@ -16,6 +11,7 @@ spring:
min-idle: 0
max-wait: 100
shutdown-timeout: 50000
Auth: redis@rzyc123456
servlet:
multipart:
enabled: true

View File

@ -4,12 +4,7 @@ server:
spring:
redis:
host: 42.193.40.239
Auth: redis@rzyc123456
# 进入哨兵项目-这个端口就不用了,除非是单体
# port: 6379
sentinel:
master: mymaster
nodes: 42.193.40.239:26379,42.193.40.239:26380,42.193.40.239:26381
port: 6378
lettuce:
pool:
max-active: 8
@ -17,6 +12,7 @@ spring:
min-idle: 0
max-wait: 100
shutdown-timeout: 50000
Auth: redis@rzyc123456
servlet:
multipart:
enabled: true

View File

@ -16,7 +16,7 @@ spring:
min-idle: 0
max-wait: 100
shutdown-timeout: 50000
password: gzQdzRedis
Auth: gzQdzRedis
servlet:
multipart:
enabled: true

View File

@ -1,6 +1,6 @@
spring:
profiles:
active: yun #设定打包配置文件
active: dev #设定打包配置文件

View File

@ -9,12 +9,7 @@ spring:
max-request-size: 100MB
redis:
host: 42.193.40.239
Auth: redis@rzyc123456
# 进入哨兵项目-这个端口就不用了,除非是单体
# port: 6379
sentinel:
master: mymaster
nodes: 42.193.40.239:26379,42.193.40.239:26380,42.193.40.239:26381
port: 6378
lettuce:
pool:
max-active: 8
@ -22,6 +17,7 @@ spring:
min-idle: 0
max-wait: 100
shutdown-timeout: 50000
Auth: redis@rzyc123456
mvc:
view:
prefix: classpath:/templates/
@ -29,6 +25,17 @@ spring:
devtools:
restart:
enabled: true
thymeleaf:
cache: false
resources:

View File

@ -1,6 +1,6 @@
spring:
profiles:
active: yun #设定打包配置文件
active: dev #设定打包配置文件