#
Junjie
2024-08-12 4a129f05fb7369b7916ccd8e68e727bb182439f1
#
1个文件已添加
5个文件已修改
89 ■■■■ 已修改文件
zy-asrs-admin/src/views/strategy/suggestLocRule/edit.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/strategy/suggestLocRule/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/SuggestLocRuleController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/SuggestLocRule.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/enums/LocRuleType.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/CreateSuggestLocRuleParam.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/strategy/suggestLocRule/edit.vue
@@ -110,14 +110,22 @@
            <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }"
                :wrapper-col="{ span: 16 }" style="display: flex;justify-content: space-between;flex-wrap: wrap;"
                autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed">
                <a-form-item :label="formatMessage('db.strategy_suggest_loc_rule.mat_id', '商品')" name="matId"
                <a-form-item :label="formatMessage('db.strategy_suggest_loc_rule.locType$', '库位类型')" name="locType$"
                    style="width: 250px;">
                    <a-select v-model:value="formData.locType" :options="[
                        { label: '满托', value: 1 },
                        { label: '空托', value: 0 },
                    ]">
                    </a-select>
                </a-form-item>
                <a-form-item v-if="formData.locType != 0" :label="formatMessage('db.strategy_suggest_loc_rule.mat_id', '商品')" name="matId"
                    style="width: 250px;" :rules="[{ required: true }]">
                    <a-select v-model:value="formData.matId" mode="multiple" :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%" show-search :options="matQueryList" optionFilterProp="label"
                        optionLabelProp="label" @click="handleSelectMatClick" :open="false">
                    </a-select>
                </a-form-item>
                <a-form-item :label="formatMessage('db.strategy_suggest_loc_rule.batch', '批号')" name="batch"
                <a-form-item v-if="formData.locType != 0" :label="formatMessage('db.strategy_suggest_loc_rule.batch', '批号')" name="batch"
                    style="width: 250px;">
                    <a-input v-model:value="formData.batch" />
                </a-form-item>
zy-asrs-admin/src/views/strategy/suggestLocRule/index.vue
@@ -27,8 +27,15 @@
const columns = [
  {
    title: formatMessage('db.strategy_suggest_loc_rule.locType$', '库位类型'),
    dataIndex: 'locType$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('locType$'),
  },
  {
    title: formatMessage('db.strategy_suggest_loc_rule.mat_id', '商品'),
    dataIndex: ['mat$','matnr'],
    dataIndex: ['mat$', 'matnr'],
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('matId$'),
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/SuggestLocRuleController.java
@@ -5,6 +5,7 @@
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.asrs.entity.enums.LocRuleType;
import com.zy.asrs.wms.asrs.entity.param.CreateSuggestLocRuleParam;
import com.zy.asrs.wms.common.annotation.OperationLog;
import com.zy.asrs.wms.common.domain.BaseParam;
@@ -57,20 +58,29 @@
    @PostMapping("/suggestLocRule/save")
    @Transactional
    public R save(@RequestBody CreateSuggestLocRuleParam param) {
        List<Long> matIdList = param.getMatIdList();
        if (matIdList.isEmpty()) {
            return R.error("请选择商品信息");
        }
        for (Long mat : matIdList) {
        if (param.getLocType().equals(LocRuleType.D.id)) {
            //空托盘
            SuggestLocRule suggestLocRule = new SuggestLocRule();
            suggestLocRule.sync(param);
            suggestLocRule.setMatId(mat);
            if (!suggestLocRuleService.save(suggestLocRule)) {
                throw new CoolException("添加推荐区域失败");
            }
        }
        }else {
            //满托盘
            List<Long> matIdList = param.getMatIdList();
            if (matIdList.isEmpty()) {
                return R.error("请选择商品信息");
            }
            for (Long mat : matIdList) {
                SuggestLocRule suggestLocRule = new SuggestLocRule();
                suggestLocRule.sync(param);
                suggestLocRule.setMatId(mat);
                if (!suggestLocRuleService.save(suggestLocRule)) {
                    throw new CoolException("添加推荐区域失败");
                }
            }
        }
        return R.ok("添加成功");
    }
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/SuggestLocRule.java
@@ -95,6 +95,12 @@
    private Long hostId;
    /**
     * 库位类型 1: 满托  0: 空托
     */
    @ApiModelProperty(value= "库位类型 1: 满托  0: 空托  ")
    private Integer locType;
    /**
     * 状态 1: 正常  0: 禁用  
     */
    @ApiModelProperty(value= "状态 1: 正常  0: 禁用  ")
@@ -206,6 +212,18 @@
        return null;
    }
    public String getLocType$(){
        if (null == this.locType){ return null; }
        switch (this.locType){
            case 1:
                return "满托";
            case 0:
                return "空托";
            default:
                return String.valueOf(this.locType);
        }
    }
    public String getStatus$(){
        if (null == this.status){ return null; }
        switch (this.status){
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/enums/LocRuleType.java
New file
@@ -0,0 +1,18 @@
package com.zy.asrs.wms.asrs.entity.enums;
public enum LocRuleType {
    D(0, "空托盘"),
    F(1, "满托盘"),
    ;
    public Integer id;
    public String desc;
    LocRuleType(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/CreateSuggestLocRuleParam.java
@@ -21,6 +21,12 @@
    private String batch;
    /**
     * 库位类型
     */
    @ApiModelProperty(value= "库位类型")
    private Integer locType;
    /**
     * 起始排
     */
    @ApiModelProperty(value= "起始排")