1.修改第三方单据类型查询更新相关接口

master
x_z 3 years ago
parent b6a392cd5b
commit 6ede15e5cc

@ -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);

@ -15,7 +15,7 @@ public interface BasicThirdSysDetailService {
List<BasicThirdSysDetailEntity> filterBasicThirdSysDetail(FilterBasicThirdSysDetailRequest filterBasicThirdSysDetailRequest);
void enableInterface(List<Integer> ids);
void updateInterfaceStatus(List<BasicThirdSysDetailEntity> list);
/**
*

@ -51,11 +51,8 @@ public class BasicThirdSysDetailServiceImpl implements BasicThirdSysDetailServic
@Transactional(rollbackFor = Exception.class)
@Override
public void enableInterface(List<Integer> ids) {
for (Integer id : ids) {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = new BasicThirdSysDetailEntity();
basicThirdSysDetailEntity.setId(id);
basicThirdSysDetailEntity.setEnabled(true);
public void updateInterfaceStatus(List<BasicThirdSysDetailEntity> list) {
for (BasicThirdSysDetailEntity basicThirdSysDetailEntity : list) {
basicThirdSysDetailDao.updateBasicThirdSysDetail(basicThirdSysDetailEntity);
}
}

@ -75,6 +75,7 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic
@Override
public boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity) {
bussinessTypeEntity.setEnable(true);
return bussinessOriginTypeDao.updateBusOriginType(bussinessTypeEntity);
}

Loading…
Cancel
Save