|  |  | 
 |  |  |             <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> | 
 
 |  |  | 
 |  |  |  | 
 |  |  | 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$'), | 
 
 |  |  | 
 |  |  | 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; | 
 |  |  | 
 |  |  |     @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("添加成功"); | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  |     private Long hostId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 库位类型 1: 满托  0: 空托 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "库位类型 1: 满托  0: 空托  ") | 
 |  |  |     private Integer locType; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 状态 1: 正常  0: 禁用   | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "状态 1: 正常  0: 禁用  ") | 
 |  |  | 
 |  |  |         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){ | 
 
| New file | 
 |  |  | 
 |  |  | 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; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     private String batch; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 库位类型 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "库位类型") | 
 |  |  |     private Integer locType; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 起始排 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "起始排") |