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

zhc4dev
zhc077 2 years ago
parent f8da15af89
commit 7d2fe54fb2
  1. 16
      ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue
  2. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java
  3. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java
  4. 55
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -53,7 +53,7 @@
</a-button> </a-button>
<a-button type="primary" icon="unordered-list" @click="viewMaterialBill()">查看物料单 <a-button type="primary" icon="unordered-list" @click="viewMaterialBill()">查看物料单
</a-button> </a-button>
<a-button type="primary" icon="unordered-list" @click="sendToRepository()">发送到仓库 <a-button type="primary" icon="redo" @click="sendToRepository()">发送到仓库
</a-button> </a-button>
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button> <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
@ -205,6 +205,7 @@ export default {
syncProductProcess: "/org.jeecg.modules.productplan/zyPlanProcess/syncProductProcess", syncProductProcess: "/org.jeecg.modules.productplan/zyPlanProcess/syncProductProcess",
autoFilling: "/org.jeecg.modules.productplan/zyPlanProcess/autoFilling", autoFilling: "/org.jeecg.modules.productplan/zyPlanProcess/autoFilling",
createMaterialBill: "/org.jeecg.modules.productplan/zyPlanProcess/createMaterialBill", createMaterialBill: "/org.jeecg.modules.productplan/zyPlanProcess/createMaterialBill",
sendToRepository: "/org.jeecg.modules.productplan/zyPlanProcess/sendToRepository",
stationToolslist: "/stationTool/list2", stationToolslist: "/stationTool/list2",
stationMachinelist: "/stationMachine/list2", stationMachinelist: "/stationMachine/list2",
addProcessBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addProcessBatch", addProcessBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addProcessBatch",
@ -364,7 +365,17 @@ export default {
// //
sendToRepository(){ sendToRepository(){
this.loading = true;
getAction(this.url.sendToRepository, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}, },
// //
@ -372,7 +383,6 @@ export default {
// debugger; // debugger;
if (this.loadRouteType === false) { if (this.loadRouteType === false) {
this.planId = this.$route.query.planId; this.planId = this.$route.query.planId;
// this.biaoTi = this.$route.query.styleNames+"";
console.log("*******传递的planId:" + this.planId) console.log("*******传递的planId:" + this.planId)
this.loadRouteType = true; this.loadRouteType = true;
} }

@ -146,6 +146,14 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return Result.OK(); return Result.OK();
} }
@ApiOperation(value = "发送到仓库", notes = "发送到仓库")
@GetMapping(value = "/sendToRepository")
public Result<?> sendToRepository(ZyPlanProcess zyPlanProcess,
HttpServletRequest req) {
zyPlanProcessService.sendToRepository(zyPlanProcess);
return Result.OK();
}
@ApiOperation(value = "计划班组管理-查询产品工序&班组", notes = "计划班组管理-查询产品工序&班组") @ApiOperation(value = "计划班组管理-查询产品工序&班组", notes = "计划班组管理-查询产品工序&班组")
@GetMapping(value = "/getTeamDatalist") @GetMapping(value = "/getTeamDatalist")
public Result<?> getTeamDatalist(ZyPlanProcess zyPlanProcess, public Result<?> getTeamDatalist(ZyPlanProcess zyPlanProcess,

@ -28,4 +28,6 @@ public interface IZyPlanProcessService extends IService<ZyPlanProcess> {
void createMaterialBill(ZyPlanProcess zyPlanProcess); void createMaterialBill(ZyPlanProcess zyPlanProcess);
Map<String, Object> getWuLiaoDetail(ZyPlanProcess zyPlanProcess); Map<String, Object> getWuLiaoDetail(ZyPlanProcess zyPlanProcess);
void sendToRepository(ZyPlanProcess zyPlanProcess);
} }

@ -11,6 +11,8 @@ import org.jeecg.modules.demo.accessories.entity.ZyAccessories;
import org.jeecg.modules.demo.accessories.service.IZyAccessoriesService; import org.jeecg.modules.demo.accessories.service.IZyAccessoriesService;
import org.jeecg.modules.demo.base.entity.ZyProcess; import org.jeecg.modules.demo.base.entity.ZyProcess;
import org.jeecg.modules.demo.base.service.IZyProcessService; import org.jeecg.modules.demo.base.service.IZyProcessService;
import org.jeecg.modules.demo.delivery.entity.Delivery;
import org.jeecg.modules.demo.delivery.service.IDeliveryService;
import org.jeecg.modules.demo.fabric.entity.ZyFabric; import org.jeecg.modules.demo.fabric.entity.ZyFabric;
import org.jeecg.modules.demo.fabric.service.IZyFabricService; import org.jeecg.modules.demo.fabric.service.IZyFabricService;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
@ -146,6 +148,9 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
@Autowired @Autowired
private IZyPlanAccessoriesService iZyPlanAccessoriesService; private IZyPlanAccessoriesService iZyPlanAccessoriesService;
@Autowired
private IDeliveryService iDeliveryService;
public List<ZyPlanProcess> getProcessDatalist(ZyPlanProcess zyPlanProcess) { public List<ZyPlanProcess> getProcessDatalist(ZyPlanProcess zyPlanProcess) {
//生产计划id //生产计划id
String planId = zyPlanProcess.getPlanId(); String planId = zyPlanProcess.getPlanId();
@ -508,6 +513,56 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
return result; return result;
} }
@Override
public void sendToRepository(ZyPlanProcess zyPlanProcess) {
String planId = zyPlanProcess.getPlanId();
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId);
if (ObjectUtils.isEmpty(zyProductPlan)) {
throw new JeecgBootException("生产计划不存在!");
}
List<ZyPlanFabric> fabricList = iZyPlanFabricService.list(new LambdaQueryWrapper<ZyPlanFabric>()
.eq(ZyPlanFabric::getPlanId, zyPlanProcess.getPlanId()));
List<Delivery> deliveryList4Fabric = new LinkedList<>();
Optional.ofNullable(fabricList).orElse(new LinkedList<>()).forEach(e -> {
Delivery delivery = new Delivery();
delivery.setDeliveryReason("0");
delivery.setDeliveryTime(new Date());
delivery.setItemType("0");
delivery.setAmount(e.getAmount().doubleValue());
delivery.setCarrierId("admin");
delivery.setAdminId("admin");
delivery.setStorehouseId("TODO");
ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId());
if (!ObjectUtils.isEmpty(zyFabric)) {
delivery.setItemCode(zyFabric.getFabricNumber());
}
deliveryList4Fabric.add(delivery);
});
iDeliveryService.saveBatch(deliveryList4Fabric);
List<ZyPlanAccessories> accessoriesList = iZyPlanAccessoriesService.list(new LambdaQueryWrapper<ZyPlanAccessories>()
.eq(ZyPlanAccessories::getPlanId, zyPlanProcess.getPlanId()));
List<Delivery> deliveryList4accessories = new LinkedList<>();
Optional.ofNullable(accessoriesList).orElse(new LinkedList<>()).forEach(e -> {
Delivery delivery2 = new Delivery();
delivery2.setDeliveryReason("0");
delivery2.setDeliveryTime(new Date());
delivery2.setItemType("1");
delivery2.setAmount(e.getAmount().doubleValue());
delivery2.setCarrierId("admin");
delivery2.setAdminId("admin");
delivery2.setStorehouseId("TODO");
ZyAccessories zyAccessories = iZyAccessoriesService.getById(e.getAccessoriesId());
if (!ObjectUtils.isEmpty(zyAccessories)) {
delivery2.setItemCode(zyAccessories.getNums());
}
deliveryList4accessories.add(delivery2);
});
iDeliveryService.saveBatch(deliveryList4accessories);
}
@Override @Override
public Map<String, Object> getWuLiaoDetail(ZyPlanProcess zyPlanProcess) { public Map<String, Object> getWuLiaoDetail(ZyPlanProcess zyPlanProcess) {
String planId = zyPlanProcess.getPlanId(); String planId = zyPlanProcess.getPlanId();

Loading…
Cancel
Save