Commit e0f06961 authored by huyuchen's avatar huyuchen

优化修改

parent b508c820
...@@ -104,6 +104,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -104,6 +104,9 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda() TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, tEmpChangeInfo.getDeptNo()).eq(TSettleDomain::getDepartName, tEmpChangeInfo.getNewSettle()) .eq(TSettleDomain::getDepartNo, tEmpChangeInfo.getDeptNo()).eq(TSettleDomain::getDepartName, tEmpChangeInfo.getNewSettle())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)); .eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
return R.failed("对应项目编码的项目已停止合作");
}
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeeProject.getId()); TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeeProject.getId());
updateTEmployeeProject.setDeptNo(tEmpChangeInfo.getDeptNo()); updateTEmployeeProject.setDeptNo(tEmpChangeInfo.getDeptNo());
updateTEmployeeProject.setDeptId(tEmpChangeInfo.getDeptId()); updateTEmployeeProject.setDeptId(tEmpChangeInfo.getDeptId());
......
...@@ -482,7 +482,7 @@ public interface ErrorCodes { ...@@ -482,7 +482,7 @@ public interface ErrorCodes {
*/ */
String EMP_DISPATCH_EMP_NOT_EMPTY = "emp.dispatch.emp.not.empty"; String EMP_DISPATCH_EMP_NOT_EMPTY = "emp.dispatch.emp.not.empty";
/** /**
* 派增异常: 对应项目编码已停止合作 * 派增异常:对应项目编码的项目已冻结/已停止合作
*/ */
String EMP_DISPATCH_SETTLEDOMAIN_STOP = "emp.dispatch.settleDomain.stop"; String EMP_DISPATCH_SETTLEDOMAIN_STOP = "emp.dispatch.settleDomain.stop";
/** /**
......
...@@ -102,7 +102,7 @@ archives.project.change.contract.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0 ...@@ -102,7 +102,7 @@ archives.project.change.contract.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0
archives.project.emp.lose.fee.not.empty=\u4E0D\u826F\u8BB0\u5F55\u8D39\u7528\u635F\u5931\u548C\u5176\u4ED6\u635F\u5931\u4E0D\u53EF\u540C\u65F6\u4E3A\u7A7A archives.project.emp.lose.fee.not.empty=\u4E0D\u826F\u8BB0\u5F55\u8D39\u7528\u635F\u5931\u548C\u5176\u4ED6\u635F\u5931\u4E0D\u53EF\u540C\u65F6\u4E3A\u7A7A
qt.project.change.not.exist=\u4EBA\u5458\u5728\u539F\u9879\u76EE\u4E2D\u5B58\u5728\u5728\u9014\u7684\u670D\u52A1\uFF0C\u8BF7\u5148\u7EC8\u6B62\u540E\uFF0C\u518D\u8FDB\u884C\u5212\u8F6C qt.project.change.not.exist=\u4EBA\u5458\u5728\u539F\u9879\u76EE\u4E2D\u5B58\u5728\u5728\u9014\u7684\u670D\u52A1\uFF0C\u8BF7\u5148\u7EC8\u6B62\u540E\uFF0C\u518D\u8FDB\u884C\u5212\u8F6C
project.search.not.exist=\u672A\u627E\u5230\u5BF9\u5E94\u7684\u9879\u76EE\u6216\u8005\u9879\u76EE\u5DF2\u505C\u6B62\u5408\u4F5C\uFF0C\u8BF7\u6838\u5B9E project.search.not.exist=\u672A\u627E\u5230\u5BF9\u5E94\u7684\u65B0\u9879\u76EE\u6216\u8005\u65B0\u9879\u76EE\u5DF2\u505C\u6B62\u5408\u4F5C\uFF0C\u8BF7\u6838\u5B9E
change.strat.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u4E0D\u80FD\u4E3A\u7A7A change.strat.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u4E0D\u80FD\u4E3A\u7A7A
change.less.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u8981\u5C0F\u4E8E\u7B49\u4E8E\u5F53\u524D\u6708 change.less.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u8981\u5C0F\u4E8E\u7B49\u4E8E\u5F53\u524D\u6708
......
...@@ -58,10 +58,6 @@ import java.io.IOException; ...@@ -58,10 +58,6 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/** /**
* 收入明细表 * 收入明细表
...@@ -322,53 +318,50 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -322,53 +318,50 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
@Override @Override
public void pushDetail() { public void pushDetail() {
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 50, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10));
List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda() List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda()
.eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)); .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING));
ConcurrentHashMap<String,Integer> map = new ConcurrentHashMap<>(); Map<String, Integer> map = new HashMap<>();
ConcurrentHashMap<String,String> idMap = new ConcurrentHashMap<>(); Map<String, String> idMap = new HashMap<>();
//收入更新 //收入更新
List<TIncome> updateList = new ArrayList<>(); List<TIncome> updateList = new ArrayList<>();
threadPool.execute(() -> { for (TIncome income : list) {
for (TIncome income : list) { String sendBack = this.getSendBack(income);
String sendBack = this.getSendBack(income); income.setSendTime(new Date());
income.setSendTime(new Date()); if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
if (Common.isNotNull(sendBack) && sendBack.length() == 32) { income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendStatus(CommonConstants.ONE_STRING); income.setSendMonth(DateUtil.addMonth(0));
income.setSendMonth(DateUtil.addMonth(0)); income.setEkpId(sendBack);
income.setEkpId(sendBack); updateList.add(income);
updateList.add(income); if (updateList.size() >= CommonConstants.FIVES_INT) {
if (updateList.size() >= CommonConstants.FIVES_INT) { baseMapper.updateIncomeById(updateList);
updateList.clear();
}
} else {
if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1;
map.put(sendBack, i);
idMap.put(sendBack, income.getId());
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updateIncomeById(updateList); baseMapper.updateIncomeById(updateList);
updateList.clear(); for (Map.Entry<String, Integer> entry : map.entrySet()) {
} TSendEkpError error = new TSendEkpError();
} else { error.setCreateTime(new Date());
if (map.get(sendBack) > 0) { error.setCreateDay(DateUtil.getThisDay());
int i = map.get(sendBack) + 1; error.setType(CommonConstants.FIVE_STRING);
map.put(sendBack, i); error.setLinkId(income.getId());
idMap.put(sendBack, income.getId()); error.setTitle(entry.getKey());
//单个异常超过十次,保存异常内容 error.setNums(entry.getValue());
if (i >= 10) { tSendEkpErrorService.save(error);
baseMapper.updateIncomeById(updateList);
for (Map.Entry<String, Integer> entry : map.entrySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(entry.getKey());
error.setNums(entry.getValue());
tSendEkpErrorService.save(error);
}
break;
} }
} else { break;
map.put(sendBack, 1);
idMap.put(sendBack, income.getId());
} }
} else {
map.put(sendBack, 1);
idMap.put(sendBack, income.getId());
} }
} }
}); }
for (Map.Entry<String, Integer> entry : map.entrySet()) { for (Map.Entry<String, Integer> entry : map.entrySet()) {
TSendEkpError error = new TSendEkpError(); TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date()); error.setCreateTime(new Date());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment