|
|
|
@ -1,14 +1,11 @@
|
|
|
|
|
package com.glxp.api.admin.controller.basic;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
|
|
|
|
|
import com.glxp.api.admin.entity.basic.BasicThirdSysBusApiEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.basic.BasicThirdSysEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.basic.BussinessOriginTypeEntity;
|
|
|
|
|
import com.glxp.api.admin.req.basic.BussinessOriginTypeFilterRequest;
|
|
|
|
|
import com.glxp.api.admin.req.basic.FilterBasicThirdSysDetailRequest;
|
|
|
|
|
import com.glxp.api.admin.req.basic.FilterBasicThirdSysRequest;
|
|
|
|
|
import com.glxp.api.admin.res.PageSimpleResponse;
|
|
|
|
@ -19,11 +16,13 @@ import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@ -184,15 +183,15 @@ public class BasicThirdSysController {
|
|
|
|
|
/**
|
|
|
|
|
* 启用第三方系统接口
|
|
|
|
|
*
|
|
|
|
|
* @param ids
|
|
|
|
|
* @param list
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/udiwms/basic/thirdsys/enableInterfaces")
|
|
|
|
|
public BaseResponse enableInterfaces(@RequestBody List<Integer> ids) {
|
|
|
|
|
if (CollUtil.isEmpty(ids)) {
|
|
|
|
|
@PostMapping("/udiwms/basic/thirdsys/updateInterfaceStatus")
|
|
|
|
|
public BaseResponse updateInterfaceStatus(@RequestBody List<BasicThirdSysDetailEntity> list) {
|
|
|
|
|
if (CollUtil.isEmpty(list)) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
}
|
|
|
|
|
basicThirdSysDetailService.enableInterface(ids);
|
|
|
|
|
basicThirdSysDetailService.updateInterfaceStatus(list);
|
|
|
|
|
return ResultVOUtils.success("添加成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -200,30 +199,10 @@ public class BasicThirdSysController {
|
|
|
|
|
@GetMapping("/udiwms/basic/thirdsys/filterBusTypeDetail")
|
|
|
|
|
public BaseResponse filterBusTypeDetail(FilterBasicThirdSysDetailRequest filterBasicThirdSysDetailRequest,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
List<BasicThirdSysBusApiEntity> basicThirdSysEntities = new ArrayList<>();
|
|
|
|
|
BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest();
|
|
|
|
|
bussinessOriginTypeFilterRequest.setThirdSys(filterBasicThirdSysDetailRequest.getThirdSysFk());
|
|
|
|
|
List<BussinessOriginTypeEntity> bussinessOriginTypeEntities = bussinessOriginTypeService.filterList(bussinessOriginTypeFilterRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(bussinessOriginTypeEntities)) {
|
|
|
|
|
for (BussinessOriginTypeEntity bussinessOriginTypeEntity : bussinessOriginTypeEntities) {
|
|
|
|
|
BasicThirdSysBusApiEntity basicThirdSysBusApiEntity = new BasicThirdSysBusApiEntity();
|
|
|
|
|
basicThirdSysBusApiEntity.setThirdSys(bussinessOriginTypeEntity.getThirdSys());
|
|
|
|
|
basicThirdSysBusApiEntity.setCode(bussinessOriginTypeEntity.getAction());
|
|
|
|
|
basicThirdSysBusApiEntity.setName(bussinessOriginTypeEntity.getName());
|
|
|
|
|
basicThirdSysBusApiEntity.setType(filterBasicThirdSysDetailRequest.getType());
|
|
|
|
|
|
|
|
|
|
if (filterBasicThirdSysDetailRequest.getType() == 1) {
|
|
|
|
|
basicThirdSysBusApiService.insertSysBusApi(basicThirdSysBusApiEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
basicThirdSysEntities = basicThirdSysBusApiService.filterSysBusApi(filterBasicThirdSysDetailRequest);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<BasicThirdSysBusApiEntity> basicThirdSysEntities = basicThirdSysBusApiService.filterSysBusApi(filterBasicThirdSysDetailRequest);
|
|
|
|
|
|
|
|
|
|
PageInfo<BasicThirdSysBusApiEntity> pageInfo;
|
|
|
|
|
pageInfo = new PageInfo<>(basicThirdSysEntities);
|
|
|
|
@ -257,7 +236,7 @@ public class BasicThirdSysController {
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/udiwms/basic/thirdsys/saveBusTypes")
|
|
|
|
|
public BaseResponse saveBusTypes(@RequestBody BasicThirdSysBusApiEntity basicThirdSysBusApiEntity) {
|
|
|
|
|
if (null == basicThirdSysBusApiEntity || StrUtil.isBlank(basicThirdSysBusApiEntity.getThirdBuyName()) || StrUtil.isBlank(basicThirdSysBusApiEntity.getName())) {
|
|
|
|
|
if (null == basicThirdSysBusApiEntity || null == basicThirdSysBusApiEntity.getType()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
}
|
|
|
|
|
boolean result = basicThirdSysBusApiService.saveBusTypes(basicThirdSysBusApiEntity);
|
|
|
|
|