|
@@ -231,18 +231,25 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
|
|
|
.eq(Shantai::getValidFlag,"1");
|
|
|
Shantai shantai = shantaiMapper.selectOne(shantaiLambdaQueryWrapper);
|
|
|
|
|
|
- if (Objects.nonNull(shantai) && shantai.getState().equals("1")){
|
|
|
- log.info("该单据Id:{}已同步过水单,本次不进行同步",flowId);
|
|
|
- return McR.success();
|
|
|
+ //获取提交人
|
|
|
+ String userId = "";
|
|
|
+
|
|
|
+ if (Objects.nonNull(shantai)){
|
|
|
+ if (shantai.getState().equals("1")){
|
|
|
+ log.info("该单据Id:{}已同步过水单,本次不进行同步",flowId);
|
|
|
+ return McR.success();
|
|
|
+ }
|
|
|
+ userId = shantai.getUserId();
|
|
|
+ }
|
|
|
+ if (Objects.isNull(userId)){
|
|
|
+ userId = map.get("userId").toString();
|
|
|
}
|
|
|
|
|
|
- //获取提交人
|
|
|
- String userId = map.get("userId").toString();
|
|
|
DDR_New ddrNew = (DDR_New) UtilHttp.doPost("https://oapi.dingtalk.com/topapi/v2/user/get", null, ddClient.initTokenParams(), UtilMap.map("userid", userId), DDR_New.class);
|
|
|
Map result = (Map) ddrNew.getResult();
|
|
|
- String unionId = "";
|
|
|
+ String unionId = "4SLghmRuGL3Gii2DHXENHlwiEiE";
|
|
|
if (Objects.nonNull(result)){
|
|
|
- unionId = result.get("unionid").toString();
|
|
|
+// unionId = result.get("unionid").toString();
|
|
|
}else {
|
|
|
unionId = "4SLghmRuGL3Gii2DHXENHlwiEiE";//李溯unionId
|
|
|
userId = "16278700718435315";//李溯userId
|
|
@@ -285,6 +292,7 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
|
|
|
}
|
|
|
shantai.setFlowId(flowId);
|
|
|
shantai.setProcInstId(procInstId);
|
|
|
+ shantai.setUserId(userId);
|
|
|
shantaiMapper.insert(shantai);
|
|
|
}else {
|
|
|
//更新表中同步状态
|
|
@@ -387,7 +395,7 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
|
|
|
public void commentSyncAll() {
|
|
|
//获取所有评论未同步水单的单据列表
|
|
|
LambdaQueryWrapper<Shantai> shantaiLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- shantaiLambdaQueryWrapper.eq(Shantai::getState,"2")
|
|
|
+ shantaiLambdaQueryWrapper.ne(Shantai::getState,"1")
|
|
|
.eq(Shantai::getValidFlag,"1");
|
|
|
List<Shantai> shantaiList = shantaiMapper.selectList(shantaiLambdaQueryWrapper);
|
|
|
for (Shantai shantai : shantaiList) {
|