|
@@ -9,9 +9,12 @@ import com.fdkankan.manage_jp.entity.*;
|
|
import com.fdkankan.manage_jp.exception.BusinessException;
|
|
import com.fdkankan.manage_jp.exception.BusinessException;
|
|
import com.fdkankan.manage_jp.httpClient.client.FdKKClient;
|
|
import com.fdkankan.manage_jp.httpClient.client.FdKKClient;
|
|
import com.fdkankan.manage_jp.service.*;
|
|
import com.fdkankan.manage_jp.service.*;
|
|
|
|
+import com.fdkankan.manage_jp.service.impl.SceneCommonService;
|
|
import com.fdkankan.manage_jp.vo.request.SceneParam;
|
|
import com.fdkankan.manage_jp.vo.request.SceneParam;
|
|
|
|
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -51,6 +54,8 @@ public class SceneProController extends BaseController{
|
|
ITmContractorNumService tmContractorNumService;
|
|
ITmContractorNumService tmContractorNumService;
|
|
@Autowired
|
|
@Autowired
|
|
ITmContractorService tmContractorService;
|
|
ITmContractorService tmContractorService;
|
|
|
|
+ @Autowired
|
|
|
|
+ SceneCommonService sceneCommonService;
|
|
|
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
public Result list(@RequestBody SceneParam param){
|
|
public Result list(@RequestBody SceneParam param){
|
|
@@ -77,7 +82,11 @@ public class SceneProController extends BaseController{
|
|
return Result.success(fdKKClient.upgradeToV4(map));
|
|
return Result.success(fdKKClient.upgradeToV4(map));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ RabbitMqProducer rabbitMqProducer;
|
|
|
|
|
|
|
|
+ @Value("${queue.scene.copy:ucenter-copy-scene}")
|
|
|
|
+ private String copySceneQueue;
|
|
/**
|
|
/**
|
|
* 复制场景
|
|
* 复制场景
|
|
*/
|
|
*/
|
|
@@ -92,19 +101,19 @@ public class SceneProController extends BaseController{
|
|
throw new BusinessException(ResultCode.PARAM_ERROR);
|
|
throw new BusinessException(ResultCode.PARAM_ERROR);
|
|
}
|
|
}
|
|
ScenePro scenePro = sceneProService.getByNum(num);
|
|
ScenePro scenePro = sceneProService.getByNum(num);
|
|
- String newNum = "";
|
|
|
|
- if(scenePro !=null){
|
|
|
|
- ScenePro newScenePro = sceneProService.copyScene(scenePro);
|
|
|
|
- newNum = newScenePro.getNum();
|
|
|
|
- }
|
|
|
|
ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
- if(scenePlus !=null){
|
|
|
|
- ScenePlus newScenePlus = scenePlusService.copyScene(scenePlus);
|
|
|
|
- newNum = newScenePlus.getNum();
|
|
|
|
- }
|
|
|
|
if(scenePro == null && scenePlus == null){
|
|
if(scenePro == null && scenePlus == null){
|
|
throw new BusinessException(ResultCode.NOT_RECORD);
|
|
throw new BusinessException(ResultCode.NOT_RECORD);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ String newNum = sceneCommonService.getNewNum(num);
|
|
|
|
+ Long userId = scenePro == null ? scenePlus.getUserId() :scenePro.getUserId();
|
|
|
|
+ sceneCopyLogService.saveByNum(num,newNum,userId);
|
|
|
|
+ HashMap<String,String > map = new HashMap<>();
|
|
|
|
+ map.put("oldNum",num);
|
|
|
|
+ map.put("newNum",newNum);
|
|
|
|
+ rabbitMqProducer.sendByWorkQueue(copySceneQueue,map);
|
|
|
|
+
|
|
List<TmContractor> tmContractors = tmContractorService.getByCompanyId(user.getCompanyId());
|
|
List<TmContractor> tmContractors = tmContractorService.getByCompanyId(user.getCompanyId());
|
|
if(!tmContractors.isEmpty()){
|
|
if(!tmContractors.isEmpty()){
|
|
List<TmContractorNum> saveList = new ArrayList<>();
|
|
List<TmContractorNum> saveList = new ArrayList<>();
|