计划工序管理-发送到仓库 2.1

zhc4dev
zhc077 2 years ago
parent 9206500097
commit d3995a030b
  1. 42
      ant-design-vue-jeecg/src/views/productplan/ZyPlanWuLiaoDataDetail.vue
  2. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/service/IDeliveryService.java
  3. 79
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/service/impl/DeliveryServiceImpl.java

@ -38,8 +38,8 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<h3 style="width: 98%;;margin:20px auto 0">计划面料清单</h3> <h3 style="width: 98%;;margin:20px auto 0">计划面料清单</h3>
<a-table style="width: 98%;font-size:14px;margin:10px auto" :columns="columns1" :data-source="data1" bordered <a-table style="width: 98%;font-size:14px;margin:10px auto 0" :columns="columns1" :data-source="data1" bordered
rowKey="nums" :pagination="false"> rowKey="id" :pagination="false">
</a-table> </a-table>
<h3 style="width: 98%;;margin:20px auto 0">计划辅料清单</h3> <h3 style="width: 98%;;margin:20px auto 0">计划辅料清单</h3>
@ -71,11 +71,11 @@ import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {filterObj} from "@/utils/util"; import {filterObj} from "@/utils/util";
const columns1 = [ const columns1 = [
{ // {
title: '计划ID', // title: 'ID',
align: "center", // align: "center",
dataIndex: 'planId' // dataIndex: 'planId'
}, // },
{ {
title: '面料', title: '面料',
align: "center", align: "center",
@ -89,11 +89,11 @@ const columns1 = [
]; ];
const columns2 = [ const columns2 = [
{ // {
title: '计划ID', // title: 'ID',
align: "center", // align: "center",
dataIndex: 'planId' // dataIndex: 'planId'
}, // },
{ {
title: '辅料', title: '辅料',
align: "center", align: "center",
@ -244,23 +244,7 @@ export default {
this.loadRouteType = true; this.loadRouteType = true;
} }
}, },
// showModal(id) {
// this.visible = true;
// this.id = id
// this.getDetailData()
// },
// getDetailData() {
// getAction(this.url.detail, {id: this.id}).then((res) => {
// if (res.success) {
// this.data = res.result.records || res.result.records;
// console.log("data------------:" + JSON.stringify(this.data));
// } else {
// this.$message.warning(res.message)
// }
// }).finally(() => {
// this.confirmLoading = false
// })
// },
handleOk(e) { handleOk(e) {
this.confirmLoading = true; this.confirmLoading = true;
setTimeout(() => { setTimeout(() => {

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.delivery.service;
import org.jeecg.modules.demo.delivery.entity.Delivery; import org.jeecg.modules.demo.delivery.entity.Delivery;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.productplan.entity.ZyPlanProcess;
/** /**
* @Description: 出库表 * @Description: 出库表
@ -12,4 +13,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IDeliveryService extends IService<Delivery> { public interface IDeliveryService extends IService<Delivery> {
void sendToRepository(String planId);
} }

@ -1,12 +1,29 @@
package org.jeecg.modules.demo.delivery.service.impl; package org.jeecg.modules.demo.delivery.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.demo.accessories.entity.ZyAccessories;
import org.jeecg.modules.demo.accessories.service.IZyAccessoriesService;
import org.jeecg.modules.demo.delivery.entity.Delivery; import org.jeecg.modules.demo.delivery.entity.Delivery;
import org.jeecg.modules.demo.delivery.mapper.DeliveryMapper; import org.jeecg.modules.demo.delivery.mapper.DeliveryMapper;
import org.jeecg.modules.demo.delivery.service.IDeliveryService; import org.jeecg.modules.demo.delivery.service.IDeliveryService;
import org.jeecg.modules.demo.fabric.entity.ZyFabric;
import org.jeecg.modules.demo.fabric.service.IZyFabricService;
import org.jeecg.modules.productplan.entity.ZyPlanAccessories;
import org.jeecg.modules.productplan.entity.ZyPlanFabric;
import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.service.IZyPlanAccessoriesService;
import org.jeecg.modules.productplan.service.IZyPlanFabricService;
import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
/** /**
* @Description: 出库表 * @Description: 出库表
@ -17,4 +34,64 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> implements IDeliveryService { public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> implements IDeliveryService {
@Autowired
private IZyProductPlanService iZyProductPlanService;
@Autowired
private IZyPlanFabricService iZyPlanFabricService;
@Autowired
private IZyPlanAccessoriesService iZyPlanAccessoriesService;
@Autowired
IZyFabricService iZyFabricService;
@Autowired
private IZyAccessoriesService iZyAccessoriesService;
@Override
public void sendToRepository(String planId) {
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId);
Optional.ofNullable(zyProductPlan).orElseThrow(() -> new JeecgBootException("生产计划不存在!"));
List<ZyPlanFabric> fabricList = iZyPlanFabricService.list(new LambdaQueryWrapper<ZyPlanFabric>()
.eq(ZyPlanFabric::getPlanId, planId));
List<Delivery> deliveryList4Fabric = new LinkedList<>();
Optional.ofNullable(fabricList).orElse(new LinkedList<>()).forEach(e -> {
Delivery delivery = new Delivery();
delivery.setDeliveryReason("0");
delivery.setItemType("0");
delivery.setAmount(e.getAmount().doubleValue());
// delivery.setDeliveryTime(new Date());
// delivery.setCarrierId("TODO");
// delivery.setAdminId("TODO");
// delivery.setStorehouseId("TODO");
ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId());
if (!ObjectUtils.isEmpty(zyFabric)) {
delivery.setItemCode(zyFabric.getFabricNumber());
}
deliveryList4Fabric.add(delivery);
});
this.saveBatch(deliveryList4Fabric);
List<ZyPlanAccessories> accessoriesList = iZyPlanAccessoriesService.list(new LambdaQueryWrapper<ZyPlanAccessories>()
.eq(ZyPlanAccessories::getPlanId, planId));
List<Delivery> deliveryList4accessories = new LinkedList<>();
Optional.ofNullable(accessoriesList).orElse(new LinkedList<>()).forEach(e -> {
Delivery delivery2 = new Delivery();
delivery2.setDeliveryReason("0");
delivery2.setItemType("1");
delivery2.setAmount(e.getAmount().doubleValue());
// delivery2.setDeliveryTime(new Date());
// delivery2.setCarrierId("TODO");
// delivery2.setAdminId("TODO");
// delivery2.setStorehouseId("TODO");
ZyAccessories zyAccessories = iZyAccessoriesService.getById(e.getAccessoriesId());
if (!ObjectUtils.isEmpty(zyAccessories)) {
delivery2.setItemCode(zyAccessories.getNums());
}
deliveryList4accessories.add(delivery2);
});
this.saveBatch(deliveryList4accessories);
}
} }

Loading…
Cancel
Save