add:添加仓库记录表服务/修改仓库基础数据服务
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package org.nl.common.publish;
|
||||
|
||||
import org.nl.common.publish.event.PublishEvent;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/4/28 13:40
|
||||
*/
|
||||
public abstract class AbstraceListener<E extends PublishEvent> {
|
||||
protected abstract void doEvent(E event);
|
||||
//返回值用于回调函数
|
||||
protected abstract String doEvent(E event);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.common.publish;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.publish.event.PublishEvent;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -28,8 +29,12 @@ public class BussEventMulticaster implements BeanPostProcessor {
|
||||
}
|
||||
for (AbstraceListener listener : getListenerByEvent(event)) {
|
||||
if (sync){
|
||||
listener.doEvent(event);
|
||||
String result= listener.doEvent(event);
|
||||
if (event.getCallback() !=null && result !=null){
|
||||
event.getCallback().accept(result);
|
||||
};
|
||||
}else {
|
||||
//TODO:异步回调
|
||||
new Thread(()->{
|
||||
listener.doEvent(event);
|
||||
}).start();
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package org.nl.common.publish;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/4/28 13:39
|
||||
*/
|
||||
public interface PublishEvent {
|
||||
}
|
||||
@@ -1,10 +1,27 @@
|
||||
package org.nl.common.publish.event;
|
||||
|
||||
import org.nl.common.publish.PublishEvent;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/4/28 13:50
|
||||
*/
|
||||
public class PointEvent implements PublishEvent {
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PointEvent<T> extends PublishEvent {
|
||||
|
||||
private String type;
|
||||
private String point_code1;
|
||||
private String point_code2;
|
||||
private Map<String,String> extParam;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.common.publish.event;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/15 00:22
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public abstract class PublishEvent {
|
||||
|
||||
private Consumer callback = null;
|
||||
}
|
||||
@@ -3,7 +3,8 @@ package org.nl.common.publish.event;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.nl.common.publish.PublishEvent;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -12,14 +13,15 @@ import java.util.Map;
|
||||
* @author ZZQ
|
||||
* @Date 2023/4/28 13:50
|
||||
*/
|
||||
@Builder
|
||||
@SuperBuilder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class VechlieEvent implements PublishEvent {
|
||||
@NoArgsConstructor
|
||||
public class VechlieEvent extends PublishEvent {
|
||||
|
||||
String VechlieCode;
|
||||
private String VechlieCode;
|
||||
//meterilaCode ,qty
|
||||
List<Map> meterilas;
|
||||
private List<Map> meterilas;
|
||||
//出还是入
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package org.nl.common.publish.listener;
|
||||
|
||||
import org.nl.common.publish.AbstraceListener;
|
||||
import org.nl.common.publish.event.PointEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/4/28 13:57
|
||||
*/
|
||||
@Component
|
||||
public class PointListener extends AbstraceListener<PointEvent> {
|
||||
@Override
|
||||
protected void doEvent(PointEvent event) {
|
||||
System.out.println("----事件触发-----");
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.备份st.rest;
|
||||
package org.nl.wms.masterdata_manage.storage.controller.material;
|
||||
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.MaterialsafeivtService;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.dto.MaterialsafeivtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.备份st.rest;
|
||||
package org.nl.wms.masterdata_manage.storage.controller.material;
|
||||
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.StructrelamaterialService;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.dto.StructrelamaterialDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -1,21 +1,27 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.备份st.rest;
|
||||
package org.nl.wms.masterdata_manage.storage.controller.storage;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.SectattrService;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.dto.SectattrDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dto.SectattrQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -29,56 +35,56 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
public class SectattrController {
|
||||
|
||||
private final SectattrService sectattrService;
|
||||
@Autowired
|
||||
private IStIvtSectattrService isectattrService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询库区")
|
||||
@ApiOperation("查询库区")
|
||||
//@PreAuthorize("@el.check('sectattr:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(sectattrService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
public ResponseEntity<Object> query(SectattrQuery query, PageQuery page){
|
||||
Page<StIvtSectattr> list = isectattrService.page(page.build(StIvtSectattr.class), query.build());
|
||||
return new ResponseEntity<>(TableDataInfo.build(list),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增库区")
|
||||
@ApiOperation("新增库区")
|
||||
//@PreAuthorize("@el.check('sectattr:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody SectattrDto dto){
|
||||
sectattrService.create(dto);
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody JSONObject form){
|
||||
isectattrService.create(form);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改库区")
|
||||
@ApiOperation("修改库区")
|
||||
//@PreAuthorize("@el.check('sectattr:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody SectattrDto dto){
|
||||
sectattrService.update(dto);
|
||||
public ResponseEntity<Object> updateForm(@Validated @RequestBody JSONObject form){
|
||||
isectattrService.updateForm(form);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除库区")
|
||||
@ApiOperation("删除库区")
|
||||
//@PreAuthorize("@el.check('sectattr:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
sectattrService.deleteAll(ids);
|
||||
if (ids !=null && ids.length>0){
|
||||
isectattrService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getSect")
|
||||
@Log("查询库区下拉框")
|
||||
@ApiOperation("查询库区下拉框")
|
||||
//@PreAuthorize("@el.check('materialtype:list')")
|
||||
public ResponseEntity<Object> querySect(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(sectattrService.getSect(whereJson), HttpStatus.OK);
|
||||
public ResponseEntity<Object> querySect(@RequestParam JSONObject query) {
|
||||
List<Map> list = isectattrService.getSect(query);
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改库区状态")
|
||||
@ApiOperation("修改库区状态")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject json) {
|
||||
sectattrService.changeActive(json);
|
||||
isectattrService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,26 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.备份st.rest;
|
||||
package org.nl.wms.masterdata_manage.storage.controller.storage;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.StorattrService;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.dto.StorattrDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -29,14 +34,18 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
public class StorattrController {
|
||||
|
||||
private final StorattrService storattrService;
|
||||
@Autowired
|
||||
protected IStIvtBsrealstorattrService stIvtBsrealstorattrService;
|
||||
@Autowired
|
||||
protected StorattrService storattrService;
|
||||
|
||||
@GetMapping
|
||||
|
||||
@PostMapping("/queryStor")
|
||||
@Log("查询仓库")
|
||||
@ApiOperation("查询仓库")
|
||||
//@PreAuthorize("@el.check('Storattr:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(storattrService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
public ResponseEntity<Object> queryStor() {
|
||||
List<StIvtBsrealstorattr> list = stIvtBsrealstorattrService.list(new QueryWrapper<StIvtBsrealstorattr>().eq("is_used", true));
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@@ -1,22 +1,25 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.备份st.rest;
|
||||
package org.nl.wms.masterdata_manage.storage.controller.storage;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.StructattrService;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.dto.StructattrDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dto.StructarrQuery;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author zhouz
|
||||
@@ -29,22 +32,23 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
public class StructattrController {
|
||||
|
||||
private final StructattrService structattrService;
|
||||
private final IStIvtStructattrService ivtStructattrService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询仓位")
|
||||
@ApiOperation("查询仓位")
|
||||
//@PreAuthorize("@el.check('structattr:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(structattrService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
public ResponseEntity<Object> queryAll(StructarrQuery query, PageQuery page){
|
||||
Page<StIvtStructattr> list = ivtStructattrService.page(page.build(StIvtStructattr.class), query.build());
|
||||
return new ResponseEntity<>(TableDataInfo.build(list),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增仓位")
|
||||
@ApiOperation("新增仓位")
|
||||
//@PreAuthorize("@el.check('structattr:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody StructattrDto dto){
|
||||
structattrService.create(dto);
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody JSONObject form){
|
||||
ivtStructattrService.create(form);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -52,8 +56,8 @@ public class StructattrController {
|
||||
@Log("修改仓位")
|
||||
@ApiOperation("修改仓位")
|
||||
//@PreAuthorize("@el.check('structattr:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StructattrDto dto){
|
||||
structattrService.update(dto);
|
||||
public ResponseEntity<Object> updateForm(@Validated @RequestBody JSONObject form){
|
||||
ivtStructattrService.updateForm(form);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@@ -62,7 +66,9 @@ public class StructattrController {
|
||||
//@PreAuthorize("@el.check('structattr:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
structattrService.deleteAll(ids);
|
||||
if (ids != null && ids.length>0){
|
||||
ivtStructattrService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -70,7 +76,7 @@ public class StructattrController {
|
||||
@Log("修改仓位状态")
|
||||
@ApiOperation("修改仓位状态")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject json) {
|
||||
structattrService.changeActive(json);
|
||||
ivtStructattrService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.备份st.rest;
|
||||
package org.nl.wms.masterdata_manage.storage.controller.vehicle;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.StructrelavehicletypeService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
public interface IStIvtBsrealstorattrService extends IService<StIvtBsrealstorattr> {
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String create(JSONObject form);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String updateForm(JSONObject form);
|
||||
|
||||
|
||||
/**
|
||||
* 改变启用状态
|
||||
* @param json
|
||||
*/
|
||||
void changeActive(JSONObject json);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
public interface IStIvtSectattrService extends IService<StIvtSectattr> {
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String create(JSONObject form);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String updateForm(JSONObject form);
|
||||
|
||||
/**
|
||||
* 改变启用状态
|
||||
* @param json
|
||||
*/
|
||||
void changeActive(JSONObject json);
|
||||
|
||||
/**
|
||||
* 查询库区下拉选
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
List<Map> getSect(JSONObject json);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位属性表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
public interface IStIvtStructattrService extends IService<StIvtStructattr> {
|
||||
/**
|
||||
* 创建
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String create(JSONObject form);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String updateForm(JSONObject form);
|
||||
|
||||
|
||||
/**
|
||||
* 改变启用状态
|
||||
* @param json
|
||||
*/
|
||||
void changeActive(JSONObject json);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage.dao;
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -26,6 +27,7 @@ public class StIvtBsrealstorattr implements Serializable {
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
@TableId(value = "stor_id")
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
@@ -1,11 +1,13 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage.dao;
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -25,7 +27,8 @@ public class StIvtSectattr implements Serializable {
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
private Long sect_id;
|
||||
@TableId(value = "sect_id")
|
||||
private String sect_id;
|
||||
|
||||
/**
|
||||
* 库区编码
|
||||
@@ -55,7 +58,15 @@ public class StIvtSectattr implements Serializable {
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private Long stor_id;
|
||||
private String stor_id;
|
||||
/**
|
||||
* 仓库code
|
||||
*/
|
||||
private String stor_code;
|
||||
/**
|
||||
* 仓库ming
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 仓库类型
|
||||
@@ -130,7 +141,7 @@ public class StIvtSectattr implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
private Date create_time;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
@@ -140,12 +151,8 @@ public class StIvtSectattr implements Serializable {
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
private Date update_time;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 背景色
|
||||
@@ -170,12 +177,12 @@ public class StIvtSectattr implements Serializable {
|
||||
/**
|
||||
* 所在楼层
|
||||
*/
|
||||
private BigDecimal floor_no;
|
||||
private Integer floor_no;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
private Boolean is_used;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
@@ -1,11 +1,13 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage.dao;
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -25,6 +27,7 @@ public class StIvtStructattr implements Serializable {
|
||||
/**
|
||||
* 仓位标识
|
||||
*/
|
||||
@TableId(value = "struct_id")
|
||||
private String struct_id;
|
||||
|
||||
/**
|
||||
@@ -120,12 +123,12 @@ public class StIvtStructattr implements Serializable {
|
||||
/**
|
||||
* 是否临时仓位
|
||||
*/
|
||||
private String is_tempstruct;
|
||||
private Boolean is_tempstruct;
|
||||
|
||||
/**
|
||||
* 超限货位关联的货位编号
|
||||
*/
|
||||
private String control_point;
|
||||
private String control_code;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
@@ -140,7 +143,7 @@ public class StIvtStructattr implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
private Date create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
@@ -155,12 +158,8 @@ public class StIvtStructattr implements Serializable {
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
private Date update_time;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 背景色
|
||||
@@ -185,17 +184,13 @@ public class StIvtStructattr implements Serializable {
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
private Boolean is_used;
|
||||
|
||||
/**
|
||||
* 是否判断高度
|
||||
*/
|
||||
private String is_zdepth;
|
||||
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具号
|
||||
@@ -205,7 +200,7 @@ public class StIvtStructattr implements Serializable {
|
||||
/**
|
||||
* 是否空载具
|
||||
*/
|
||||
private String is_emptyvehicle;
|
||||
private Boolean is_emptyvehicle;
|
||||
|
||||
/**
|
||||
* 载具数量
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage.dao.mapper;
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
public interface StIvtSectattrMapper extends BaseMapper<StIvtSectattr> {
|
||||
|
||||
List<Map<String, String>> getSectByStorQuery(Map<String,Object> query);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage.dao.mapper;
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtBsrealstorattrMapper">
|
||||
<mapper namespace="org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper.StIvtBsrealstorattrMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper.StIvtSectattrMapper">
|
||||
|
||||
<select id="getSectByStorQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
st_ivt_sectattr.sect_name,
|
||||
st_ivt_sectattr.sect_id,
|
||||
st_ivt_sectattr.sect_code,
|
||||
st_ivt_bsrealstorattr.stor_name,
|
||||
st_ivt_bsrealstorattr.stor_id,
|
||||
st_ivt_bsrealstorattr.stor_code
|
||||
FROM
|
||||
st_ivt_sectattr
|
||||
LEFT JOIN st_ivt_bsrealstorattr stor ON st_ivt_sectattr.stor_id = stor.stor_id
|
||||
WHERE
|
||||
stor.is_used = '1'
|
||||
<if test="is_virtualstore != null and is_virtualstore != ''">
|
||||
and stor.is_virtualstore = #{is_virtualstore}
|
||||
</if>
|
||||
<if test="is_semi_finished != null and is_semi_finished != ''">
|
||||
and stor.is_semi_finished = #{is_semi_finished}
|
||||
</if>
|
||||
<if test="is_productstore != null and is_productstore != ''">
|
||||
and stor.is_productstore = #{is_productstore}
|
||||
</if>
|
||||
<if test="is_attachment != null and is_attachment != ''">
|
||||
and stor.is_attachment = #{is_attachment}
|
||||
</if>
|
||||
<if test="is_reversed != null and is_reversed != ''">
|
||||
and stor.is_reversed = #{is_reversed}
|
||||
</if>
|
||||
<if test="stor_id != null and stor_id != ''">
|
||||
and stor.stor_id = #{stor_id}
|
||||
</if>
|
||||
<if test="stor_id != null and stor_id != ''">
|
||||
and stor.stor_id = #{stor_id}
|
||||
</if>
|
||||
<if test="stor_id != null and stor_id != ''">
|
||||
and stor.stor_id = #{stor_id}
|
||||
</if>
|
||||
<if test="sect_type_attr != null and stor_id != ''">
|
||||
and st_ivt_sectattr.sect_type_attr = #{sect_type_attr}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtStructattrMapper">
|
||||
<mapper namespace="org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper.StIvtStructattrMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/14 17:13
|
||||
*/
|
||||
@Data
|
||||
public class SectattrQuery extends BaseQuery<StIvtSectattr> {
|
||||
|
||||
private String search;
|
||||
private String stor_id;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("search", QParam.builder().k(new String[]{"sect_code","sect_name"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/14 17:13
|
||||
*/
|
||||
@Data
|
||||
public class StructarrQuery extends BaseQuery<StIvtStructattr> {
|
||||
|
||||
private String search;
|
||||
private String stor_id;
|
||||
private String sect_id;
|
||||
//struct.storagevehicle_code is null or struct.storagevehicle_code = ''
|
||||
private String lock_type;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("search", QParam.builder().k(new String[]{"struct_code","struct_name"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper.StIvtBsrealstorattrMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@Service
|
||||
public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtBsrealstorattrMapper, StIvtBsrealstorattr> implements IStIvtBsrealstorattrService {
|
||||
|
||||
@Override
|
||||
public String create(JSONObject form) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateForm(JSONObject form) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeActive(JSONObject json) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper.StIvtSectattrMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@Service
|
||||
public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, StIvtSectattr> implements IStIvtSectattrService {
|
||||
//仓库
|
||||
@Autowired
|
||||
private IStIvtBsrealstorattrService storattrService;
|
||||
//仓位
|
||||
@Autowired
|
||||
private IStIvtStructattrService structattrService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject form) {
|
||||
Assert.notNull(form,"参数不能为空");
|
||||
StIvtSectattr one = this.getOne(new QueryWrapper<StIvtSectattr>().eq("sect_code",form.getString("sect_code")));
|
||||
if (one != null) {
|
||||
throw new BadRequestException("存在相同的仓库编号");
|
||||
}
|
||||
StIvtSectattr sectattr = form.toJavaObject(StIvtSectattr.class);
|
||||
sectattr.setSect_id(IdUtil.getStringId());
|
||||
sectattr.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
sectattr.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
sectattr.setCreate_time(new Date());
|
||||
packageSectForm(form, sectattr);
|
||||
this.save(sectattr);
|
||||
|
||||
return sectattr.getSect_id();
|
||||
}
|
||||
|
||||
private void packageSectForm(JSONObject form, StIvtSectattr sectattr) {
|
||||
StIvtBsrealstorattr storattr = storattrService.getOne(new QueryWrapper<StIvtBsrealstorattr>().eq("stor_id", form.getString("stor_id")));
|
||||
sectattr.setStor_id(storattr.getStor_id());
|
||||
sectattr.setStor_code(storattr.getStor_code());
|
||||
sectattr.setStor_name(storattr.getStor_name());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateForm(JSONObject form) {
|
||||
Assert.notNull(form,"参数不能为空");
|
||||
|
||||
String sect_id = form.getString("sect_id");
|
||||
StIvtSectattr one = this.getOne(new QueryWrapper<StIvtSectattr>().eq("sect_id", form.getString("sect_id")));
|
||||
if (one == null) {
|
||||
throw new BadRequestException(form.getString("sect_id")+"被删除,操作失败!");
|
||||
}
|
||||
StIvtSectattr sectattr = form.toJavaObject(StIvtSectattr.class);
|
||||
packageSectForm(form, sectattr);
|
||||
sectattr.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
sectattr.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
sectattr.setUpdate_time(new Date());
|
||||
return sect_id;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void changeActive(JSONObject form) {
|
||||
Assert.notNull(form,"参数不能为空");
|
||||
|
||||
StIvtBsrealstorattr storattr = storattrService.getOne(new QueryWrapper<StIvtBsrealstorattr>().eq("stor_id", form.getString("stor_id")));
|
||||
if (!storattr.getIs_used()){
|
||||
throw new BadRequestException(form.getString("stor_id")+"该库区所属的仓库已禁用,请先启用该仓库!");
|
||||
}
|
||||
|
||||
this.update(new UpdateWrapper<StIvtSectattr>()
|
||||
.set("is_used",form.getString("is_used"))
|
||||
.set("update_id",SecurityUtils.getCurrentUserId())
|
||||
.set("update_name",SecurityUtils.getCurrentNickName())
|
||||
.set("update_time",new Date())
|
||||
.eq("sect_id",form.getString("sect_id")));
|
||||
|
||||
structattrService.update(new UpdateWrapper<StIvtStructattr>()
|
||||
.set("is_used",form.getString("is_used"))
|
||||
.set("update_id",SecurityUtils.getCurrentUserId())
|
||||
.set("update_name",SecurityUtils.getCurrentNickName())
|
||||
.set("update_time",new Date())
|
||||
.eq("sect_id",form.getString("sect_id")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getSect(JSONObject json) {
|
||||
List<Map<String, String>> sects = this.baseMapper.getSectByStorQuery(json);
|
||||
Map<String, List<Map<String, String>>> groupBy_stor_id = sects.stream().collect(Collectors.groupingBy(a -> (String)((Map)a).get("stor_id")));
|
||||
List stor_ja = new ArrayList<>();
|
||||
for (Map.Entry<String, List<Map<String, String>>> entry : groupBy_stor_id.entrySet()) {
|
||||
Map stor_cas = new HashMap<>();
|
||||
List<Map<String, String>> sectList = entry.getValue();
|
||||
stor_cas.put("value", entry.getKey());
|
||||
stor_cas.put("label", sectList.get(0).get("stor_name"));
|
||||
List sect_ja = new ArrayList<>();
|
||||
for (Map<String, String> map : sectList) {
|
||||
Map sect_cas = new HashMap<>();
|
||||
sect_cas.put("value", map.get("sect_id"));
|
||||
sect_cas.put("label", map.get("sect_name"));
|
||||
sect_ja.add(sect_cas);
|
||||
}
|
||||
stor_cas.put("children", sect_ja);
|
||||
stor_ja.add(stor_cas);
|
||||
}
|
||||
return stor_ja;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package org.nl.wms.masterdata_manage.storage.service.storage.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper.StIvtStructattrMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位属性表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@Service
|
||||
public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMapper, StIvtStructattr> implements IStIvtStructattrService {
|
||||
|
||||
@Autowired
|
||||
private IStIvtSectattrService sectattrService;
|
||||
@Autowired
|
||||
private IStIvtBsrealstorattrService storattrService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject form) {
|
||||
Assert.notNull(form,"请求参数不能为空");
|
||||
StIvtStructattr one = this.getOne(new QueryWrapper<StIvtStructattr>().eq("struct_code", form.getString("struct_code")));
|
||||
if (one != null) {
|
||||
throw new BadRequestException("存在相同的库区编号");
|
||||
}
|
||||
StIvtStructattr structattr = form.toJavaObject(StIvtStructattr.class);
|
||||
structattr.setStruct_id(IdUtil.getStringId());
|
||||
structattr.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
structattr.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
structattr.setCreate_time(new Date());
|
||||
packageFormByattr(form, structattr);
|
||||
this.save(structattr);
|
||||
return structattr.getStruct_id();
|
||||
}
|
||||
|
||||
private void packageFormByattr(JSONObject form, StIvtStructattr structattr) {
|
||||
库区仓库:{
|
||||
StIvtSectattr sectarr = sectattrService.getOne(new QueryWrapper<StIvtSectattr>().eq("sect_id", form.getString("sect_id")));
|
||||
structattr.setSect_id(sectarr.getSect_id());
|
||||
structattr.setSect_code(sectarr.getSect_code());
|
||||
structattr.setSect_name(sectarr.getSect_name());
|
||||
structattr.setStor_id(sectarr.getStor_id());
|
||||
structattr.setStor_code(sectarr.getStor_code());
|
||||
structattr.setStor_name(sectarr.getStor_name());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateForm(JSONObject form) {
|
||||
Assert.notNull(form,"请求参数不能为空");
|
||||
StIvtStructattr one = this.getOne(new QueryWrapper<StIvtStructattr>().eq("struct_code", form.getString("struct_code")));
|
||||
if (one == null) {
|
||||
throw new BadRequestException(form.getString("struct_code")+"被删除,操作失败!");
|
||||
}
|
||||
StIvtStructattr structattr = form.toJavaObject(StIvtStructattr.class);
|
||||
structattr.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
structattr.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
structattr.setUpdate_time(new Date());
|
||||
packageFormByattr(form, structattr);
|
||||
this.updateById(structattr);
|
||||
return structattr.getStruct_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeActive(JSONObject form) {
|
||||
Assert.notNull(form,"请求参数不能为空");
|
||||
StIvtSectattr sectarr = sectattrService.getOne(new QueryWrapper<StIvtSectattr>().eq("sect_id", form.getString("sect_id")));
|
||||
if (!sectarr.getIs_used()){
|
||||
throw new BadRequestException("该仓位所属的库区已禁用,请先启用该库区!");
|
||||
}
|
||||
|
||||
this.update(new UpdateWrapper<StIvtStructattr>()
|
||||
.set("is_used",form.getString("is_used"))
|
||||
.set("update_id",SecurityUtils.getCurrentUserId())
|
||||
.set("update_name",SecurityUtils.getCurrentNickName())
|
||||
.set("update_time",new Date())
|
||||
.eq("struct_id",form.getString("struct_id")));
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.备份st.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.StructivtService;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.dto.StructivtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* @date 2022-06-02
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "库存管理管理")
|
||||
@RequestMapping("/api/structivt")
|
||||
@Slf4j
|
||||
public class StructivtController {
|
||||
|
||||
private final StructivtService structivtService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询库存管理")
|
||||
@ApiOperation("查询库存管理")
|
||||
//@PreAuthorize("@el.check('structivt:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(structivtService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增库存管理")
|
||||
@ApiOperation("新增库存管理")
|
||||
//@PreAuthorize("@el.check('structivt:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody StructivtDto dto){
|
||||
structivtService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改库存管理")
|
||||
@ApiOperation("修改库存管理")
|
||||
//@PreAuthorize("@el.check('structivt:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StructivtDto dto){
|
||||
structivtService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除库存管理")
|
||||
@ApiOperation("删除库存管理")
|
||||
//@PreAuthorize("@el.check('structivt:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
structivtService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getStruct")
|
||||
@Log("查询仓位下拉")
|
||||
@ApiOperation("查询仓位下拉")
|
||||
//@PreAuthorize("@el.check('structivt:list')")
|
||||
public ResponseEntity<Object> getStruct(){
|
||||
return new ResponseEntity<>(structivtService.getStruct(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getStructById")
|
||||
@Log("根据仓位id查询仓位信息")
|
||||
@ApiOperation("根据仓位id查询仓位信息")
|
||||
//@PreAuthorize("@el.check('structivt:list')")
|
||||
public ResponseEntity<Object> getStructById(@RequestBody JSONObject param){
|
||||
return new ResponseEntity<>(structivtService.getStructById(param),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getUnits")
|
||||
@Log("查询计量单位下拉")
|
||||
@ApiOperation("查询计量单位下拉")
|
||||
//@PreAuthorize("@el.check('structivt:list')")
|
||||
public ResponseEntity<Object> getUnits(){
|
||||
return new ResponseEntity<>(structivtService.getUnits(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -13,8 +13,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.ConstantParam;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.publish.event.PointEvent;
|
||||
import org.nl.common.publish.listener.PointListener;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -42,7 +40,7 @@ import java.util.*;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PointServiceImpl extends PointListener implements PointService {
|
||||
public class PointServiceImpl implements PointService {
|
||||
|
||||
private final RegionService regionService;
|
||||
private final StructivtService structivtService;
|
||||
@@ -343,8 +341,4 @@ public class PointServiceImpl extends PointListener implements PointService {
|
||||
return load_series;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doEvent(PointEvent event) {
|
||||
super.doEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.scheduler_manage.service.point;
|
||||
|
||||
import org.nl.common.publish.AbstraceListener;
|
||||
import org.nl.common.publish.event.PublishEvent;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/12 11:30
|
||||
*/
|
||||
public class PointListener extends AbstraceListener {
|
||||
//返回值用于回调
|
||||
@Override
|
||||
protected String doEvent(PublishEvent event) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -14,11 +14,6 @@ import io.jsonwebtoken.lang.Assert;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.publish.BussEventMulticaster;
|
||||
import org.nl.common.publish.PublishEvent;
|
||||
import org.nl.common.publish.event.PointEvent;
|
||||
import org.nl.common.publish.event.VechlieEvent;
|
||||
import org.nl.common.publish.listener.PointListener;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -143,6 +138,6 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
//如果是仓位点位,更新状态前,先去查询仓位点位所对应的库区是否启用,如果禁用抛出异常 //如果启用,则同步更新仓位的状态
|
||||
this.update(form);
|
||||
WQLObject.getWQLObject("sch_base_point").update(form);
|
||||
BussEventMulticaster.Publish(new PointEvent());
|
||||
//BussEventMulticaster.Publish(new PointEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.nl.wms.storage_manage;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.nl.common.utils.MapOf;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/10 11:41
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CHANGE_BILL_TYPE_ENUM {
|
||||
//出入库
|
||||
IOSTORINV_IN_SEND("1","入库下发", MapOf.of("warehousing_qty",true),1),
|
||||
IOSTORINV_IN_CACEL("2","入库取消",MapOf.of("warehousing_qty",false),1<<1),
|
||||
IOSTORINV_IN_CONFIRM("3","入库确认",MapOf.of("warehousing_qty",false,"canuse_qty",true),1<<2),
|
||||
IOSTORINV_OUT_SEND("1","出库下发",MapOf.of("frozen_qty",true,"canuse_qty",false),1<<3),
|
||||
IOSTORINV_OUT_CACEL("2","出库取消",MapOf.of("frozen_qty",false,"canuse_qty",true),1<<4),
|
||||
IOSTORINV_OUT_CONFIRM("3","出库确认",MapOf.of("frozen_qty",false),1<<5),
|
||||
//移库
|
||||
IMOVEINV_IN_SEND("1","移库入下发", MapOf.of("warehousing_qty",true),1<<6),
|
||||
MOVEINV_IN_CACEL("2","移库入取消",MapOf.of("warehousing_qty",false),1<<7),
|
||||
MOVEINV_IN_CONFIRM("3","移库入确认",MapOf.of("warehousing_qty",false,"canuse_qty",true),1<<8),
|
||||
MOVEINV_OUT_SEND("1","移库出下发",MapOf.of("frozen_qty",true,"canuse_qty",false),1<<9),
|
||||
MOVEINV_OUT_CACEL("2","移库出取消",MapOf.of("frozen_qty",false,"canuse_qty",true),1<<10),
|
||||
IMOVEINV_OUT_CONFIRM("3","移库出确认",MapOf.of("frozen_qty",false),1<<11),
|
||||
MOVEINV_IN("3","移库入库",MapOf.of(),1<<12),
|
||||
MOVEINV_OUT("4","移库出库",MapOf.of(),1<<13),
|
||||
CHECK_IN("3","盘点单出库",MapOf.of(),1<<14),
|
||||
CHECK_OUT("4","盘点单回库",MapOf.of(),1<<15),
|
||||
//损益
|
||||
MOVEORLESS_IN("5","损溢单入库",MapOf.of("canuse_qty",true),1<<14),
|
||||
MOVEORLESS_OUT("6","损溢单出库",MapOf.of("canuse_qty",false),1<<15),
|
||||
;
|
||||
private String code;
|
||||
private String desc;
|
||||
//字段关系。根据单据状态判断字段是增加还是减少
|
||||
private Map<String,Boolean> fieldRelation;
|
||||
private int bitType;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package org.nl.wms.storage_manage;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/10 11:41
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ST_CHANGE_TYPE {
|
||||
IOSTORINV_IN("1","入库",""),
|
||||
IOSTORINV_OUT("1","出库",""),
|
||||
MOVEINV_IN("1","移库入库",""),
|
||||
MOVEINV_OUT("1","移库出库",""),
|
||||
MOVEORLESS_IN("1","损溢单入库",""),
|
||||
MOVEORLESS_OUT("1","损溢单出库",""),
|
||||
;
|
||||
private String code;
|
||||
private String desc;
|
||||
private String table;
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package org.nl.wms.storage_manage;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.nl.common.publish.PublishEvent;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.nl.common.publish.event.PublishEvent;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -12,16 +13,17 @@ import java.math.BigDecimal;
|
||||
* @Date 2023/5/10 11:37
|
||||
* 仓库物料事件
|
||||
*/
|
||||
@Builder
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class StorEvent implements PublishEvent {
|
||||
public class StorEvent extends PublishEvent {
|
||||
|
||||
private String struct_id;
|
||||
private String material_id;
|
||||
private String pcsn;
|
||||
private String bill_code;
|
||||
public ST_CHANGE_TYPE ST_CHANGE_TYPE;
|
||||
public CHANGE_BILL_TYPE_ENUM ST_CHANGE_TYPE;
|
||||
private BigDecimal change_qty;
|
||||
private BigDecimal result_qty;
|
||||
}
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package org.nl.wms.storage_manage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.publish.AbstraceListener;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtIostordailyService;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/10 11:39
|
||||
@@ -26,27 +19,8 @@ public class StorEventListener extends AbstraceListener<StorEvent> {
|
||||
@Autowired
|
||||
IStIvtStructattrService structattrService;
|
||||
@Override
|
||||
protected void doEvent(StorEvent event) {
|
||||
StIvtStructivtflow flow = new StIvtStructivtflow();
|
||||
基础数据封装: {
|
||||
flow.setChange_id(IdUtil.getStringId());
|
||||
flow.setMaterial_id(event.getMaterial_id());
|
||||
flow.setPcsn(event.getPcsn());
|
||||
flow.setBill_code(event.getBill_code());
|
||||
flow.setBill_type_scode(event.ST_CHANGE_TYPE.getCode());
|
||||
flow.setChange_qty(event.getChange_qty());
|
||||
flow.setResult_qty(event.getResult_qty());
|
||||
flow.setChange_person_name(SecurityUtils.getCurrentNickName());
|
||||
flow.setChange_person_id(SecurityUtils.getCurrentUserId());
|
||||
flow.setChange_time(new Date());
|
||||
}
|
||||
参数数据封装: {
|
||||
StIvtStructattr struct = structattrService.getOne(new QueryWrapper<StIvtStructattr>().eq("struct_id", event.getStruct_id()));
|
||||
flow.setStruct_id(event.getStruct_id());
|
||||
flow.setStruct_name(struct.getStruct_name());
|
||||
flow.setStruct_code(struct.getStruct_code());
|
||||
flow.setStor_id(struct.getStor_id());
|
||||
}
|
||||
StructivtflowService.save(flow);
|
||||
protected String doEvent(StorEvent event) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.controller.storage;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@RequestMapping("/api/stIvtBsrealstorattr")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "实物库属性表")
|
||||
@Slf4j
|
||||
public class StIvtBsrealstorattrController {
|
||||
|
||||
@Autowired
|
||||
protected IStIvtBsrealstorattrService stIvtBsrealstorattrService;
|
||||
|
||||
|
||||
@PostMapping("/queryStor")
|
||||
@Log("查询仓库")
|
||||
@ApiOperation("查询仓库")
|
||||
public ResponseEntity<Object> queryStor() {
|
||||
List<StIvtBsrealstorattr> list = stIvtBsrealstorattrService.list(new QueryWrapper<StIvtBsrealstorattr>().eq("is_used", true));
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.controller.storage;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/stIvtSectattr")
|
||||
public class StIvtSectattrController {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.controller.storage;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位属性表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/stIvtStructattr")
|
||||
public class StIvtStructattrController {
|
||||
|
||||
}
|
||||
|
||||
@@ -45,27 +45,31 @@ public class StIvtStructivtflow implements Serializable {
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode;
|
||||
|
||||
/**
|
||||
* 库存等级
|
||||
*/
|
||||
private String ivt_level;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean is_active;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
* 库存等级
|
||||
*/
|
||||
private String pcsn;
|
||||
private String ivt_level;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
@@ -75,7 +79,7 @@ public class StIvtStructivtflow implements Serializable {
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String bill_type_scode;
|
||||
private String bill_type;
|
||||
|
||||
/**
|
||||
* 单据标识
|
||||
@@ -93,24 +97,24 @@ public class StIvtStructivtflow implements Serializable {
|
||||
private String bill_table;
|
||||
|
||||
/**
|
||||
* 变动类型
|
||||
* 变动类型:单据类型
|
||||
*/
|
||||
private String change_type_scode;
|
||||
|
||||
/**
|
||||
* 变动时间
|
||||
*/
|
||||
private Date change_time;
|
||||
private Date create_time;
|
||||
|
||||
/**
|
||||
* 变动人
|
||||
*/
|
||||
private String change_person_id;
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 变动人姓名
|
||||
*/
|
||||
private String change_person_name;
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 变动数
|
||||
@@ -131,6 +135,10 @@ public class StIvtStructivtflow implements Serializable {
|
||||
* 车间标识
|
||||
*/
|
||||
private String product_area;
|
||||
/**
|
||||
* 车间标识
|
||||
*/
|
||||
private Boolean is_add;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.record.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class StIvtStructivtflowDto {
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
/**
|
||||
* 物料
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String bill_code;
|
||||
|
||||
/**
|
||||
* 单据对应业务表主表
|
||||
*/
|
||||
private String bill_table;
|
||||
|
||||
/**
|
||||
* 变动类型:单据类型
|
||||
*/
|
||||
private CHANGE_BILL_TYPE_ENUM change_type_scode;
|
||||
|
||||
/**
|
||||
* 变动数
|
||||
*/
|
||||
private BigDecimal change_qty;
|
||||
|
||||
/**
|
||||
* 结存数
|
||||
*/
|
||||
private BigDecimal result_qty;
|
||||
/**
|
||||
* 期初数
|
||||
*/
|
||||
private BigDecimal start_qty;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String base_unit_name;
|
||||
/**
|
||||
* 载具编号
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
/**
|
||||
* 当前任务编号
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.storage_manage.basedata.service.record.service;
|
||||
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dao.StIvtStructivtflow;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowDto;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface IStIvtStructivtflowService extends IService<StIvtStructivtflow> {
|
||||
|
||||
void recordStructivtFlow(StIvtStructivtflowDto flowDto);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.record.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dao.mapper.StIvtStructivtflowBcpMapper;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowDto;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivtflowService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -17,4 +30,51 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class StIvtStructivtflowServiceImpl extends ServiceImpl<StIvtStructivtflowBcpMapper, StIvtStructivtflow> implements IStIvtStructivtflowService {
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructattrService structattrService;
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService materialbaseService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void recordStructivtFlow(StIvtStructivtflowDto flowDto) {
|
||||
StIvtStructivtflow flow = new StIvtStructivtflow();
|
||||
StIvtStructattr struct_attr = structattrService.getOne(new QueryWrapper<StIvtStructattr>().eq("struct_code", flowDto.getStruct_code()));
|
||||
flow.setChange_id(IdUtil.getStringId());
|
||||
物料信息: {
|
||||
MdMeMaterialbase material = materialbaseService.getOne(new QueryWrapper<MdMeMaterialbase>().eq("material_id", flowDto.getMaterial_id()));
|
||||
flow.setMaterial_code(material.getMaterial_code());
|
||||
flow.setMaterial_spec(material.getMaterial_spec());
|
||||
flow.setPcsn(flowDto.getPcsn());
|
||||
}
|
||||
仓库信息:{
|
||||
flow.setStruct_code(struct_attr.getStruct_code());
|
||||
flow.setStruct_id(struct_attr.getStruct_id());
|
||||
flow.setStor_id(struct_attr.getStor_id());
|
||||
}
|
||||
flow.setBill_code(flowDto.getBill_code());
|
||||
flow.setChange_type_scode(flowDto.getChange_type_scode().getCode());
|
||||
flow.setBill_table(flowDto.getBill_table());
|
||||
flow.setChange_qty(flowDto.getChange_qty());
|
||||
flow.setResult_qty(flowDto.getResult_qty());
|
||||
flow.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
flow.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
flow.setCreate_time(new Date());
|
||||
this.save(flow);
|
||||
|
||||
struct_attr.setStoragevehicle_code(flowDto.getStoragevehicle_code());
|
||||
struct_attr.setInv_code(flowDto.getBill_code());
|
||||
struct_attr.setInv_type(flowDto.getChange_type_scode().getCode());
|
||||
//判断如果在3个状态之内,更新操作
|
||||
int tag = 1 << CHANGE_BILL_TYPE_ENUM.IMOVEINV_OUT_CONFIRM.getBitType()
|
||||
| 1 << CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_CONFIRM.getBitType()
|
||||
| 1 << CHANGE_BILL_TYPE_ENUM.MOVEINV_IN_CONFIRM.getBitType()
|
||||
| 1 << CHANGE_BILL_TYPE_ENUM.CHECK_OUT.getBitType()
|
||||
| 1 << CHANGE_BILL_TYPE_ENUM.IOSTORINV_OUT_CONFIRM.getBitType();
|
||||
if ((tag &~ 1 << flowDto.getChange_type_scode().getBitType()) != tag){
|
||||
struct_attr.setInv_code("");
|
||||
struct_attr.setInv_type("");
|
||||
}
|
||||
structattrService.updateById(struct_attr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
public interface IStIvtBsrealstorattrService extends IService<StIvtBsrealstorattr> {
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtSectattr;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
public interface IStIvtSectattrService extends IService<StIvtSectattr> {
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtStructattr;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位属性表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
public interface IStIvtStructattrService extends IService<StIvtStructattr> {
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtSectattr;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
public interface StIvtSectattrMapper extends BaseMapper<StIvtSectattr> {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtSectattrMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtBsrealstorattrMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@Service
|
||||
public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtBsrealstorattrMapper, StIvtBsrealstorattr> implements IStIvtBsrealstorattrService {
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtSectattrService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtSectattr;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtSectattrMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@Service
|
||||
public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, StIvtSectattr> implements IStIvtSectattrService {
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.storage.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtStructattrMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位属性表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@Service
|
||||
public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMapper, StIvtStructattr> implements IStIvtStructattrService {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.nl.wms.storage_manage.productmanage.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -12,20 +11,16 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbBucketrecord;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisdtlCpService;
|
||||
|
||||
@@ -52,8 +52,7 @@ public class StIvtIostorinvBcpController {
|
||||
@Log("查询入库单据")
|
||||
@ApiOperation("查询入库单据")
|
||||
public ResponseEntity<Object> query(BcpIostorInvQuery query, PageQuery page) {
|
||||
Page<StIvtIostorinvBcp> list = stIvtIostorinvBcpService.page(page.build(StIvtIostorinvBcp.class), query.build());
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
return new ResponseEntity<>(stIvtIostorinvBcpService.queryDtl(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@@ -86,15 +85,6 @@ public class StIvtIostorinvBcpController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/queryStor")
|
||||
@Log("查询仓库")
|
||||
@ApiOperation("查询仓库")
|
||||
public ResponseEntity<Object> queryStor() {
|
||||
return new ResponseEntity<>(semiProductInService.queryStor(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/commit")
|
||||
@Log("出入单提交")
|
||||
@ApiOperation("出入单提交")
|
||||
@@ -107,85 +97,25 @@ public class StIvtIostorinvBcpController {
|
||||
@Log("查询入库分配明细")
|
||||
@ApiOperation("查询入库分配明细")
|
||||
public ResponseEntity<Object> getIODtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(stIvtIostorinvBcpService.getInvDis(whereJson), HttpStatus.OK);
|
||||
return new ResponseEntity<>(stIvtIostorinvBcpService.getIoDtl(whereJson.toJavaObject(BcpIostorInvQuery.class)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmvehicle")
|
||||
@Log("组盘确认")
|
||||
@ApiOperation("组盘确认")
|
||||
public ResponseEntity<Object> confirmvehicle(@RequestBody JSONObject whereJson) {
|
||||
semiProductInService.confirmvehicle(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/divStruct")
|
||||
@Log("分配货位")
|
||||
@ApiOperation("分配货位")
|
||||
public ResponseEntity<Object> divStruct(@RequestBody JSONObject whereJson) {
|
||||
semiProductInService.divStruct(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/unDivStruct")
|
||||
@Log("取消分配货位")
|
||||
@ApiOperation("取消分配货位")
|
||||
public ResponseEntity<Object> unDivStruct(@RequestBody JSONObject whereJson) {
|
||||
semiProductInService.unDivStruct(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/divPoint")
|
||||
@Log("设置起点")
|
||||
@ApiOperation("设置起点")
|
||||
public ResponseEntity<Object> divPoint(@RequestBody JSONObject whereJson) {
|
||||
semiProductInService.divPoint(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/delDis")
|
||||
@Log("删除分配")
|
||||
@ApiOperation("删除分配")
|
||||
public ResponseEntity<Object> delDis(@RequestBody JSONObject whereJson) {
|
||||
semiProductInService.delDis(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryBoxMater")
|
||||
@Log("查询箱内子卷")
|
||||
@ApiOperation("查询箱内子卷")
|
||||
public ResponseEntity<Object> queryBoxMater(@RequestBody JSONArray whereJson) {
|
||||
return new ResponseEntity<>(semiProductInService.queryBoxMater(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/updateTask")
|
||||
@Log("变更任务")
|
||||
@ApiOperation("变更任务")
|
||||
public ResponseEntity<Object> updateTask(@RequestBody Map<String,Object> whereJson) {
|
||||
semiProductInService.updateTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("完成单据")
|
||||
@ApiOperation("完成单据")
|
||||
public ResponseEntity<Object> confirm(@RequestBody Map<String,Object> whereJson) {
|
||||
semiProductInService.confirm(whereJson);
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
stIvtIostorinvBcpService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/autoDis")
|
||||
@Log("自动分配")
|
||||
@ApiOperation("自动分配")
|
||||
public ResponseEntity<Object> autoDis(@RequestBody JSONObject whereJson) {
|
||||
semiProductInService.autoDis(whereJson);
|
||||
@PostMapping("/confirmTask")
|
||||
@Log("下发任务")
|
||||
@ApiOperation("下发任务")
|
||||
public ResponseEntity<Object> confirmTask(@RequestBody JSONObject whereJson) {
|
||||
stIvtIostorinvBcpService.confirmTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/getDisTask")
|
||||
@Log("获取明细任务")
|
||||
@ApiOperation("获取明细任务")
|
||||
public ResponseEntity<Object> getDisTask(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(semiProductInService.getDisTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dto.BcpIostorInvQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -16,12 +18,29 @@ import java.util.Map;
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface IStIvtIostorinvBcpService extends IService<StIvtIostorinvBcp> {
|
||||
|
||||
|
||||
Object queryDtl(BcpIostorInvQuery query, PageQuery page);
|
||||
|
||||
List<Map> getIoDtl(BcpIostorInvQuery query);
|
||||
/**
|
||||
* 新增
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String create(JSONObject form);
|
||||
void create(JSONObject form);
|
||||
/**
|
||||
* 完成
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String confirm(JSONObject form);
|
||||
/**
|
||||
* 下发单据
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String confirmTask(JSONObject form);
|
||||
/**
|
||||
* 修改单据
|
||||
* @param form
|
||||
@@ -29,10 +48,4 @@ public interface IStIvtIostorinvBcpService extends IService<StIvtIostorinvBcp> {
|
||||
*/
|
||||
String updateBill(JSONObject form);
|
||||
|
||||
/**
|
||||
* 获取分配明细
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
List<Map> getInvDis(JSONObject form);
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv;
|
||||
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvdisBcp;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface IStIvtIostorinvdisBcpService extends IService<StIvtIostorinvdisBcp> {
|
||||
/**
|
||||
* 查询明细
|
||||
* @param query:
|
||||
* iostorinv_id "1656252437415202816"
|
||||
* @return
|
||||
*/
|
||||
List<Map> getIostorinvdis(Map query);
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import lombok.EqualsAndHashCode;
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
* @since 2023-05-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -42,7 +42,6 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
* alter table st_ivt_iostorinv_bcp modify buss_type varchar(5) generated always as (bill_type) stored;
|
||||
*/
|
||||
private String buss_type;
|
||||
|
||||
@@ -50,10 +49,8 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
* 单据类型
|
||||
*/
|
||||
private String bill_type;
|
||||
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
* 单据zhuangtai
|
||||
*/
|
||||
private String bill_status;
|
||||
|
||||
@@ -62,6 +59,11 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
*/
|
||||
private Date biz_date;
|
||||
|
||||
/**
|
||||
* 关联单据
|
||||
*/
|
||||
private String base_bill_code;
|
||||
|
||||
/**
|
||||
* 车间标识
|
||||
*/
|
||||
@@ -112,32 +114,45 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
*/
|
||||
private String struct_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode;
|
||||
|
||||
/**
|
||||
* 库存等级
|
||||
*/
|
||||
private String ivt_level;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean is_active;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal total_qty;
|
||||
|
||||
/**
|
||||
* 明细数
|
||||
*/
|
||||
private Integer detail_count;
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
private String base_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
private String base_unit_name;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
@@ -169,6 +184,35 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
*/
|
||||
private Date update_time;
|
||||
|
||||
/**
|
||||
* 执行状态
|
||||
*/
|
||||
private String work_status;
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 存储载具类型
|
||||
*/
|
||||
private String storagevehicle_type;
|
||||
|
||||
/**
|
||||
* 单重
|
||||
*/
|
||||
private BigDecimal unit_weight;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
@@ -179,6 +223,10 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 入库点
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_iostorinvdis_bcp")
|
||||
public class StIvtIostorinvdisBcp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 出入单分配标识
|
||||
*/
|
||||
@TableId(value = "iostorinvdis_id")
|
||||
private String iostorinvdis_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String iostorinv_id;
|
||||
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private Integer seq_no;
|
||||
|
||||
/**
|
||||
* 关联基础单编号
|
||||
*/
|
||||
private String base_bill_code;
|
||||
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String region_code;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String region_name;
|
||||
|
||||
/**
|
||||
* 点位标识
|
||||
*/
|
||||
private String struct_id;
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 点位名称
|
||||
*/
|
||||
private String struct_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode;
|
||||
|
||||
/**
|
||||
* 执行状态
|
||||
*/
|
||||
@Deprecated
|
||||
private String work_status;
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
/**
|
||||
* 单重
|
||||
*/
|
||||
private BigDecimal unit_weight;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String base_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
*/
|
||||
private String base_unit_name;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
/**
|
||||
* 出入点位标识
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.anno.Datazhuazhua;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dto.BcpIostorInvQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -14,5 +19,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
@Datazhuazhua
|
||||
public interface StIvtIostorinvBcpMapper extends BaseMapper<StIvtIostorinvBcp> {
|
||||
|
||||
List<Map> getIostorinv(@Param("query") BcpIostorInvQuery query);
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper;
|
||||
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvdisBcp;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface StIvtIostorinvdisBcpMapper extends BaseMapper<StIvtIostorinvdisBcp> {
|
||||
|
||||
List<Map> getIostorinvdis(Map query);
|
||||
}
|
||||
@@ -1,5 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper.StIvtIostorinvBcpMapper">
|
||||
<select id="getIostorinv" resultType="java.util.Map">
|
||||
SELECT
|
||||
dtl.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec
|
||||
FROM
|
||||
st_ivt_iostorinv_bcp dtl
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dtl.material_id
|
||||
<where>
|
||||
dtl.is_delete = false
|
||||
<if test="query.stor_id != null and query.stor_id != ''">
|
||||
and dtl.stor_id = #{query.stor_id }
|
||||
</if>
|
||||
<if test="query.iostorinv_id != null and query.iostorinv_id != ''">
|
||||
and dtl.iostorinv_id = #{query.iostorinv_id }
|
||||
</if>
|
||||
<if test="query.bill_code != null and query.bill_code != ''">
|
||||
and dtl.bill_code like %${query.bill_code}%'
|
||||
</if>
|
||||
<if test="query.bill_status != null and query.bill_status != ''">
|
||||
and dtl.bill_status = #{query.bill_status}
|
||||
</if>
|
||||
<if test="query.io_type != null and query.io_type != ''">
|
||||
and dtl.io_type = #{query.io_type}
|
||||
</if>
|
||||
<if test="query.start_time != null and query.start_time != ''">
|
||||
and dtl.create_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time != null and query.end_time != ''">
|
||||
and #{query.end_time} >= dtl.create_time
|
||||
</if>
|
||||
</where>
|
||||
order by dtl.create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper.StIvtIostorinvdisBcpMapper">
|
||||
|
||||
<select id="getIostorinvdis" resultType="java.util.Map">
|
||||
SELECT
|
||||
dtl.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec
|
||||
FROM
|
||||
st_ivt_iostorinvdis_bcp dtl
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dtl.material_id
|
||||
<where>
|
||||
<if test="bill_code != null and bill_code != ''">
|
||||
and dtl.bill_code = #{bill_code}
|
||||
</if>
|
||||
<if test="iostorinv_id != null and iostorinv_id != ''">
|
||||
and dtl.iostorinv_id = #{iostorinv_id}
|
||||
</if>
|
||||
</where>
|
||||
order by dtl.seq_no ASC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -4,7 +4,6 @@ import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvCp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
|
||||
|
||||
/*
|
||||
@@ -17,6 +16,8 @@ public class BcpIostorInvQuery extends BaseQuery<StIvtIostorinvBcp> {
|
||||
|
||||
private String stor_id;
|
||||
|
||||
private String iostorinv_id;
|
||||
|
||||
private String bill_status;
|
||||
|
||||
private String bill_type;
|
||||
|
||||
@@ -3,28 +3,41 @@ package org.nl.wms.storage_manage.semimanage.service.iostorInv.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.publish.BussEventMulticaster;
|
||||
import org.nl.common.publish.event.PointEvent;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvdisBcpService;
|
||||
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowDto;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvdisBcp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper.StIvtIostorinvBcpMapper;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dto.BcpIostorInvQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.IStIvtStructivtBcpService;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -38,27 +51,140 @@ import java.util.Map;
|
||||
public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpMapper, StIvtIostorinvBcp> implements IStIvtIostorinvBcpService {
|
||||
|
||||
@Autowired
|
||||
IStIvtBsrealstorattrService storattrService;
|
||||
|
||||
private IStIvtBsrealstorattrService storattrService;
|
||||
@Autowired
|
||||
IStIvtIostorinvdisBcpService storinvdisBcpService;
|
||||
private IStIvtStructivtBcpService structivtBcpService;
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService structivtflowService;
|
||||
@Autowired
|
||||
private IStIvtStructattrService structattrService;
|
||||
|
||||
|
||||
@Override
|
||||
public Object queryDtl(BcpIostorInvQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage()+1, pageQuery.getSize());
|
||||
TableDataInfo build = TableDataInfo.build(this.getIoDtl(query));
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getIoDtl(BcpIostorInvQuery query) {
|
||||
return this.baseMapper.getIostorinv(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String create(JSONObject form) {
|
||||
public void create(JSONObject form) {
|
||||
Assert.notNull(form,"参数不能为空");
|
||||
StIvtIostorinvBcp mst = packageMstForm(form);
|
||||
this.save(mst);
|
||||
int i = 1;
|
||||
for (Object item : form.getJSONArray("tableData")) {
|
||||
JSONObject row = (JSONObject) item;
|
||||
StIvtIostorinvdisBcp dis = packageDisForm(mst, i, row);
|
||||
storinvdisBcpService.save(dis);
|
||||
i++;
|
||||
StIvtIostorinvBcp mst = new StIvtIostorinvBcp();
|
||||
mst.setIostorinv_id(IdUtil.getStringId());
|
||||
mst.setBill_code(CodeUtil.getNewCode("IO_CODE"));
|
||||
mst.setBiz_date(form.getDate("biz_date"));
|
||||
mst.setBill_type(form.getString("bill_type"));
|
||||
mst.setIo_type(IOSEnum.IO_TYPE.code("入库"));
|
||||
mst.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||
mst.setRemark(form.getString("remark"));
|
||||
mst.setProduct_area(form.getString("product_code"));
|
||||
mst.setPoint_code(form.getString("point_code"));
|
||||
仓库数据:{
|
||||
StIvtBsrealstorattr stor = storattrService.getOne(new QueryWrapper<StIvtBsrealstorattr>().eq("stor_id", form.getString("stor_id")));
|
||||
mst.setStor_id(stor.getStor_id());
|
||||
mst.setStor_code(stor.getStor_code());
|
||||
mst.setStor_name(stor.getStor_name());
|
||||
}
|
||||
packageRow(mst, (JSONObject) item);
|
||||
mst.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setCreate_time(new Date());
|
||||
this.save(mst);
|
||||
}
|
||||
return mst.getIostorinv_id();
|
||||
}
|
||||
|
||||
private void packageRow(StIvtIostorinvBcp mst, JSONObject row) {
|
||||
mst.setMaterial_id(row.getString("material_id"));
|
||||
mst.setPcsn(StringUtils.isNotEmpty(row.getString("pcsn"))? row.getString("pcsn"): DateUtil.today());
|
||||
mst.setPlan_qty(row.getBigDecimal("plan_qty"));
|
||||
mst.setQuality_scode(row.getString("quality_scode"));
|
||||
mst.setBase_unit_id(row.getString("base_unit_id"));
|
||||
mst.setBase_bill_code(row.getString("base_bill_code"));
|
||||
mst.setBase_unit_name(row.getString("base_unit_name"));
|
||||
mst.setUnit_weight(row.getBigDecimal("unit_weight"));
|
||||
mst.setStoragevehicle_code(row.getString("storagevehicle_code"));
|
||||
mst.setStoragevehicle_id(row.getString("storagevehicle_id"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String confirm(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form,form.get("iostorinv_id")},"请求参数不能为空");
|
||||
StIvtIostorinvBcp mst = this.getById(form.getString("iostorinv_id"));
|
||||
checkParam(mst);
|
||||
mst.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
mst.setUpdate_time(new Date());
|
||||
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
this.updateById(mst);
|
||||
structivtBcpService.updateCashByParam(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_CONFIRM,mst.getPlan_qty(),mst.getStruct_code());
|
||||
|
||||
structivtflowService.recordStructivtFlow(
|
||||
StIvtStructivtflowDto.builder()
|
||||
.bill_code(mst.getBill_code()).change_type_scode(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_CONFIRM).bill_table("st_ivt_iostorinv_bcp")
|
||||
.material_id(mst.getMaterial_id()).pcsn(mst.getPcsn())
|
||||
.struct_code(mst.getStruct_code()).result_qty(structivtBcpService.getOne(new QueryWrapper<StIvtStructivtBcp>().eq("struct_code", mst.getStruct_code())).getCanuse_qty()).change_qty(mst.getPlan_qty())
|
||||
.task_id(mst.getTask_id())
|
||||
.storagevehicle_code(mst.getStoragevehicle_code())
|
||||
.build()
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String confirmTask(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form,form.get("iostorinv_id")},"请求参数不能为空");
|
||||
StIvtIostorinvBcp mst = this.getById(form.getString("iostorinv_id"));
|
||||
checkParam(mst);
|
||||
//分配货位。下发任务,更新主单据状态。更新明细任务
|
||||
List<StIvtStructivtBcp> struct_codes = structivtBcpService.allocationRules(1);
|
||||
if (CollectionUtils.isEmpty(struct_codes)){
|
||||
throw new BadRequestException("无可分配货位");
|
||||
}
|
||||
PointEvent event = PointEvent.builder()
|
||||
.type(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND.getCode())
|
||||
.point_code1(mst.getPoint_code())
|
||||
.point_code2(struct_codes.get(0).getStruct_code())
|
||||
.callback((Consumer<String>) mst::setTask_id)
|
||||
.build();
|
||||
BussEventMulticaster.Publish(event);
|
||||
mst.setBill_status(IOSEnum.BILL_STATUS.code("下发"));
|
||||
mst.setUpdate_time(new Date());
|
||||
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
this.updateById(mst);
|
||||
//更新仓位
|
||||
StIvtStructivtBcp struct = structivtBcpService.getOne(new QueryWrapper<StIvtStructivtBcp>().eq("struct_code", mst.getStruct_code()));
|
||||
//插入库存变动表
|
||||
structivtflowService.recordStructivtFlow(
|
||||
StIvtStructivtflowDto.builder()
|
||||
.bill_code(mst.getBill_code()).change_type_scode(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND).bill_table("st_ivt_iostorinv_bcp")
|
||||
.material_id(mst.getMaterial_id()).pcsn(mst.getPcsn())
|
||||
.struct_code(mst.getStruct_code()).result_qty(struct.getCanuse_qty()).change_qty(mst.getPlan_qty())
|
||||
.task_id(mst.getTask_id())
|
||||
.storagevehicle_code(mst.getStoragevehicle_code())
|
||||
.build()
|
||||
);
|
||||
return mst.getTask_id();
|
||||
}
|
||||
|
||||
private void checkParam(StIvtIostorinvBcp mst) {
|
||||
if (mst == null || mst.getIs_delete()==true){
|
||||
throw new BadRequestException("单据不存在");
|
||||
}
|
||||
if (!IOSEnum.BILL_STATUS.code("生成").equals(mst.getBill_status())){
|
||||
throw new BadRequestException("单据"+ mst.getBill_code()+"状态不是生成状态");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -68,66 +194,11 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setUpdate_time(new Date());
|
||||
this.updateById(mst);
|
||||
storinvdisBcpService.remove(new QueryWrapper<StIvtIostorinvdisBcp>().eq("iostorinv_id",mst.getIostorinv_id()));
|
||||
int i = 1;
|
||||
for (Object item : form.getJSONArray("tableData")) {
|
||||
JSONObject row = (JSONObject) item;
|
||||
StIvtIostorinvdisBcp dis = packageDisForm(mst, i, row);
|
||||
storinvdisBcpService.save(dis);
|
||||
i++;
|
||||
packageRow(mst,(JSONObject)item);
|
||||
}
|
||||
this.updateById(mst);
|
||||
return mst.getIostorinv_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getInvDis(JSONObject form) {
|
||||
return storinvdisBcpService.getIostorinvdis(form);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private StIvtIostorinvdisBcp packageDisForm(StIvtIostorinvBcp mst, int i, JSONObject row) {
|
||||
StIvtIostorinvdisBcp dis = new StIvtIostorinvdisBcp();
|
||||
dis.setIostorinv_id(mst.getIostorinv_id());
|
||||
dis.setIostorinvdis_id(IdUtil.getStringId());
|
||||
dis.setMaterial_id(row.getString("material_id"));
|
||||
|
||||
dis.setPcsn(StringUtils.isNotEmpty(row.getString("pcsn"))?row.getString("pcsn"): DateUtil.today());
|
||||
dis.setPlan_qty(row.getBigDecimal("plan_qty"));
|
||||
dis.setQuality_scode(row.getString("quality_scode"));
|
||||
dis.setBase_unit_id(row.getString("base_unit_id"));
|
||||
dis.setBase_unit_name(row.getString("base_unit_name"));
|
||||
dis.setBase_bill_code(row.getString("base_bill_code"));
|
||||
dis.setPoint_code(row.getString("point_id"));
|
||||
dis.setUnit_weight(row.getBigDecimal("unit_weight"));
|
||||
dis.setStoragevehicle_code(row.getString("storagevehicle_code"));
|
||||
dis.setStoragevehicle_id(row.getString("storagevehicle_id"));
|
||||
dis.setSeq_no(i);
|
||||
return dis;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private StIvtIostorinvBcp packageMstForm(JSONObject form) {
|
||||
StIvtIostorinvBcp mst = new StIvtIostorinvBcp();
|
||||
mst.setIostorinv_id(IdUtil.getStringId());
|
||||
mst.setBill_code(CodeUtil.getNewCode("IO_CODE"));
|
||||
mst.setBiz_date(form.getDate("biz_date"));
|
||||
mst.setBill_type(form.getString("bill_type"));
|
||||
mst.setTotal_qty(form.getBigDecimal("total_qty"));
|
||||
mst.setDetail_count(form.getJSONArray("tableData").size());
|
||||
mst.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||
mst.setIo_type(IOSEnum.IO_TYPE.code("入库"));
|
||||
mst.setRemark(form.getString("remark"));
|
||||
mst.setProduct_area(form.getString("product_code"));
|
||||
仓库数据:{
|
||||
StIvtBsrealstorattr stor = storattrService.getOne(new QueryWrapper<StIvtBsrealstorattr>().eq("stor_id", form.getString("stor_id")));
|
||||
mst.setStor_id(stor.getStor_id());
|
||||
mst.setStor_code(stor.getStor_code());
|
||||
mst.setStor_name(stor.getStor_name());
|
||||
}
|
||||
mst.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setCreate_time(new Date());
|
||||
return mst;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv.impl;
|
||||
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvdisBcp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper.StIvtIostorinvdisBcpMapper;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvdisBcpService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Service
|
||||
public class StIvtIostorinvdisBcpServiceImpl extends ServiceImpl<StIvtIostorinvdisBcpMapper, StIvtIostorinvdisBcp> implements IStIvtIostorinvdisBcpService {
|
||||
|
||||
@Override
|
||||
public List<Map> getIostorinvdis(Map query) {
|
||||
if (query == null || (query.get("iostorinv_id") == null && query.get("bill_code") == null)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return baseMapper.getIostorinvdis(query);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.structIvt;
|
||||
|
||||
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存表 服务类
|
||||
@@ -12,5 +16,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface IStIvtStructivtBcpService extends IService<StIvtStructivtBcp> {
|
||||
//货位分配规则
|
||||
List<StIvtStructivtBcp> allocationRules(Integer num);
|
||||
|
||||
void updateCashByParam(CHANGE_BILL_TYPE_ENUM event, BigDecimal plan_qty,String struct_code);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,11 +22,6 @@ public class StIvtStructivtBcp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 库存记录标识
|
||||
*/
|
||||
private String stockrecord_id;
|
||||
|
||||
/**
|
||||
* 仓位标识
|
||||
*/
|
||||
@@ -70,7 +65,7 @@ public class StIvtStructivtBcp implements Serializable {
|
||||
/**
|
||||
* 库存数
|
||||
*/
|
||||
private BigDecimal ivt_qty;
|
||||
private BigDecimal canuse_qty;
|
||||
|
||||
/**
|
||||
* 计量单位标识
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.structIvt.dao.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存表 Mapper 接口
|
||||
@@ -13,4 +17,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface StIvtStructivtBcpMapper extends BaseMapper<StIvtStructivtBcp> {
|
||||
|
||||
int batchUpdateByParam(@Param("event") List<Map> event, @Param("struct_code")String struct_code);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,4 +2,21 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.storage_manage.semimanage.service.structIvt.dao.mapper.StIvtStructivtBcpMapper">
|
||||
|
||||
<update id="batchUpdateByParam">
|
||||
update user_distribute set
|
||||
<foreach collection="event" item="item" separator=",">
|
||||
${item.field} = ${item.field}
|
||||
<choose>
|
||||
<when test="item.add == true">
|
||||
+
|
||||
</when>
|
||||
<otherwise>
|
||||
-
|
||||
</otherwise>
|
||||
</choose>
|
||||
#{item.value,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
where struct_code = #{struct_code}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.structIvt.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.mapper.StIvtStructivtBcpMapper;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.IStIvtStructivtBcpService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存表 服务实现类
|
||||
@@ -17,4 +30,32 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class StIvtStructivtBcpServiceImpl extends ServiceImpl<StIvtStructivtBcpMapper, StIvtStructivtBcp> implements IStIvtStructivtBcpService {
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructattrService structattrService;
|
||||
|
||||
@Override
|
||||
public List<StIvtStructivtBcp> allocationRules(Integer num) {
|
||||
QueryWrapper<StIvtStructivtBcp> query = new QueryWrapper<StIvtStructivtBcp>()
|
||||
.eq("is_active", true)
|
||||
.isNull("material_id");
|
||||
Page<StIvtStructivtBcp> page = this.page(new Page<>(0, 3), query);
|
||||
List<StIvtStructivtBcp> records = page.getRecords();
|
||||
return records;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCashByParam(CHANGE_BILL_TYPE_ENUM event, BigDecimal plan_qty, String struct_code) {
|
||||
if (!StringUtils.isEmpty(struct_code)){
|
||||
Map<String, Boolean> fieldRelation = event.getFieldRelation();
|
||||
ArrayList<Map> list = new ArrayList<>();
|
||||
for (Map.Entry<String, Boolean> entry : fieldRelation.entrySet()) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("field",entry.getKey());
|
||||
map.put("value",plan_qty);
|
||||
map.put("add",entry.getValue());
|
||||
list.add(map);
|
||||
}
|
||||
this.baseMapper.batchUpdateByParam(list,struct_code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user