rev: 成品入库分配修改

This commit is contained in:
2023-05-15 11:53:40 +08:00
parent 535b1a6b8c
commit 9aeff869a6
7 changed files with 86 additions and 20 deletions

View File

@@ -72,10 +72,10 @@ public class SectattrController {
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/getSect")
@PostMapping("/getSect")
@Log("查询库区下拉框")
@ApiOperation("查询库区下拉框")
public ResponseEntity<Object> querySect(@RequestParam JSONObject query) {
public ResponseEntity<Object> querySect(@RequestBody JSONObject query) {
List<Map> list = isectattrService.getSect(query);
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
}

View File

@@ -7,9 +7,9 @@
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
stor.stor_name,
stor.stor_id,
stor.stor_code
FROM
st_ivt_sectattr
LEFT JOIN st_ivt_bsrealstorattr stor ON st_ivt_sectattr.stor_id = stor.stor_id

View File

@@ -321,6 +321,7 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
6.更新库存、日物流表等、
*/
String struct_id = whereJson.getString("struct_id");
StIvtStructattr attrDao = new StIvtStructattr();
@@ -335,10 +336,7 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
/* 手动分配 */
// 查出对应仓位
attrDao = iStIvtStructattrService.getOne(
new QueryWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_id,struct_id)
);
attrDao = iStIvtStructattrService.getById(struct_id);
}
if (ObjectUtil.isEmpty(attrDao.getStruct_code())) throw new BadRequestException("未找到仓位!");
@@ -346,7 +344,18 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
// 2.更新分配明细、分配、明细、主表
updateDivIos(attrDao,whereJson);
// TODO 更新点位
// 3.更新仓位状态 - 锁定
StIvtIostorinvCp mstDao = this.getById(whereJson.getString("iostorinv_id"));
attrDao.setLock_type("01"); // TODO 暂时写死
attrDao.setUpdate_id(SecurityUtils.getCurrentUserId());
attrDao.setUpdate_name(SecurityUtils.getCurrentNickName());
attrDao.setUpdate_time(new Date());
attrDao.setInv_type(IOSEnum.IO_TYPE.code("入库"));
attrDao.setInv_id(mstDao.getIostorinv_id());
attrDao.setInv_code(mstDao.getBill_code());
iStIvtStructattrService.updateById(attrDao);
// TODO 更新库存、物流等
}

View File

@@ -0,0 +1,56 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import java.util.stream.Collectors;
public class Test3 {
public static void main(String[] args) {
JSONArray array = new JSONArray();
JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("name", "小三");
jsonObject1.put("age", "12");
array.add(jsonObject1);
JSONObject jsonObject2 = new JSONObject();
jsonObject2.put("name", "小二");
jsonObject2.put("age", "17");
array.add(jsonObject2);
JSONObject jsonObject3 = new JSONObject();
jsonObject3.put("name", "小二");
jsonObject3.put("age", "17");
array.add(jsonObject3);
Set<JSONObject> name = array.stream().map(row -> ((JSONObject) row)).collect(Collectors.toSet());
HashMap<String, JSONObject> name1 = array.stream().collect(HashMap::new, (k, v) -> k.put(((JSONObject) v).getString("name"), (JSONObject) v), HashMap::putAll);
HashSet<JSONObject> collect = array.stream().collect(HashSet::new, (k, v) -> k.add((JSONObject) v), HashSet::addAll);
collect.stream().forEach(json -> a(json.getString("name")));
List<Map> maps = new ArrayList<>();
HashMap<String, String> map = new HashMap<>();
map.put("storagevehicle_code","1");
map.put("storagevehicle_name","sadfs");
maps.add(map);
HashMap<String, String> map2 = new HashMap<>();
map2.put("storagevehicle_code","2");
map2.put("storagevehicle_name","sdfd");
maps.add(map2);
boolean age = array.stream().filter(row -> ((JSONObject) row).getString("age").equals("18")).findAny().isPresent();
System.out.println(age);
}
public static void a(String name) {
}
public static void b(String name) {
}
}