opt:出库分配,出库点改成出库区
This commit is contained in:
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -27,7 +28,7 @@ public class TableDataInfo<T> implements Serializable {
|
||||
/**
|
||||
* 列表数据
|
||||
*/
|
||||
private List<T> content;
|
||||
private List<T> content = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
@@ -56,7 +57,7 @@ public class TableDataInfo<T> implements Serializable {
|
||||
public static <T> TableDataInfo<T> build(IPage<T> page) {
|
||||
TableDataInfo<T> rspData = new TableDataInfo<>();
|
||||
rspData.setCode(String.valueOf(HttpStatus.HTTP_OK));
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setMsg("操作成功");
|
||||
rspData.setContent(page.getRecords());
|
||||
rspData.setTotalElements(page.getTotal());
|
||||
return rspData;
|
||||
@@ -65,7 +66,7 @@ public class TableDataInfo<T> implements Serializable {
|
||||
public static <T> TableDataInfo<T> build(List<T> list) {
|
||||
TableDataInfo<T> rspData = new TableDataInfo<>();
|
||||
rspData.setCode(String.valueOf(HttpStatus.HTTP_OK));
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setMsg("操作成功");
|
||||
rspData.setContent(list);
|
||||
rspData.setTotalElements(list.size());
|
||||
return rspData;
|
||||
@@ -74,7 +75,7 @@ public class TableDataInfo<T> implements Serializable {
|
||||
public static <T> TableDataInfo<T> build() {
|
||||
TableDataInfo<T> rspData = new TableDataInfo<>();
|
||||
rspData.setCode(String.valueOf(HttpStatus.HTTP_OK));
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setMsg("操作成功");
|
||||
return rspData;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class MaterialbaseController {
|
||||
@Log("新增物料")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MdMeMaterialbase dto) {
|
||||
iMdMeMaterialbaseService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
|
||||
@@ -87,12 +87,13 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(MdMeMaterialbase dto) {
|
||||
MdMeMaterialbase mdMeMaterialbase = this.baseMapper.selectById(dto.getMaterial_id());
|
||||
MdMeMaterialbase mdMeMaterialbase = this.baseMapper.selectOne(new QueryWrapper<MdMeMaterialbase>()
|
||||
.select("material_code",dto.getMaterial_code()));
|
||||
if (ObjectUtil.isEmpty(mdMeMaterialbase)) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
throw new BadRequestException("物料信息不存在");
|
||||
}
|
||||
|
||||
// 修改
|
||||
dto.setMaterial_id(mdMeMaterialbase.getMaterial_id());
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
package org.nl.wms.sch_manage.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||
import org.nl.wms.sch_manage.service.dto.SchBasePointQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -28,6 +37,8 @@ public class SchBasePointController {
|
||||
|
||||
@Autowired
|
||||
private ISchBasePointService schBasePointService;
|
||||
@Autowired
|
||||
private ISchBaseRegionService iSchBaseRegionService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询点位管理")
|
||||
@@ -69,6 +80,28 @@ public class SchBasePointController {
|
||||
return new ResponseEntity<>(schBasePointService.getPointList(region), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getRegionPoints")
|
||||
@Log("获取区域下拉点")
|
||||
public ResponseEntity<Object> getRegionPoints(String region_code) {
|
||||
SchBaseRegion region = iSchBaseRegionService.getOne(new LambdaUpdateWrapper<SchBaseRegion>().eq(SchBaseRegion::getRegion_code, region_code));
|
||||
|
||||
HashMap parent = MapOf.of("value", region.getRegion_code(), "label", region.getRegion_name());
|
||||
List<SchBasePoint> points = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, region_code));
|
||||
List<Object> list = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(points)){
|
||||
for (SchBasePoint point : points) {
|
||||
HashMap item = MapOf.of("value", point.getPoint_code(), "label", point.getPoint_name());
|
||||
list.add(item);
|
||||
}
|
||||
}
|
||||
parent.put("children",list);
|
||||
List<Object> result = new ArrayList<>();
|
||||
result.add(parent);
|
||||
return new ResponseEntity<>(TableDataInfo.build(result), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("锁定与解锁")
|
||||
@PostMapping("/changeLock")
|
||||
public ResponseEntity<Object> changeLock(@RequestBody JSONObject points) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
@@ -45,6 +46,7 @@ import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDtlDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
@@ -925,9 +927,22 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
@Transactional
|
||||
public void allSetPoint(JSONObject whereJson) {
|
||||
//出库点
|
||||
if (StrUtil.isBlank(whereJson.getString("point_code"))){
|
||||
throw new BadRequestException("未选择出库点");
|
||||
if (StrUtil.isBlank(whereJson.getString("region_code"))){
|
||||
throw new BadRequestException("未选择出库区");
|
||||
}
|
||||
String pointCode = whereJson.getString("point_code");
|
||||
//----根据区域找点,特殊业务比如找空点位在这边----
|
||||
if (StringUtils.isEmpty(pointCode)){
|
||||
List<SchBasePoint> regionCode = schBasePointMapper.selectList(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, whereJson.getString("region_code"))
|
||||
);
|
||||
if (CollectionUtils.isEmpty(regionCode)){
|
||||
throw new BadRequestException("当前库区"+regionCode+"无可用点位");
|
||||
}
|
||||
pointCode=regionCode.get(0).getPoint_code();
|
||||
}
|
||||
|
||||
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
//查询主表信息
|
||||
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
|
||||
@@ -952,7 +967,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
task_form.put("task_type", "STOutTask");
|
||||
task_form.put("TaskCode",CodeUtil.getNewCode("TASK_CODE"));
|
||||
task_form.put("PickingLocation", item.getStruct_code());
|
||||
task_form.put("PlacedLocation", whereJson.getString("point_code"));
|
||||
task_form.put("PlacedLocation", pointCode);
|
||||
task_form.put("vehicle_code", item.getStoragevehicle_code());
|
||||
StOutTask stOutTask = SpringContextHolder.getBean("STOutTask");
|
||||
String task_id = stOutTask.create(task_form);
|
||||
@@ -963,7 +978,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
dis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("生成"));
|
||||
dis.setTask_id(task_id);
|
||||
dis.setIs_issued(BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
dis.setPoint_code(whereJson.getString("point_code"));
|
||||
dis.setPoint_code(pointCode);
|
||||
ioStorInvDisMapper.updateById(dis);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,14 @@ export function getPointList(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getRegionPoints(params) {
|
||||
return request({
|
||||
url: 'api/schBasePoint/getRegionPoints',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function changeLock(data) {
|
||||
return request({
|
||||
url: 'api/schBasePoint/changeLock',
|
||||
@@ -48,4 +56,4 @@ export function changeLock(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeUsed, getPointList, changeLock }
|
||||
export default { add, edit, del, changeUsed, getPointList, getRegionPoints, changeLock }
|
||||
|
||||
@@ -157,21 +157,14 @@
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库点" prop="point_code">
|
||||
<el-select
|
||||
v-model="form2.point_code"
|
||||
clearable
|
||||
<el-form-item label="出库区" prop="gender2">
|
||||
<el-cascader
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 150px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in pointList"
|
||||
:key="item.point_code"
|
||||
:label="item.point_name"
|
||||
:value="item.point_code"
|
||||
/>
|
||||
</el-select>
|
||||
:options="outBoundRegion"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="outBoundChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -240,7 +233,7 @@ import CRUD, { crud } from '@crud/crud'
|
||||
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
|
||||
import StructIvt from '@/views/wms/st/outbill/StructIvt'
|
||||
import PointDialog from '@/views/wms/sch/point/PointDialog'
|
||||
import crudPoint from '@/views/wms/sch/point/schBasePoint'
|
||||
import crudPoint, { getRegionPoints } from '@/views/wms/sch/point/schBasePoint'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
import { autoCancel, getOutBillDis } from './checkoutbill'
|
||||
|
||||
@@ -293,9 +286,11 @@ export default {
|
||||
form2: {
|
||||
unassign_qty: '0',
|
||||
assign_qty: '0',
|
||||
point_code: ''
|
||||
point_code: '',
|
||||
region_code: ''
|
||||
},
|
||||
sects: [],
|
||||
outBoundRegion: [],
|
||||
pointList: [],
|
||||
rules: {
|
||||
}
|
||||
@@ -324,10 +319,8 @@ export default {
|
||||
crudSectattr.getSectCode({ 'stor_code': this.storCode }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
|
||||
const area_type = 'CKQ'
|
||||
crudPoint.getPointList({ 'region_code': area_type }).then(res => {
|
||||
this.pointList = res
|
||||
crudPoint.getRegionPoints({ 'region_code': 'CKQ' }).then(res => {
|
||||
this.outBoundRegion = res.content
|
||||
})
|
||||
},
|
||||
close() {
|
||||
@@ -341,6 +334,7 @@ export default {
|
||||
},
|
||||
PointChanged(row) {
|
||||
this.form2.point_code = row.point_code
|
||||
this.form2.region_code = row.region_code
|
||||
},
|
||||
openStructIvt() {
|
||||
this.currentRow.remark = ''
|
||||
@@ -369,6 +363,20 @@ export default {
|
||||
this.mstrow.sect_code = val[1]
|
||||
}
|
||||
},
|
||||
outBoundChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.form2.region_code = val[0]
|
||||
this.form2.point_code = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.form2.region_code = ''
|
||||
this.form2.point_code = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.form2.region_code = val[0]
|
||||
this.form2.point_code = val[1]
|
||||
}
|
||||
},
|
||||
tabledisabled(row) {
|
||||
if ((row.work_status === '00' || row.work_status === '01') && row.is_issued === '0') {
|
||||
return false
|
||||
@@ -461,13 +469,14 @@ export default {
|
||||
}
|
||||
},
|
||||
allSetPointAllDtl() {
|
||||
if (this.form2.point_code === '') {
|
||||
if (this.form2.regon_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.loadingSetAllPoint = true
|
||||
const data = {
|
||||
'point_code': this.form2.point_code,
|
||||
'region_code': this.form2.region_code,
|
||||
'iostorinv_id': this.mstrow.iostorinv_id,
|
||||
'bill_code': this.mstrow.bill_code,
|
||||
'checked': this.checked
|
||||
|
||||
Reference in New Issue
Block a user