Merge branch 'ycds-wms-dev' of http://47.97.1.152:5880/r/zy-asrs-master into ycds-wms-dev
| | |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <div class="pick-wall-box"> |
| | | <el-col :span="6" v-for="(item, index) in seedBracket" :key="index" @click.native="lightClick(item)"> |
| | | <el-col :span="6" v-for="(item, index) in seedBracket" :key="index" > |
| | | <div class="seed-bracket" :style="getLightStatus(item)" /> |
| | | </el-col> |
| | | </div> |
| | |
| | | <el-col> |
| | | <div class="header-title">拣货数量:</div> |
| | | <dv-border-box-10 class="box"> |
| | | <el-input type="text" v-model="getWorkQty" disabled></el-input> |
| | | <el-input type="text" v-model="selected.revQty" disabled></el-input> |
| | | </dv-border-box-10> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | //隐藏弹框 |
| | | this.show = false |
| | | // eslint-disable-next-line no-undef |
| | | $ajax.post('wave/sow/review', { waveSeedId: this.selected.id, reviewNum: this.getWorkQty }).then(response => { |
| | | $ajax.post('wave/sow/review', { waveSeedId: this.selected.id, reviewNum: this.selected.revQty }).then(response => { |
| | | if (response.code === 200) { |
| | | this.getWaves() |
| | | } else { |
| | |
| | | const licenseDays = ref(365);
|
| | | getLicenseDays();
|
| | | function getLicenseDays() {
|
| | | const currentDate = new Date();
|
| | | const newDate = new Date(currentDate);
|
| | | post('/api/license/getLicenseDays', {}).then((resp) => {
|
| | | let result = resp.data;
|
| | | let data = result.data;
|
| | | if (result.code == 200) {
|
| | | licenseDays.value = data;
|
| | | if(data <= 15) {
|
| | | newDate.setDate(currentDate.getDate() + data);
|
| | | alert("许可证有效期:" + data + "天," + "到期日期:" + formatDate(newDate))
|
| | | }
|
| | | }
|
| | | })
|
| | | }
|
| | |
|
| | | // 完整的日期格式化函数
|
| | | function formatDate(date, format = 'yyyy-MM-dd') {
|
| | | const year = date.getFullYear();
|
| | | const month = String(date.getMonth() + 1).padStart(2, '0');
|
| | | const day = String(date.getDate()).padStart(2, '0');
|
| | |
|
| | | return format
|
| | | .replace('yyyy', year)
|
| | | .replace('MM', month)
|
| | | .replace('dd', day);
|
| | | }
|
| | |
|
| | | const switchHost = (item) => {
|
| | | globalState.currentHost = item;
|
| | | postForm('/api/root/change/host/auth', {
|
| | |
| | | const TABLE_KEY = 'table-locDetl';
|
| | | let currentPage = 1;
|
| | | let pageSize = 10;
|
| | | let allQty = 0;
|
| | | const searchInput = ref("")
|
| | | const orderBy = ref({});
|
| | | const searchParam = ref({
|
| | |
| | | let tableData = ref([]);
|
| | | getColumns();
|
| | | getPage();
|
| | |
|
| | | getTotalQty();
|
| | | const {
|
| | | getColumnSearchProps,
|
| | | handleResizeColumn,
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | function getTotalQty() {
|
| | | state.loading = true;
|
| | | post('/api/locDetl/all/Qty').then((resp) => {
|
| | | let result = resp.data;
|
| | | if (result.code == 200) {
|
| | | let {data} = result;
|
| | | console.log("------------=======>");
|
| | | allQty = data?.allQty;
|
| | | state.loading = false;
|
| | | } else if (result.code === 401) {
|
| | | message.error(result.msg);
|
| | | logout()
|
| | | } else {
|
| | | message.error(result.msg);
|
| | | }
|
| | | })
|
| | | }
|
| | |
|
| | |
|
| | | function getPage() {
|
| | | state.loading = true;
|
| | | post('/api/locDetl/page', {
|
| | |
| | | </template>
|
| | | </template>
|
| | | <template #footer>
|
| | | <div>
|
| | | <span>当前页总量:{{ total }}</span>
|
| | | <div style="display: 'flex';">
|
| | | <span>总库存:{{ allQty }} </span>
|
| | | <span>, 当前页总量:{{ total }}</span>
|
| | | </div>
|
| | | </template>
|
| | | </a-table>
|
| | |
| | | * 数量 |
| | | */ |
| | | private Integer anfme; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer revQty; |
| | | /** |
| | | * 波次号 |
| | | */ |
| | |
| | | package com.zy.asrs.wms.asrs.controller;
|
| | |
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.alibaba.fastjson.parser.Feature;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | |
| | | import com.zy.asrs.wms.asrs.service.LocDetlService;
|
| | | import com.zy.asrs.wms.system.controller.BaseController;
|
| | | import com.zy.asrs.wms.utils.ExcelUtil;
|
| | | import com.zy.asrs.wms.utils.Utils;
|
| | | import org.springframework.beans.BeanUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | |
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')")
|
| | | @PostMapping("/locDetl/page")
|
| | | @CacheData(tableName = {"man_loc_detl"})
|
| | | public R page(@RequestBody Map<String, Object> map) {
|
| | | // String orderType = null;
|
| | | // if (Objects.isNull(map.get("orderType"))) {
|
| | | // orderType = map.get("orderType").toString();
|
| | | // map.remove("orderType");
|
| | | // }
|
| | | Map<String, String> order = new HashMap<>();
|
| | | if (!Objects.isNull(map.get("orderBy"))) {
|
| | | order = JSONObject.parseObject(JSON.toJSONString(map.get("orderBy")), Map.class);
|
| | | }
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewLocDetl, BaseParam> pageParam = new PageParam<>(baseParam, ViewLocDetl.class);
|
| | | PageParam<ViewLocDetl, BaseParam> data = locDetlService.getPage(pageParam, pageParam.buildWrapper(true));
|
| | | QueryWrapper<ViewLocDetl> wrapper = pageParam.ignoreWrapper(true);
|
| | | if (!Cools.isEmpty(order)) {
|
| | | String fileds = Utils.toSymbolCase(order.get("field"), '_');
|
| | | if (order.get("order").equals("asc")) {
|
| | | wrapper.orderByAsc(fileds);
|
| | | } else {
|
| | | wrapper.orderByDesc(fileds);
|
| | | }
|
| | | } else {
|
| | | wrapper.orderByDesc("create_time");
|
| | | }
|
| | | PageParam<ViewLocDetl, BaseParam> data = locDetlService.getPage(pageParam, wrapper);
|
| | |
|
| | | return R.ok(data);
|
| | | return R.ok().add(data);
|
| | | }
|
| | |
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')")
|
| | | @PostMapping("/locDetl/all/Qty")
|
| | | public R getAllStock() {
|
| | | return locDetlService.getAllStockQty();
|
| | | }
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')")
|
| | | @PostMapping("/locDetl/outPage")
|
| | | @CacheData(tableName = {"man_loc_detl"})
|
| | | public R outPage(@RequestBody Map<String, Object> map) {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewLocDetl, BaseParam> pageParam = new PageParam<>(baseParam, ViewLocDetl.class);
|
| | |
| | | package com.zy.asrs.wms.asrs.controller;
|
| | |
|
| | | import com.alibaba.fastjson.JSON;
|
| | | 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.extension.plugins.pagination.Page;
|
| | |
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:order:list')")
|
| | | @PostMapping("/order/in/page")
|
| | | // @CacheData(tableName = {"man_order", "man_order_type"})
|
| | | public R pageIn(@RequestBody Map<String, Object> map) {
|
| | | Map<String, String> order = new HashMap<>();
|
| | | if (!Objects.isNull(map.get("orderBy"))) {
|
| | | order = JSONObject.parseObject(JSON.toJSONString(map.get("orderBy")), Map.class);
|
| | | }
|
| | | String condition = map.getOrDefault("condition", "").toString();
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<Order, BaseParam> pageParam = new PageParam<>(baseParam, Order.class);
|
| | | // QueryWrapper<Order> wrapper = pageParam.buildWrapper(true);
|
| | | QueryWrapper<Order> wrapper = new QueryWrapper<>();
|
| | |
|
| | | QueryWrapper<Order> wrapper = pageParam.ignoreWrapper(true);
|
| | | ArrayList<Long> types = new ArrayList<>();
|
| | | for (OrderType orderType : orderTypeService.list(new LambdaQueryWrapper<OrderType>().in(OrderType::getType, 1))) {
|
| | | types.add(orderType.getId());
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | wrapper.orderByDesc("create_time");
|
| | |
|
| | | if (!Cools.isEmpty(order)) {
|
| | | String fileds = Utils.toSymbolCase(order.get("field"), '_');
|
| | | if (order.get("order").equals("asc")) {
|
| | | wrapper.orderByAsc(fileds);
|
| | | } else {
|
| | | wrapper.orderByDesc(fileds);
|
| | | }
|
| | | } else {
|
| | | wrapper.orderByDesc("create_time");
|
| | | }
|
| | |
|
| | | return R.ok().add(orderService.page(pageParam, wrapper));
|
| | | }
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:order:list')")
|
| | | @PostMapping("/order/out/page")
|
| | | // @CacheData(tableName = {"man_order", "man_order_type"})
|
| | | public R pageOut(@RequestBody Map<String, Object> map) {
|
| | | String condition = map.getOrDefault("condition", "").toString();
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<Order, BaseParam> pageParam = new PageParam<>(baseParam, Order.class);
|
| | | // QueryWrapper<Order> wrapper = pageParam.buildWrapper(true);
|
| | | QueryWrapper<Order> wrapper = new QueryWrapper<>();
|
| | |
|
| | | ArrayList<Long> types = new ArrayList<>();
|
| | | for (OrderType orderType : orderTypeService.list(new LambdaQueryWrapper<OrderType>().eq(OrderType::getType, 2))) {
|
| | | types.add(orderType.getId());
|
| | | }
|
| | |
|
| | | wrapper.in("order_type", types);
|
| | |
|
| | | if (map.containsKey("orderOut")) {
|
| | | wrapper.isNull("wave_id");
|
| | | }
|
| | |
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:order:list')")
|
| | | @PostMapping("/order/list")
|
| | | // @CacheData(tableName = {"man_order"})
|
| | | public R list(@RequestBody Map<String, Object> map) {
|
| | | return R.ok().add(orderService.list());
|
| | | }
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:order:list')")
|
| | | @GetMapping("/order/{id}")
|
| | | // @CacheData(tableName = {"man_order"})
|
| | | public R get(@PathVariable("id") Long id) {
|
| | | Order order = orderService.getById(id);
|
| | | List<OrderDetl> detls = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>().eq(OrderDetl::getOrderId, order.getId()));
|
| | |
| | | @PostMapping("/order/save")
|
| | | @Transactional
|
| | | public R save(@RequestBody CreateOrderParam param) {
|
| | | orderService.createOrder(param);
|
| | | orderService.createOrder(param, getLoginUserId());
|
| | | return R.ok("添加成功");
|
| | | }
|
| | |
|
| | |
| | | public R update(@RequestBody UpdateOrderParam param) {
|
| | | orderService.updateOrder(param);
|
| | | return R.ok("修改成功");
|
| | | }
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:order:remove')")
|
| | | @OperationLog("完结订单")
|
| | | @PostMapping("/order/done/{id}")
|
| | | public R orderToDone(@PathVariable Long id) {
|
| | | return R.ok().add(orderService.doneOrder(id));
|
| | | }
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:order:remove')")
|
| | |
| | | CreateOrderParam orderParam = (CreateOrderParam) entry.getValue();
|
| | | orderParams.add(orderParam);
|
| | | }
|
| | | orderService.createOrder(orderParams);
|
| | | orderService.createOrder(orderParams, getLoginUserId());
|
| | | return R.ok();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | @PostMapping("/out/orderOut/wave/preview")
|
| | | @OperationLog("预览波次出库")
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public R orderOutWavePreview(@RequestBody OrderOutWavePreviewParam param) {
|
| | | if (param == null) {
|
| | | throw new CoolException("参数不能为空");
|
| | |
| | |
|
| | | @PostMapping("/out/orderOut/merge/wave")
|
| | | @OperationLog("生成波次任务")
|
| | | @Transactional
|
| | | public R orderOutMerge(@RequestBody OrderOutMergeParamDto param) {
|
| | | outManage.orderOutMergeWave(param);
|
| | | return R.ok();
|
| | | }
|
| | |
|
| | |
|
| | | @PostMapping("/out/locs/stock")
|
| | | @OperationLog("手动出库")
|
| | | public R stockOut(@RequestBody StockOutParam param) {
|
| | |
| | | public R page(@RequestBody Map<String, Object> map) {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewStayTime, BaseParam> pageParam = new PageParam<>(baseParam, ViewStayTime.class);
|
| | | QueryWrapper<ViewStayTime> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("stay_time"));
|
| | | QueryWrapper<ViewStayTime> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("stay_time"), false);
|
| | | PageParam<ViewStayTime, BaseParam> page = viewStayTimeMapper.selectPage(pageParam, queryWrapper);
|
| | | return R.ok().add(page);
|
| | | }
|
| | |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewStayTime, BaseParam> pageParam = new PageParam<>(baseParam, ViewStayTime.class);
|
| | | QueryWrapper<ViewStayTime> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("stay_time"));
|
| | | QueryWrapper<ViewStayTime> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("stay_time"), false);
|
| | | ExcelUtil.build(ExcelUtil.create(viewStayTimeMapper.selectList(queryWrapper), ViewStayTime.class), response);
|
| | | }
|
| | |
|
| | |
| | | public R page(@RequestBody Map<String, Object> map) {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewWorkCountIn, BaseParam> pageParam = new PageParam<>(baseParam, ViewWorkCountIn.class);
|
| | | QueryWrapper<ViewWorkCountIn> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("oneday"));
|
| | | QueryWrapper<ViewWorkCountIn> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("oneday"), false);
|
| | | PageParam<ViewWorkCountIn, BaseParam> page = viewWorkCountInMapper.selectPage(pageParam, queryWrapper);
|
| | | return R.ok().add(page);
|
| | | }
|
| | |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewWorkCountIn, BaseParam> pageParam = new PageParam<>(baseParam, ViewWorkCountIn.class);
|
| | | QueryWrapper<ViewWorkCountIn> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("oneday"));
|
| | | QueryWrapper<ViewWorkCountIn> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("oneday"), false);
|
| | | ExcelUtil.build(ExcelUtil.create(viewWorkCountInMapper.selectList(queryWrapper), ViewWorkCountIn.class), response);
|
| | | }
|
| | |
|
| | |
| | | public R page(@RequestBody Map<String, Object> map) {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewWorkCountOut, BaseParam> pageParam = new PageParam<>(baseParam, ViewWorkCountOut.class);
|
| | | QueryWrapper<ViewWorkCountOut> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("oneday"));
|
| | | QueryWrapper<ViewWorkCountOut> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("oneday"), false);
|
| | | PageParam<ViewWorkCountOut, BaseParam> page = viewWorkCountOutMapper.selectPage(pageParam, queryWrapper);
|
| | | return R.ok().add(page);
|
| | | }
|
| | |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewWorkCountOut, BaseParam> pageParam = new PageParam<>(baseParam, ViewWorkCountOut.class);
|
| | | QueryWrapper<ViewWorkCountOut> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("oneday"));
|
| | | QueryWrapper<ViewWorkCountOut> queryWrapper = pageParam.buildWrapper(true, wrapper -> wrapper.orderByDesc("oneday"), false);
|
| | | ExcelUtil.build(ExcelUtil.create(viewWorkCountOutMapper.selectList(queryWrapper), ViewWorkCountOut.class), response);
|
| | | }
|
| | |
|
| | |
| | | @ApiModelProperty("优先级")
|
| | | private Integer sorted;
|
| | |
|
| | | @ApiModelProperty("仓库类型")
|
| | | private Integer wareType;
|
| | |
|
| | | /**
|
| | | * 商品库存索引
|
| | | */
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public String getWareType$(){
|
| | | if (wareType == null) {return null;}
|
| | | if (wareType == 1) {
|
| | | return "立库";
|
| | | } else if (wareType == 2) {
|
| | | return "平库";
|
| | | } else {
|
| | | return "立库/平库";
|
| | | }
|
| | | }
|
| | |
|
| | | public String getMatId$(){
|
| | | MatService service = SpringUtils.getBean(MatService.class);
|
| | | Mat mat = service.getById(this.matId);
|
| | |
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
| | | import com.mysql.cj.util.StringUtils;
|
| | | import com.zy.asrs.wms.asrs.entity.param.StockOutParam;
|
| | | import com.zy.asrs.framework.exception.CoolException;
|
| | |
| | | }
|
| | |
|
| | |
|
| | |
|
| | | // List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
|
| | | // .eq(CacheSite::getSiteStatus, CacheSiteStatusType.O.id).eq(CacheSite::getChannel, task.getTargetSite()));
|
| | | //
|
| | |
| | | if (!locDetlService.updateById(locDetl)) {
|
| | | throw new CoolException("库存加锁失败!!");
|
| | | }
|
| | |
|
| | | orderDetlService.update(new LambdaUpdateWrapper<OrderDetl>()
|
| | | .set(OrderDetl::getWareType, 2)
|
| | | .eq(OrderDetl::getMatId, mat.getId())
|
| | | .eq(StringUtils.isNullOrEmpty(outOder.getBatch()), OrderDetl::getBatch, outOder.getBatch())
|
| | | .in(OrderDetl::getOrderId, outOder.getOrderIds()));
|
| | | });
|
| | |
|
| | | curLoc.setLocStsId(LocStsType.R.val());
|
| | |
| | |
|
| | |
|
| | | List<LocDetl> getStock(String matnr, String batch, List<Long> ids);
|
| | |
|
| | | Double getAllStock();
|
| | | }
|
| | |
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.zy.asrs.framework.common.R;
|
| | | import com.zy.asrs.wms.asrs.entity.LocDetl;
|
| | | import com.zy.asrs.wms.asrs.entity.ViewLocDetl;
|
| | | import com.zy.asrs.wms.asrs.entity.param.FieldParam;
|
| | |
| | | void removeLocDetl(Long locId);
|
| | |
|
| | | List<LocDetl> queryFlatStock(String matnr, String batch, List<FieldParam> uniqueField);
|
| | |
|
| | | R getAllStockQty();
|
| | | }
|
| | |
| | |
|
| | | public interface OrderService extends IService<Order> {
|
| | |
|
| | | boolean createOrder(CreateOrderParam param);
|
| | | boolean createOrder(CreateOrderParam param, Long userId);
|
| | |
|
| | | boolean createOrder(List<CreateOrderParam> list);
|
| | | boolean createOrder(List<CreateOrderParam> list, Long userId);
|
| | |
|
| | | boolean updateOrder(UpdateOrderParam param);
|
| | |
|
| | |
| | | Order selectByBarcode(String barcode);
|
| | |
|
| | | List<OrderInfoDto> getDetlForOrderId(Long id, String matnr);
|
| | |
|
| | | Order doneOrder(Long id);
|
| | | }
|
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.zy.asrs.framework.common.R;
|
| | | import com.zy.asrs.framework.exception.CoolException;
|
| | | import com.zy.asrs.wms.asrs.entity.*;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.LocAreaTypeSts;
|
| | |
| | | });
|
| | | return detls;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取所有库存数量
|
| | | * @return
|
| | | */
|
| | | @Override
|
| | | public R getAllStockQty() {
|
| | | Map<String, Double> map = new HashMap<>();
|
| | | Double allQty = this.baseMapper.getAllStock();
|
| | | map.put("allQty", allQty);
|
| | | return R.ok().add(map);
|
| | | }
|
| | | }
|
| | |
| | | orders.forEach(order -> {
|
| | | List<OrderDetl> detls = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>().eq(OrderDetl::getOrderId, order.getId()));
|
| | | Double sum = detls.stream().mapToDouble(OrderDetl::getQty).sum();
|
| | | Double summed = detls.stream().mapToDouble(OrderDetl::getWorkQty).sum();
|
| | | Double v = Math.round((sum + summed) * 1000) / 1000.0;
|
| | | // Double summed = detls.stream().mapToDouble(OrderDetl::getWorkQty).sum();
|
| | | // Double v = Math.round((sum ) * 1000) / 1000.0;
|
| | | Double anfme = detls.stream().mapToDouble(OrderDetl::getAnfme).sum();
|
| | | if (v.compareTo(anfme) == 0.0) {
|
| | | if (sum.compareTo(anfme) == 0.0) {
|
| | | order.setOrderSettle(OrderSettleType.COMPLETE.val());
|
| | | if (!orderService.updateById(order)) {
|
| | | throw new CoolException("单据状态修改失败!!");
|
| | |
| | | @Override
|
| | | public R getMatsByCode(String matnr) {
|
| | | QueryWrapper<LocDetl> wrapper = new QueryWrapper<>();
|
| | | wrapper.eq("matnr", matnr).select("id, maktx, matnr, SUM(anfme) anfme");
|
| | | wrapper.eq("matnr", matnr).select("matnr, SUM(anfme) anfme");
|
| | | LocDetl detl = locDetlService.getOne(wrapper);
|
| | |
|
| | | Mat one = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, detl.getMatnr()), false);
|
| | |
| | | throw new CoolException("物料不存在!!");
|
| | | }
|
| | | one.setAnfme(detl.getAnfme());
|
| | | return R.ok().add(one);
|
| | | return R.ok().add(Arrays.asList(one));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public boolean createOrder(List<CreateOrderParam> list) {
|
| | | public boolean createOrder(List<CreateOrderParam> list, Long userId) {
|
| | | for (CreateOrderParam orderParam : list) {
|
| | | createOrder(orderParam);
|
| | | createOrder(orderParam, userId);
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public boolean createOrder(CreateOrderParam param) {
|
| | | public boolean createOrder(CreateOrderParam param, Long userId) {
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | |
|
| | | List<Order> orderList = this.list(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, param.getOrderNo()));
|
| | |
| | | order.setIoPri(orderUtils.getIoPri());
|
| | | order.setOrderTime(format.format(new Date()));
|
| | | order.setCreateTime(new Date());
|
| | | order.setCreateBy(9527L);
|
| | | order.setCreateBy(userId);
|
| | | order.setUpdateBy(userId);
|
| | | boolean result = this.save(order);
|
| | | if (!result) {
|
| | | throw new CoolException("生成订单失败");
|
| | |
| | | orderDetl.setMatId(mat.getId());
|
| | | orderDetl.setMemo(memo);
|
| | | orderDetl.setCreateTime(new Date());
|
| | | orderDetl.setCreateBy(9527L);
|
| | | orderDetl.setCreateBy(userId);
|
| | | orderDetl.setUpdateBy(userId);
|
| | | boolean save = orderDetlService.save(orderDetl);
|
| | | if (!save) {
|
| | | throw new CoolException("订单明细创建失败");
|
| | |
| | | return this.baseMapper.getDetlForOrderId(id, null);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 提交完结订单
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @Override
|
| | | public Order doneOrder(Long id) {
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
| | | this.setCondition(String.valueOf(map.get("condition")));
|
| | | map.remove("condition");
|
| | | }
|
| | | if (null != map.get("orderBy")) {
|
| | | map.remove("orderBy");
|
| | | }
|
| | | this.setMap(map);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public QueryWrapper<T> buildWrapper(Consumer<QueryWrapper<T>> consumer) {
|
| | | return this.buildWrapper(false, consumer);
|
| | | return this.buildWrapper(false, consumer, false);
|
| | | }
|
| | |
|
| | | public QueryWrapper<T> ignoreWrapper(boolean order) {
|
| | | return this.buildWrapper(false, null, order);
|
| | | }
|
| | |
|
| | | public QueryWrapper<T> buildWrapper(boolean like) {
|
| | | return this.buildWrapper(like, null);
|
| | | return this.buildWrapper(like, null, false);
|
| | | }
|
| | |
|
| | | @SuppressWarnings("all")
|
| | | public QueryWrapper<T> buildWrapper(boolean like, Consumer<QueryWrapper<T>> consumer) {
|
| | | public QueryWrapper<T> buildWrapper(boolean like, Consumer<QueryWrapper<T>> consumer, boolean order) {
|
| | | QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
| | | Map<String, Object> map = where.getMap();
|
| | | for (String key : map.keySet()) {
|
| | |
| | | }
|
| | |
|
| | | Field[] fields = null;
|
| | | if (!Cools.isEmpty(cls)) {
|
| | | if (!Cools.isEmpty(cls) && !order) {
|
| | | fields = Cools.getAllFields(cls);
|
| | | for (Field field : fields) {
|
| | | if ("id".equals(field.getName())) {
|
| | |
| | | public R page(@RequestBody Map<String, Object> map) {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<Role, BaseParam> pageParam = new PageParam<>(baseParam, Role.class);
|
| | | return R.ok().add(roleService.page(pageParam, pageParam.buildWrapper(true, (wrapper) -> wrapper.orderByAsc("create_time"))));
|
| | | return R.ok().add(roleService.page(pageParam, pageParam.buildWrapper(true, (wrapper) -> wrapper.orderByAsc("create_time"), false)));
|
| | | }
|
| | |
|
| | | @PreAuthorize("hasAuthority('system:role:list')")
|
| | |
| | | public R page(@RequestBody Map<String, Object> map) {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<User, BaseParam> pageParam = new PageParam<>(baseParam, User.class);
|
| | | return R.ok().add(userService.page(pageParam, pageParam.buildWrapper(true, wrapper -> wrapper.orderByAsc("create_time"))));
|
| | | return R.ok().add(userService.page(pageParam, pageParam.buildWrapper(true, wrapper -> wrapper.orderByAsc("create_time"), false)));
|
| | | }
|
| | |
|
| | | @PreAuthorize("hasAuthority('system:user:list')")
|
| | |
| | | </foreach>
|
| | | </if>
|
| | | </select>
|
| | | |
| | |
|
| | | <select id="getAllStock" resultType="java.lang.Double">
|
| | | SELECT SUM(anfme) all_qty FROM man_loc_detl WHERE deleted = 0
|
| | | </select>
|
| | | </mapper>
|