|
@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.common.util.JwtUtil;
|
|
|
import com.fdkankan.manage_jp.common.Result;
|
|
|
import com.fdkankan.manage_jp.common.ResultCode;
|
|
|
-import com.fdkankan.manage_jp.entity.ScenePlus;
|
|
|
-import com.fdkankan.manage_jp.entity.ScenePro;
|
|
|
-import com.fdkankan.manage_jp.entity.User;
|
|
|
-import com.fdkankan.manage_jp.entity.UserRole;
|
|
|
+import com.fdkankan.manage_jp.entity.*;
|
|
|
import com.fdkankan.manage_jp.exception.BusinessException;
|
|
|
import com.fdkankan.manage_jp.httpClient.client.FdKKClient;
|
|
|
import com.fdkankan.manage_jp.service.*;
|
|
@@ -18,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
@@ -49,6 +47,10 @@ public class SceneProController extends BaseController{
|
|
|
FdKKClient fdKKClient;
|
|
|
@Autowired
|
|
|
ISceneCopyLogService sceneCopyLogService;
|
|
|
+ @Autowired
|
|
|
+ ITmContractorNumService tmContractorNumService;
|
|
|
+ @Autowired
|
|
|
+ ITmContractorService tmContractorService;
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
public Result list(@RequestBody SceneParam param){
|
|
@@ -103,6 +105,23 @@ public class SceneProController extends BaseController{
|
|
|
if(scenePro == null && scenePlus == null){
|
|
|
throw new BusinessException(ResultCode.NOT_RECORD);
|
|
|
}
|
|
|
+ List<TmContractor> tmContractors = tmContractorService.getByContractorId(user.getId());
|
|
|
+ if(!tmContractors.isEmpty()){
|
|
|
+ List<TmContractorNum> saveList = new ArrayList<>();
|
|
|
+ List<Integer> ids = tmContractors.stream().map(TmContractor::getId).collect(Collectors.toList());
|
|
|
+ List<TmContractorNum> contractorIds = tmContractorNumService.getByContractorIds(ids);
|
|
|
+ for (TmContractorNum contractorNum : contractorIds) {
|
|
|
+ if(contractorNum.getNum().equals(num)){
|
|
|
+ contractorNum.setId(null);
|
|
|
+ contractorNum.setNum(newNum);
|
|
|
+ saveList.add(contractorNum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!saveList.isEmpty()){
|
|
|
+ tmContractorNumService.saveBatch(saveList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
sceneCopyLogService.saveByNum(num,newNum ,user.getId());
|
|
|
|
|
|
return Result.success();
|