add:增加装箱区库存页面
This commit is contained in:
@@ -1,21 +1,25 @@
|
||||
package org.nl.b_lms.sch.point.controller;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.pdm.ivt.service.dto.DeliveryPointIvtDto;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
@@ -35,6 +39,19 @@ public class BstIvtPackageinfoivtController {
|
||||
private IbstIvtPackageinfoivtService bstIvtPackageinfoivtService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param whereJson 查询条件
|
||||
* @param page 分页参数
|
||||
*/
|
||||
@GetMapping
|
||||
@Log("查询点位库存")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(bstIvtPackageinfoivtService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 一楼装箱区点位二次分配
|
||||
*
|
||||
@@ -53,10 +70,7 @@ public class BstIvtPackageinfoivtController {
|
||||
return new ResponseEntity<>(bstIvtPackageinfoivtService.secondaryAllocationPoint(taskCode, actionType), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* agv二次分配类型(1、普通任务 2、取货二次分配 3、防货二次分配 4、取放货二次分配)
|
||||
*/
|
||||
private String agv_action_type;
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
@@ -65,12 +79,28 @@ public class BstIvtPackageinfoivtController {
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
@Log("修改点位库存")
|
||||
public ResponseEntity<Object> create(@RequestBody BstIvtPackageinfoivt params) {
|
||||
bstIvtPackageinfoivtService.create(params);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
* @param params 实体对象
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PutMapping
|
||||
@Log("修改点位库存")
|
||||
//@SaCheckPermission("@el.check('deliverypointivt:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody BstIvtPackageinfoivt params) {
|
||||
bstIvtPackageinfoivtService.update(params);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
|
||||
@@ -75,6 +75,15 @@ public interface IbstIvtPackageinfoivtService extends IService<BstIvtPackageinfo
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param params 实体对象
|
||||
*/
|
||||
void update(BstIvtPackageinfoivt params);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 手持子卷质检
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
JSONObject update(JSONObject whereJson);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.b_lms.sch.point.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -26,6 +27,7 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -66,8 +68,24 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
*/
|
||||
@Override
|
||||
public IPage<BstIvtPackageinfoivt> queryAll(Map whereJson, PageQuery page) {
|
||||
return bstIvtPackageinfoivtMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()), new QueryWrapper<BstIvtPackageinfoivt>()
|
||||
.lambda());
|
||||
LambdaQueryWrapper<BstIvtPackageinfoivt> queryWrapper = new QueryWrapper<BstIvtPackageinfoivt>().lambda();
|
||||
String isUsed = MapUtil.getStr(whereJson, "is_used");
|
||||
String pointCode = MapUtil.getStr(whereJson, "point_code");
|
||||
String packageInfoArea = MapUtil.getStr(whereJson, "packageinfo_area");
|
||||
String ivtStatus = MapUtil.getStr(whereJson, "ivt_status");
|
||||
if (StringUtils.isNotEmpty(isUsed)) {
|
||||
queryWrapper.eq(BstIvtPackageinfoivt::getIs_used, isUsed);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(pointCode)) {
|
||||
queryWrapper.like(BstIvtPackageinfoivt::getPoint_code, pointCode);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(packageInfoArea)) {
|
||||
queryWrapper.eq(BstIvtPackageinfoivt::getPoint_status, packageInfoArea);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(ivtStatus)) {
|
||||
queryWrapper.eq(BstIvtPackageinfoivt::getIvt_status, ivtStatus);
|
||||
}
|
||||
return bstIvtPackageinfoivtMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -497,12 +515,27 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
*/
|
||||
@Override
|
||||
public void create(BstIvtPackageinfoivt entity) {
|
||||
bstIvtPackageinfoivtMapper.insert(getBasicInfo(entity, true));
|
||||
bstIvtPackageinfoivtMapper.insert(getBasicInfo(entity, null, true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param params 实体对象
|
||||
*/
|
||||
@Override
|
||||
public void update(BstIvtPackageinfoivt params) {
|
||||
BstIvtPackageinfoivt dto = bstIvtPackageinfoivtMapper.selectById(params.getIvt_id());
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("不存在该数据!");
|
||||
}
|
||||
bstIvtPackageinfoivtMapper.updateById(getBasicInfo(params, dto, false));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手持子卷质检
|
||||
*/
|
||||
@Override
|
||||
public JSONObject update(JSONObject whereJson) {
|
||||
@@ -520,7 +553,10 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
return result;
|
||||
}
|
||||
dto.setIvt_status(whereJson.getString("ivt_status"));
|
||||
bstIvtPackageinfoivtMapper.updateById(getBasicInfo(dto, false));
|
||||
dto.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
bstIvtPackageinfoivtMapper.updateById(dto);
|
||||
result.put("status", org.springframework.http.HttpStatus.OK.value());
|
||||
result.put("message", "检验成功!");
|
||||
return result;
|
||||
@@ -545,16 +581,18 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
* @param entity 对象实体
|
||||
* @param isCreate 是否创建
|
||||
*/
|
||||
private BstIvtPackageinfoivt getBasicInfo(BstIvtPackageinfoivt entity, boolean isCreate) {
|
||||
private BstIvtPackageinfoivt getBasicInfo(BstIvtPackageinfoivt entity, BstIvtPackageinfoivt dto, boolean isCreate) {
|
||||
if (isCreate) {
|
||||
entity.setCreate_id(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
entity.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
entity.setCreate_time(DateUtil.now());
|
||||
} else {
|
||||
BeanUtils.copyProperties(entity, dto);
|
||||
}
|
||||
entity.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
entity.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
entity.setUpdate_time(DateUtil.now());
|
||||
return entity;
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public enum PackageInfoIvtEnum {
|
||||
POINT_LOCATION(MapOf.of("上", "0", "下", "1")),
|
||||
|
||||
//库存状态
|
||||
IVT_STATUS(MapOf.of("空", "0", "空载具", "1", "有子卷", "2", "合格品", "3", "管制品", "4"));
|
||||
IVT_STATUS(MapOf.of("空", "0", "空载具", "1", "有子卷", "2", "合格品", "3", "管制品", "4"));
|
||||
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
@@ -46,7 +46,6 @@ public class DeliveryPointIvtController {
|
||||
|
||||
@PutMapping
|
||||
@Log("修改分切输送线")
|
||||
|
||||
//@SaCheckPermission("@el.check('deliverypointivt:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody DeliveryPointIvtDto dto) {
|
||||
deliverypointivtService.update(dto);
|
||||
|
||||
Reference in New Issue
Block a user