修改订单管理相关代码
main
zxf 2 months ago
parent f402c938be
commit 12fe4055d7

@ -3,5 +3,5 @@ ENV = 'production'
# base api # base api
# VUE_APP_BASE_API = 'http://124.71.134.146:18091' # VUE_APP_BASE_API = 'http://124.71.134.146:18091'
VUE_APP_BASE_API = 'http://119.45.21.129:18091' VUE_APP_BASE_API = 'https://fzbfwy.com/prod-api'

@ -19,7 +19,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="orderQuantity" header-align="center" align="center" label="订单数量" style="width: 100px"> <el-table-column prop="orderQuantity" header-align="center" align="center" label="订单数量" style="width: 100px">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="editingRow === scope.row.id"> <template v-if="editingRow == scope.row.id">
<el-input <el-input
v-model.number="editForm.orderQuantity" v-model.number="editForm.orderQuantity"
type="number" type="number"

@ -9,7 +9,6 @@
v-loading="dataListLoading" v-loading="dataListLoading"
:row-key="'id'" :row-key="'id'"
style="width: 100%;"> style="width: 100%;">
<el-table-column prop="itemName" header-align="center" align="center" label="菜品名称"> <el-table-column prop="itemName" header-align="center" align="center" label="菜品名称">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="editingRow === scope.row.id"> <template v-if="editingRow === scope.row.id">

@ -1,6 +1,7 @@
package com.zbkj.modules.autogencode.controller; package com.zbkj.modules.autogencode.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Map; import java.util.Map;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -8,6 +9,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.common.request.PageParamRequest; import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult; import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage; import com.zbkj.common.page.CommonPage;
import com.zbkj.modules.autogencode.entity.CmCustProduct;
import com.zbkj.modules.autogencode.service.CmCustProductService;
import com.zbkj.modules.autogencode.entity.PmCanteenPurchaseDetail;
import com.zbkj.modules.autogencode.service.PmCanteenPurchaseDetailService;
import com.zbkj.modules.autogencode.entity.PmCanteenPurchasePlan;
import com.zbkj.modules.autogencode.service.PmCanteenPurchasePlanService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -32,7 +39,12 @@ import com.zbkj.modules.autogencode.service.PmCanteenPlanOrderRelService;
public class PmCanteenPlanOrderRelController { public class PmCanteenPlanOrderRelController {
@Autowired @Autowired
private PmCanteenPlanOrderRelService pmCanteenPlanOrderRelService; private PmCanteenPlanOrderRelService pmCanteenPlanOrderRelService;
@Autowired
private CmCustProductService cmCustProductService;
@Autowired
private PmCanteenPurchaseDetailService pmCanteenPurchaseDetailService;
@Autowired
private PmCanteenPurchasePlanService pmCanteenPurchasePlanService;
/** /**
@ -137,8 +149,48 @@ public class PmCanteenPlanOrderRelController {
// 应用搜索条件 // 应用搜索条件
condition(queryWrapper, request); condition(queryWrapper, request);
List<PmCanteenPlanOrderRel> pmCanteenPlanOrderRels = pmCanteenPlanOrderRelService.pageList(queryWrapper, pageParamRequest);
CommonPage<PmCanteenPlanOrderRel> page = CommonPage.restPage(pmCanteenPlanOrderRelService.pageList(queryWrapper, pageParamRequest)); if (null != pmCanteenPlanOrderRels && pmCanteenPlanOrderRels.size() > 0 ) {
for (PmCanteenPlanOrderRel rel : pmCanteenPlanOrderRels) {
// 如果有detailId查询PmCanteenPurchaseDetail进行字段赋值
if (rel.getDetailId() != null) {
PmCanteenPurchaseDetail detail = pmCanteenPurchaseDetailService.getById(rel.getDetailId());
if (detail != null) {
// 从采购明细表中获取字段值 还要有计划编号
rel.setGoodsId(detail.getGoodsId());
rel.setGoodsName(detail.getGoodsName());
rel.setGoodsCode(detail.getGoodsCode());
rel.setSpec(detail.getSpec());
rel.setUnit(detail.getUnit());
rel.setSupplierId(detail.getCustId());
rel.setSupplierName(detail.getCustName());
// 查询计划编号
if (detail.getPlanId() != null) {
PmCanteenPurchasePlan plan = pmCanteenPurchasePlanService.getById(detail.getPlanId());
if (plan != null) {
rel.setPlanNo(plan.getPlanNo());
}
}
}
}
if (rel.getGoodsId() != null) {
// 从商品表中查询商品信息
CmCustProduct goodsDetail = cmCustProductService.getById(rel.getGoodsId());
if (goodsDetail != null) {
rel.setGoodsCode(goodsDetail.getGoodsCode());
rel.setSpec(goodsDetail.getSpec());
rel.setUnit(goodsDetail.getUnit());
rel.setSupplierId(goodsDetail.getCustId());
rel.setSupplierName(goodsDetail.getCustName());
rel.setGoodsName(goodsDetail.getGoodsName());
}
}
}
}
CommonPage<PmCanteenPlanOrderRel> page = CommonPage.restPage(pmCanteenPlanOrderRels);
return CommonResult.success(page); return CommonResult.success(page);
} }

@ -585,10 +585,6 @@ public class PmCanteenPurchasePlanController {
} }
// 描写 去吃饭之前,请求帮助 巴麻美答应帮忙,其他人也答应帮忙
// 因为枫在昨晚也帮助过其他人
// 鹤乃表示大家一起帮忙,很快就可以解决了。
// 前往中央电波塔

@ -1,7 +1,10 @@
package com.zbkj.modules.autogencode.entity; package com.zbkj.modules.autogencode.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -102,4 +105,22 @@ public class PmCanteenPlanOrderRel implements Serializable {
@ApiModelProperty(value = "租户ID") @ApiModelProperty(value = "租户ID")
private String tenantId; private String tenantId;
@TableField(exist = false)
private String goodsCode;
@TableField(exist = false)
private String spec;
@TableField(exist = false)
private String unit;
@TableField(exist = false)
private String supplierName;
@TableField(exist = false)
private Long supplierId;
@TableField(exist = false)
private String planNo;
} }

@ -18,20 +18,18 @@ public class PmCanteenPlanOrderRelServiceImpl extends ServiceImpl<PmCanteenPlanO
@Resource @Resource
private PmCanteenPlanOrderRelDao dao; private PmCanteenPlanOrderRelDao dao;
@Resource
private PmCanteenPlanOrderRelService pmCanteenPlanOrderRelService;
@Override @Override
public List<PmCanteenPlanOrderRel> getByOrderId(Long orderId) { public List<PmCanteenPlanOrderRel> getByOrderId(Long orderId) {
LambdaQueryWrapper<PmCanteenPlanOrderRel> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PmCanteenPlanOrderRel> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PmCanteenPlanOrderRel::getOrderId, orderId); queryWrapper.eq(PmCanteenPlanOrderRel::getOrderId, orderId);
return pmCanteenPlanOrderRelService.list(queryWrapper); return this.list(queryWrapper);
} }
@Override @Override
public boolean deleteByOrderId(Long orderId) { public boolean deleteByOrderId(Long orderId) {
LambdaQueryWrapper<PmCanteenPlanOrderRel> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PmCanteenPlanOrderRel> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PmCanteenPlanOrderRel::getOrderId, orderId); queryWrapper.eq(PmCanteenPlanOrderRel::getOrderId, orderId);
return pmCanteenPlanOrderRelService.remove(queryWrapper); return this.remove(queryWrapper);
} }
/** /**

Loading…
Cancel
Save