opt: 备货区与气胀轴库优化

This commit is contained in:
2024-06-30 14:22:54 +08:00
parent 170f925202
commit eb95498a07
3 changed files with 29 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
package org.nl.b_lms.bst.ivt.shafttubeivt.controller;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dto.BstIvtShafttubeivtQuery;
import org.nl.common.TableDataInfo;
@@ -37,8 +38,7 @@ public class BstIvtShafttubeivtController {
@PostMapping
@Log("新增穿拔轴区点位库存管理")
//@SaCheckPermission("@el.check('bstIvtShafttubeivt:add')")
public ResponseEntity
<Object> create(@Validated @RequestBody BstIvtShafttubeivt entity){
public ResponseEntity <Object> create(@Validated @RequestBody BstIvtShafttubeivt entity){
bstIvtShafttubeivtService.create(entity);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@@ -58,4 +58,12 @@ public class BstIvtShafttubeivtController {
bstIvtShafttubeivtService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("设置是否有轴")
//@SaCheckPermission("@el.check('bstIvtShafttubeivt:del')")
@PostMapping("/setHaveShaft")
public ResponseEntity<Object> setHaveShaft(@RequestBody JSONObject param) {
bstIvtShafttubeivtService.setHaveShaft(param);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
}

View File

@@ -1,5 +1,6 @@
package org.nl.b_lms.bst.ivt.shafttubeivt.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dto.BstIvtShafttubeivtQuery;
import org.nl.common.domain.query.PageQuery;
@@ -92,4 +93,6 @@ public interface IBstIvtShafttubeivtService extends IService<BstIvtShafttubeivt>
* @return
*/
List<BstIvtShafttubeivt> getNotTaskShaftCacheEmpty(BstIvtShafttubeivt startPoint);
void setHaveShaft(JSONObject param);
}

View File

@@ -3,6 +3,8 @@ package org.nl.b_lms.bst.ivt.shafttubeivt.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -12,6 +14,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dto.BstIvtShafttubeivtQuery;
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
import org.nl.common.utils.TaskUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.SecurityUtils;
@@ -24,6 +27,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
/**
* @description 服务实现
@@ -128,4 +132,16 @@ public class BstIvtShafttubeivtServiceImpl extends ServiceImpl<BstIvtShafttubeiv
return bstIvtShafttubeivtMapper.getNotTaskShaftCacheEmpty(startPoint);
}
@Override
public void setHaveShaft(JSONObject param) {
JSONArray data = param.getJSONArray("data");
String have_qzz = param.getString("have_qzz");
List<BstIvtShafttubeivt> list = data.toJavaList(BstIvtShafttubeivt.class);
list.forEach(bs -> {
bs.setHave_qzz(have_qzz);
TaskUtils.updateOptMessageByBShaftPoint(bs);
});
this.updateBatchById(list);
}
}