1.修复单据生成等接口的bug

master
x_z 2 years ago
parent 37a54d3ef9
commit 61415aa489

@ -20,12 +20,10 @@ import com.glxp.api.req.thrsys.FilterBasicThirdSysRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.InvSubWarehouseResponse;
import com.glxp.api.res.auth.InvWarehouseThirdSysResponse;
import com.glxp.api.res.auth.WarehouseUserResponse;
import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import com.glxp.api.service.auth.*;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.system.SystemParamConfigService;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -299,6 +297,8 @@ public class InvWarehouseController extends BaseController {
if (!warehouseBussinessTypeEntities.isEmpty()) {
return ResultVOUtils.error(500, "请先移除该仓库关联用户和单据类型!");
}
//
// //判断此分库中是否还有库存
// InvWarehouseEntity invSubWarehouse = invWarehouseService.findById(deleteRequest.getId());

@ -182,6 +182,12 @@ public class BasicBusTypePreController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (basicBusTypePreEntity != null) {
//判断是否重复添加
boolean result = basicBusTypePreService.checkExists(basicBusTypePreEntity);
if (result) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "重复添加!");
}
if (StrUtil.isNotBlank(basicBusTypePreEntity.getDefaultInvCode())) {
InvWarehouseEntity invWarehouse = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultInvCode());
basicBusTypePreEntity.setDefaultDeptCode(invWarehouse.getParentId());

@ -85,7 +85,7 @@ public class BasicBusTypePreEntity {
*
*/
@TableField(value = "changeEnable")
private Byte changeEnable;
private Boolean changeEnable;
/**
*

@ -29,4 +29,9 @@ public class FilterBusTypeChangeRequest extends ListPageRequest {
*/
private String lastUpdateTime;
/**
*
*/
private Boolean enable;
}

@ -71,6 +71,13 @@ public interface IBasicBusTypePreService {
List<BasicBusTypePreResponse> filterBusTypePreResList(FilterBusTypePreRequest filterBusTypePreRequest);
BasicBusTypePreEntity findByOriginAction(String orginAction);
BasicBusTypePreEntity findByOriginAction(String originAction);
/**
*
*
* @param basicBusTypePreEntity
* @return
*/
boolean checkExists(BasicBusTypePreEntity basicBusTypePreEntity);
}

@ -1,10 +1,10 @@
package com.glxp.api.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.BasicBusTypePreDao;
import com.glxp.api.entity.basic.BasicBusTypePreEntity;
import com.glxp.api.entity.inout.IoCodeEntity;
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
import com.glxp.api.req.basic.FilterBusTypePreRequest;
import com.glxp.api.res.basic.BasicBusTypePreResponse;
@ -80,6 +80,29 @@ public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService {
return basicBusTypePreDao.selectOne(new QueryWrapper<BasicBusTypePreEntity>().eq("originAction", originAction));
}
@Override
public boolean checkExists(BasicBusTypePreEntity basicBusTypePreEntity) {
QueryWrapper<BasicBusTypePreEntity> wrapper = new QueryWrapper<>();
wrapper.eq("action", basicBusTypePreEntity.getAction())
.eq("originAction", basicBusTypePreEntity.getOriginAction())
.eq("invCode", basicBusTypePreEntity.getInvCode())
.eq(null != basicBusTypePreEntity.getBeforeTime(), "beforeTime", basicBusTypePreEntity.getBeforeTime())
.eq(null != basicBusTypePreEntity.getDefaultInvCode(), "defaultInvCode", basicBusTypePreEntity.getDefaultInvCode())
.eq(null != basicBusTypePreEntity.getSupplementAll(), "supplementAll", basicBusTypePreEntity.getSupplementAll());
List<BasicBusTypePreEntity> list = basicBusTypePreDao.selectList(wrapper);
if (CollUtil.isNotEmpty(list)) {
if (null != basicBusTypePreEntity.getId()) {
for (BasicBusTypePreEntity busTypePreEntity : list) {
return busTypePreEntity.getId() == basicBusTypePreEntity.getId() ? false : true;
}
} else {
return true;
}
}
return false;
}
/**
* /
*

@ -29,14 +29,15 @@
<select id="selectBusTypePreResList" resultType="com.glxp.api.res.basic.BasicBusTypePreResponse">
SELECT basic_bustype_pre.*,
awA.name defaultInvName,
awB.name invName,
busTypeA.name originName,
busTypeA.name targetName
awA.name defaultInvName,
awB.name invName,
(select name from basic_bussiness_type where action = basic_bustype_pre.originAction) originName,
(select name from basic_bussiness_type where action = basic_bustype_pre.action) targetName
FROM basic_bustype_pre
left JOIN auth_warehouse awA on basic_bustype_pre.defaultInvCode = awA.code
left JOIN auth_warehouse awB on basic_bustype_pre.invCode = awB.code
left JOIN basic_bussiness_type busTypeA on basic_bustype_pre.originAction = busTypeA.action
left join basic_bussiness_type busTypeB on basic_bustype_pre.action = busTypeB.action
<where>
<if test="action != ''and action != null">
AND basic_bustype_pre.`action` = #{action}
@ -47,6 +48,9 @@
<if test="targetName != ''and targetName != null">
AND busTypeA.name LIKE CONCAT(#{targetName}, '%')
</if>
<if test="name != null and name != ''">
and (busTypeA.name like concat('%', #{name}, '%') or busTypeB.name like concat('%', #{name}, '%'))
</if>
<if test="originAction != ''and originAction != null">
AND basic_bustype_pre.`originAction` = #{originAction}
</if>

Loading…
Cancel
Save