|
|
@@ -1,14 +1,15 @@ |
|
|
|
package com.hz.pm.api.todocenter; |
|
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.hz.pm.api.external.model.dto.MhUnitDTO; |
|
|
|
import com.hz.pm.api.AppTests; |
|
|
|
import com.hz.pm.api.common.model.constant.BizConst; |
|
|
|
import com.hz.pm.api.user.helper.MhUnitCache; |
|
|
|
import com.hz.pm.api.user.model.entity.MhUnit; |
|
|
|
import com.hz.pm.api.user.service.IMhUnitService; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.hz.pm.api.AppTests; |
|
|
|
import com.ningdatech.basic.util.CollUtils; |
|
|
|
import com.wflow.bean.entity.WflowCcTasks; |
|
|
|
import com.wflow.mapper.WflowCcTasksMapper; |
|
|
|
import com.wflow.utils.CodeUtil; |
|
|
@@ -24,7 +25,6 @@ import org.flowable.common.engine.impl.cmd.CustomSqlExecution; |
|
|
|
import org.flowable.engine.*; |
|
|
|
import org.flowable.engine.history.HistoricActivityInstance; |
|
|
|
import org.flowable.engine.history.HistoricProcessInstance; |
|
|
|
import org.flowable.engine.history.HistoricProcessInstanceQuery; |
|
|
|
import org.flowable.engine.impl.cmd.AbstractCustomSqlExecution; |
|
|
|
import org.flowable.engine.runtime.Execution; |
|
|
|
import org.flowable.task.api.Task; |
|
|
@@ -316,18 +316,17 @@ public class FlowableTest extends AppTests { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IMhUnitService mhUnitService; |
|
|
|
@Autowired |
|
|
|
private MhUnitCache mhUnitCache; |
|
|
|
|
|
|
|
@Test |
|
|
|
public void test(){ |
|
|
|
String s = FileUtil.readUtf8String("/Users/wendy/Desktop/response.json"); |
|
|
|
List<MhUnitDTO> units = JSONUtil.parseObj(s).getBeanList("data", MhUnitDTO.class); |
|
|
|
for (MhUnitDTO unit : units) { |
|
|
|
LambdaUpdateWrapper<MhUnit> set = Wrappers.lambdaUpdate(MhUnit.class) |
|
|
|
.eq(MhUnit::getId, unit.getUnitId()) |
|
|
|
.set(MhUnit::getUnifiedSocialCreditCode,unit.getUnifiedSocialCreditCode()) |
|
|
|
.set(MhUnit::getType, unit.getType()); |
|
|
|
mhUnitService.update(set); |
|
|
|
} |
|
|
|
public void test() { |
|
|
|
List<Long> unitIdPaths = mhUnitCache.getUnitIdPaths(2894L); |
|
|
|
String orderSql = String.format(" order by field(id, %s) desc", CollUtils.joinByComma(unitIdPaths)); |
|
|
|
LambdaQueryWrapper<MhUnit> query = Wrappers.lambdaQuery(MhUnit.class) |
|
|
|
.in(MhUnit::getId, unitIdPaths) |
|
|
|
.last(orderSql + BizConst.LIMIT_1); |
|
|
|
System.out.println(mhUnitService.getOne(query)); |
|
|
|
} |
|
|
|
|
|
|
|
} |