1.调整补单设置实体类字段

2.补全补单设置部分接口代码
master
x_z 2 years ago
parent 9b2c6851ef
commit 05aaaee797

@ -1,10 +1,14 @@
package com.glxp.api.controller.basic;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.ConstantType;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.basic.BasicBusTypePreEntity;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
@ -47,8 +51,29 @@ public class BasicBusTypePreController {
public BaseResponse filterList(FilterBusTypePreRequest filterBusTypePreRequest) {
//查询扫码单据类型
BasicBussinessTypeEntity basicBussinessType = basicBussinessTypeService.findByAction(filterBusTypePreRequest.getAction());
return ResultVOUtils.success(null);
List<BasicBusTypePreEntity> basicBusTypePreEntities = basicBusTypePreService.findByAction(filterBusTypePreRequest.getAction());
if (CollUtil.isEmpty(basicBusTypePreEntities)) {
//创建对应补单设置
if (filterBusTypePreRequest.getType() != null && "changEnable".equals(filterBusTypePreRequest.getType())) {
if (ConstantType.TYPE_OUT.equals(basicBussinessType.getMainAction()) && !basicBussinessType.isAdvanceType()) {
BasicBusTypePreEntity basicBusTypePreEntity = new BasicBusTypePreEntity();
basicBusTypePreEntity.setChangeType(ConstantStatus.ORDER_CHANGE_INNOR_NORMAL_IN);
basicBusTypePreEntity.setIndex(1);
basicBusTypePreEntity.setAction(filterBusTypePreRequest.getAction());
basicBusTypePreEntity.setBeforeTime(1);
basicBusTypePreService.insertBusChangeType(basicBusTypePreEntity);
} else if (ConstantType.TYPE_OUT.equals(basicBussinessType.getMainAction()) && basicBussinessType.isAdvanceType()) {
BasicBusTypePreEntity basicBusTypePreEntity = new BasicBusTypePreEntity();
basicBusTypePreEntity.setChangeType(ConstantStatus.ORDER_CHANGE_ADVANCE_IN);
basicBusTypePreEntity.setIndex(1);
basicBusTypePreEntity.setBeforeTime(1);
basicBusTypePreEntity.setAction(filterBusTypePreRequest.getAction());
basicBusTypePreService.insertBusChangeType(basicBusTypePreEntity);
basicBusTypePreEntities = basicBusTypePreService.findByAction(filterBusTypePreRequest.getAction());
}
}
}
return ResultVOUtils.success(basicBusTypePreEntities);
}
/**
@ -139,15 +164,14 @@ public class BasicBusTypePreController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (basicBusTypePreEntity != null) {
//TODO 补充补单单据类型仓库信息
//if (StrUtil.isNotEmpty(basicBusTypePreEntity.getDefaultSubInv())) {
// InvWarehouseEntity byInvSubByCode = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultSubInv());
// basicBusTypePreEntity.setDefaultInv(invSubWarehouseEntity.getParentId());
//}
//if (StrUtil.isNotEmpty(basicBusTypePreEntity.getLocSubInv())) {
// InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getLocSubInv());
// basicBusTypePreEntity.setLocInv(invSubWarehouseEntity.getParentId());
//}
if (StrUtil.isNotBlank(basicBusTypePreEntity.getDefaultInvCode())) {
InvWarehouseEntity invWarehouse = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultInvCode());
basicBusTypePreEntity.setDefaultDeptCode(invWarehouse.getParentId());
}
if (StrUtil.isNotBlank(basicBusTypePreEntity.getInvCode())) {
InvWarehouseEntity invWarehouse = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getInvCode());
basicBusTypePreEntity.setDeptCode(invWarehouse.getParentId());
}
basicBusTypePreService.insertBusChangeType(basicBusTypePreEntity);
} else {
ResultVOUtils.error(999, "参数错误");

@ -24,4 +24,11 @@ public interface BasicBusTypePreDao extends BaseMapper<BasicBusTypePreEntity> {
*/
boolean deleteByAction(@Param("action") String action);
/**
*
*
* @param action
* @return
*/
List<BasicBusTypePreEntity> findByAction(String action);
}

@ -37,7 +37,7 @@ public class BasicBusTypePreEntity {
*
*/
@TableField(value = "`index`")
private Byte index;
private Integer index;
/**
* (:)
@ -49,31 +49,31 @@ public class BasicBusTypePreEntity {
*
*/
@TableField(value = "changeType")
private Boolean changeType;
private Integer changeType;
/**
*
*
*/
@TableField(value = "defaultInv")
private String defaultInv;
@TableField(value = "defaultDeptCode")
private String defaultDeptCode;
/**
*
*
*/
@TableField(value = "defaultSubInv")
private String defaultSubInv;
@TableField(value = "defaultInvCode")
private String defaultInvCode;
/**
*
*
*/
@TableField(value = "locInv")
private String locInv;
@TableField(value = "deptCode")
private String deptCode;
/**
*
*
*/
@TableField(value = "locSubInv")
private String locSubInv;
@TableField(value = "invCode")
private String invCode;
/**
*
@ -135,13 +135,13 @@ public class BasicBusTypePreEntity {
public static final String COL_CHANGETYPE = "changeType";
public static final String COL_DEFAULTINV = "defaultInv";
public static final String COL_DEFAULTDEPTCODE = "defaultDeptCode";
public static final String COL_DEFAULTSUBINV = "defaultSubInv";
public static final String COL_DEFAULTINVCODE = "defaultInvCode";
public static final String COL_LOCINV = "locInv";
public static final String COL_DEPTCODE = "deptCode";
public static final String COL_LOCSUBINV = "locSubInv";
public static final String COL_INVCODE = "invCode";
public static final String COL_ORIGINACTION = "originAction";

@ -19,4 +19,6 @@ public class FilterBusTypePreRequest extends ListPageRequest {
*/
private String thirdAction;
private String type;
}

@ -51,4 +51,12 @@ public interface IBasicBusTypePreService {
* @return
*/
boolean insertBusChangeType(BasicBusTypePreEntity basicBusTypePreEntity);
/**
*
*
* @param action
* @return
*/
List<BasicBusTypePreEntity> findByAction(String action);
}

@ -54,6 +54,11 @@ public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService {
return basicBusTypePreDao.insert(basicBusTypePreEntity) != 0;
}
@Override
public List<BasicBusTypePreEntity> findByAction(String action) {
return basicBusTypePreDao.findByAction(action);
}
/**
* /
*

@ -11,4 +11,14 @@
from basic_bustype_pre
where action = #{action}
</delete>
<select id="findByAction" resultType="com.glxp.api.entity.basic.BasicBusTypePreEntity">
select basic_bustype_pre.* ,
basic_bussiness_type.name
from basic_bustype_pre
left join basic_bussiness_type on basic_bustype_pre.originAction = basic_bussiness_type.action
left join auth_dept on basic_bustype_pre.defaultDeptCode = auth_dept.code
left join auth_warehouse on basic_bustype_pre.defaultInvCode = auth_warehouse.code
where basic_bustype_pre.action = #{action}
</select>
</mapper>
Loading…
Cancel
Save