1.修复单据类型字段前后端不统一问题

2.修复查询候选单据无数问题
3.新增,编辑单据类型添加重名校验
master
x_z 2 years ago
parent 502f600775
commit 4777dbfb4d

@ -119,6 +119,11 @@ public class BasicBussinessTypeController extends BaseController {
}
if (bussinessTypeSaveRequest != null) {
boolean exists = basicBussinessTypeService.checkBusTypeNameExists(bussinessTypeSaveRequest.getName(), null);
if (exists) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "单据类型名称重复!");
}
bussinessTypeSaveRequest.setAction("SC" + CustomUtil.getId());
BasicBussinessTypeEntity basicBussinessTypeEntity = new BasicBussinessTypeEntity();
BeanUtil.copyProperties(bussinessTypeSaveRequest, basicBussinessTypeEntity);
@ -141,7 +146,13 @@ public class BasicBussinessTypeController extends BaseController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeSaveRequest != null) {
boolean exists = basicBussinessTypeService.checkBusTypeNameExists(bussinessTypeSaveRequest.getName(), bussinessTypeSaveRequest.getId().intValue());
if (exists) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "单据类型名称重复!");
}
BasicBussinessTypeEntity basicBussinessTypeEntity = new BasicBussinessTypeEntity();
BeanUtil.copyProperties(bussinessTypeSaveRequest, basicBussinessTypeEntity);
basicBussinessTypeService.updateBussinessType(basicBussinessTypeEntity);
@ -276,10 +287,6 @@ public class BasicBussinessTypeController extends BaseController {
return ResultVOUtils.error(ResultEnum.DATA_ERROR);
}
List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeService.candidateBussinessType(candidateRequest.getMainAction());
if (StrUtil.isNotBlank(candidateRequest.getCurAction())) {
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(candidateRequest.getCurAction());
bussinessTypeEntities.add(bussinessTypeEntity);
}
//查询补单单据类型
return ResultVOUtils.success(bussinessTypeEntities);
}

@ -73,8 +73,8 @@ public class BasicBussinessTypeResponse {
private boolean enableSupplementOrder;
private boolean checkBalacne;
private boolean secCheckBalacne;
private boolean checkBalance;
private boolean secCheckBalance;
private boolean useDyCount;
private boolean expireTip;
@ -82,7 +82,7 @@ public class BasicBussinessTypeResponse {
private String prefix;
private String localPrefix;
private boolean preIn;
private boolean outTospms;
private boolean outToSpms;
private boolean ullageFill;
private boolean scanPreIn;
private boolean vailInv;

@ -13,8 +13,4 @@ public class CandidateRequest {
*/
String mainAction;
/**
*
*/
String curAction;
}

@ -100,4 +100,12 @@ public interface IBasicBussinessTypeService {
*/
List<BasicBussinessTypeEntity> filterByUser(FilterBussinessTypeRequest filterBussinessTypeRequest);
/**
*
*
* @param name
* @param id ID
* @return
*/
boolean checkBusTypeNameExists(String name, Integer id);
}

@ -1,5 +1,6 @@
package com.glxp.api.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
@ -163,6 +164,24 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService
return basicBussinessTypeDao.selectByUser(filterBussinessTypeRequest);
}
@Override
public boolean checkBusTypeNameExists(String name, Integer id) {
List<BasicBussinessTypeEntity> list = basicBussinessTypeDao.selectList(new QueryWrapper<BasicBussinessTypeEntity>().select("name", "id").eq("name", name).eq(null != id, "id", id));
if (CollUtil.isEmpty(list)) {
return false;
} else {
//存在同名单据类型校验ID是否相同如果不相同则表示存在相同数据
if (null != id) {
for (BasicBussinessTypeEntity basicBussinessTypeEntity : list) {
if (basicBussinessTypeEntity.getId().equals(id)) {
return false;
}
}
}
}
return true;
}
/**
* /
*

@ -17,7 +17,7 @@ public class ListPageRequest {
@Min(value = 1, message = "分页参数不能小于1")
@Max(value = 500, message = "分页参数不能大于50")
@Max(value = 500, message = "分页参数不能大于500")
private Integer limit;
}

@ -180,7 +180,7 @@
select name, action
from basic_bussiness_type
where mainAction = #{mainAction}
and corpType = 1
and corpType = 3
and (supplementOrderType is null or supplementOrderType = '')
</select>

Loading…
Cancel
Save