Merge remote-tracking branch 'origin/master'

zhc4dev
wangjiadong 2 years ago
commit 1228d63bf2
  1. 20
      ant-design-vue-jeecg/src/views/product/pdaccessories/ProductAccessoriesList.vue
  2. 21
      ant-design-vue-jeecg/src/views/product/pdfabric/ProductFabricList.vue
  3. 32
      ant-design-vue-jeecg/src/views/product/productProcess/ZyProductProcessList.vue
  4. 58
      ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue
  5. 2
      ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue
  6. 36
      ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue
  7. 7
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  8. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
  9. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java
  10. 18
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java
  11. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/controller/ProductAccessoriesController.java
  12. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/entity/ProductAccessories.java
  13. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/mapper/ProductAccessoriesMapper.java
  14. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/IProductAccessoriesService.java
  15. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/impl/ProductAccessoriesServiceImpl.java
  16. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/controller/ProductFabricController.java
  17. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/entity/ProductFabric.java
  18. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/mapper/ProductFabricMapper.java
  19. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/IProductFabricService.java
  20. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/impl/ProductFabricServiceImpl.java
  21. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/controller/ZyProductProcessController.java
  22. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java
  23. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java
  24. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/IZyProductProcessService.java
  25. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/impl/ZyProductProcessServiceImpl.java
  26. 70
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java
  27. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java
  28. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/mapper/ZyPlanProcessAccessoriesMapper.java
  29. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/mapper/ZyPlanProcessFabricMapper.java
  30. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java
  31. 177
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java
  32. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/controller/StationMachineController.java
  33. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationMachineService.java
  34. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationToolService.java
  35. 28
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationMachineServiceImpl.java
  36. 26
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationToolServiceImpl.java

@ -5,6 +5,11 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="辅料编号">
<a-input placeholder="辅料编号" v-model="nums"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="辅料名称">
<a-input placeholder="辅料名称" v-model="accessoriesId"></a-input>
@ -120,6 +125,7 @@
return {
description: '产品辅料表管理页面',
accessoriesId:'',
nums:'',
biaoTi: '',
//
columns: [
@ -141,10 +147,20 @@
{
title:'产品编号',
align:"center",
dataIndex: 'productCode'
},
{
title:'产品名称',
align:"center",
dataIndex: 'productId_dictText'
},
{
title:'辅料',
title:'辅料编号',
align:"center",
dataIndex: 'nums'
},
{
title:'辅料名称',
align:"center",
dataIndex: 'accessoriesId_dictText'
},
@ -262,10 +278,12 @@
//param.id=this.id;
param.productId = this.$route.query.id;
param.accessoriesId=this.accessoriesId;
param.nums=this.nums;
return filterObj(param);
},
searchReset() {
this.accessoriesId = ''
this.nums = ''
this.loadData(1);
},
handleDetail(id){

@ -5,11 +5,17 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="面料编号">
<a-input placeholder="面料编号" v-model="fabricNumber"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="面料名称">
<a-input placeholder="面料名称" v-model="fabricId"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
@ -119,6 +125,7 @@
return {
description: '产品面料表管理页面',
fabricId:'',
fabricNumber:'',
biaoTi: '',
//
columns: [
@ -135,10 +142,20 @@
{
title:'产品编号',
align:"center",
dataIndex: 'productCode'
},
{
title:'产品名称',
align:"center",
dataIndex: 'productId_dictText'
},
{
title:'面料',
title:'面料编号',
align:"center",
dataIndex: 'fabricNumber'
},
{
title:'面料名称',
align:"center",
dataIndex: 'fabricId_dictText'
},
@ -256,10 +273,12 @@
//param.id=this.id;
param.productId = this.$route.query.id;
param.fabricId=this.fabricId;
param.fabricNumber=this.fabricNumber;
return filterObj(param);
},
searchReset() {
this.fabricId = ''
this.fabricNumber=''
this.loadData(1);
},
handleDetail(id,name){

@ -5,6 +5,11 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工序编号">
<a-input placeholder="工序编号" v-model="processCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工序名称">
<a-input placeholder="工序名称" v-model="processId"></a-input>
@ -30,13 +35,13 @@
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
<!-- </a-menu>-->
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
<!-- </a-dropdown>-->
</div>
<!-- table区域-begin -->
@ -120,6 +125,7 @@
return {
description: '产品工序管理页面',
processId:'',
processCode:'',
biaoTi:'',
//
columns: [
@ -136,8 +142,18 @@
{
title:'产品编号',
align:"center",
dataIndex: 'productCode'
},
{
title:'产品名称',
align:"center",
dataIndex: 'productId_dictText'
},
{
title:'工序编号',
align:"center",
dataIndex: 'processCode'
},
{
title:'工序名称',
align:"center",
@ -265,10 +281,12 @@
//param.id=this.id;
param.productId = this.$route.query.id;
param.processId=this.processId;
param.processCode=this.processCode;
return filterObj(param);
},
searchReset() {
this.processId = ''
this.processCode = ''
this.loadData(1);
},
fanhui(){

@ -48,10 +48,13 @@
>
<template v-slot:toolbarSuffix>
<a-button type="primary" icon="plus-circle" @click="syncProductProcess()">读取工序</a-button>
<a-button type="primary" icon="redo" @click="autoFilling()">自动排位</a-button>
<!-- <a-button type="primary" icon="plus-circle" @click="syncProductProcess()">生成物料单(计划面料&计划辅料)-->
<!-- </a-button>-->
<!-- <a-button type="primary" icon="plus-circle" @click="syncProductProcess()">自动排位(计划面料&计划辅料)</a-button>-->
<a-button type="primary" icon="plus-circle" @click="autoFilling()">自动排位</a-button>
<a-button type="primary" icon="plus-circle" @click="createMaterialBill()">生成物料单
</a-button>
<a-button type="primary" icon="unordered-list" @click="viewMaterialBill()">查看物料单(计划面料&计划辅料)
</a-button>
<a-button type="primary" icon="unordered-list" @click="viewMaterialBill()">发送到仓库
</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
</template>
@ -200,6 +203,8 @@ export default {
list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist",
getPlanInfo: "/org.jeecg.modules.productplan/zyPlanProcess/getPlanInfo",
syncProductProcess: "/org.jeecg.modules.productplan/zyPlanProcess/syncProductProcess",
autoFilling: "/org.jeecg.modules.productplan/zyPlanProcess/autoFilling",
createMaterialBill: "/org.jeecg.modules.productplan/zyPlanProcess/createMaterialBill",
stationToolslist: "/stationTool/list2",
stationMachinelist: "/stationMachine/list2",
addProcessBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addProcessBatch",
@ -293,9 +298,6 @@ export default {
path: '/productplan/ZyProductPlanList',
});
},
autoFilling() {
alert("请稍等,正在开发中。。。")
},
//
syncProductProcess() {
@ -312,6 +314,48 @@ export default {
})
},
//
/**
* 根据工序id查询工序设备表zy_process_machine用工序设备表数据与工位设备进行匹配(工位设备包含工序设备即是匹配成功则自动填充工位设备字段数据匹配不上则不自动填充由用户自己录入)
*/
autoFilling() {
this.loading = true;
getAction(this.url.autoFilling, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
/**
* 根据该生产计划的工序面料工序辅料按类统计各种面料辅料的用量汇总到计划面料计划辅料表
*/
createMaterialBill() {
this.loading = true;
getAction(this.url.createMaterialBill, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
viewMaterialBill(props) {
// alert("deatil row id:"+props.row.id);
this.$refs.zyPlanProcessDataDetail.showModal(props.row.id)
},
//
loadParameter() {
// debugger;

@ -126,7 +126,7 @@ export default {
workTime: '',
status: 0,
auditTimr: '',
speedUp: 0,
speedUp: 1,
auditBy: 'admin',
},
labelCol: {

@ -118,16 +118,16 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleDetail(record)">工序</a>
<a @click="jumpProcesses(record)">工序</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">模块</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">面料</a>
<a @click="jumpFabrics(record)">面料</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">辅料</a>
<a @click="jumpAccessories(record)">辅料</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">设备</a>
@ -358,11 +358,11 @@
jumpProcesses(record)
{
this.$router.push({
path: '/src/views/product/productProcess/ZyProductProcessList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
path: '/product/productProcess/ZyProductProcessList',
query: { //
'productName': record.productName,
'id': record.id,
}
});
},
//-
@ -380,22 +380,22 @@
jumpFabrics(record)
{
this.$router.push({
path: '/src/views/product/pdfabric/ProductFabricList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
path: '/product/pdfabric/ProductFabricList',
query: { //
'productName': record.productName,
'id': record.id,
}
});
},
//-
jumpAccessories(record)
{
this.$router.push({
path: '/src/views/duct/pdaccessories/ProductAccessoriesList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
path: '/product/pdaccessories/ProductAccessoriesList',
query: { //
'productName': record.productName,
'id': record.id,
}
});
},
//-

@ -227,9 +227,10 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
//id.contains(",") 判断是否字符中是否包含","
return Result.error("只能选择一个企业");
} else {
String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(id);
//根据企业名称拿到企业编号
return Result.OK(zyClothsTypeService.getEnterpriseNums(enterpriseName));
//String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(id);
String enterpriseName = zyClothsTypeMapper.getEnterpriseNum(id);
//根据企业名称拿到企业编号 //two 是直接编号 然后做一个判断
return Result.OK(zyClothsTypeService.getEnterpriseNumsTwo(enterpriseName));
}
}

@ -26,6 +26,10 @@ public interface ZyClothsTypeMapper extends BaseMapper<ZyClothsType> {
/**根据部门id拿到部门名称*/
String getEnterprisenameById(String enterpriseId);
/**根据部门id拿到部门名称*/
@Select("select depart_name_abbr from sys_depart where id = #{id} ")
String getEnterpriseNum(String enterpriseId);
/**根据部门名称拿到部门id*/
String getEnterpriseName(String enterpriseName);

@ -19,6 +19,8 @@ public interface IZyClothsTypeService extends IService<ZyClothsType> {
/**根据企业名称拿到企业编号*/
String getEnterpriseNums(String enterpriseName);
/**根据企业名称拿到企业编号*/
String getEnterpriseNumsTwo(String enterpriseName);
Long orderNumber();

@ -38,9 +38,10 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
@Override
public String sort(String enterpriseId) {
String format = String.format("%06d", orderNumber());
String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(enterpriseId);
//现在是拿到企业编号
String enterpriseName = zyClothsTypeMapper.getEnterpriseNum(enterpriseId);
//根据企业名称拿到企业编号
String enterpriseNums = getEnterpriseNums(enterpriseName);
String enterpriseNums = getEnterpriseNumsTwo(enterpriseName);
return enterpriseNums + format;
}
@ -80,6 +81,19 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
return "NONE";
}
/**
* 根据企业名称拿到企业编号
*
* @param enterpriseName
*/
@Override
public String getEnterpriseNumsTwo(String enterpriseName) {
if (StringUtils.isEmpty(enterpriseName)) {
return "NULL";
}
return enterpriseName;
}
@Override
public Long orderNumber() {
//List<String> listString = zyClothsTypeMapper.selectNumsList();

@ -68,15 +68,15 @@ public class ProductAccessoriesController extends JeecgController<ProductAccesso
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// QueryWrapper<ProductAccessories> queryWrapper = QueryGenerator.initQueryWrapper(productAccessories, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("product_id",productAccessories.getProductId());
if(productAccessories.getAccessoriesId()!=null&&!productAccessories.getAccessoriesId().equals("")){
String s="%"+productAccessories.getAccessoriesId()+"%";
List<String> fabric = productAccessoriesService.findAll(s);
queryWrapper.in("accessories_id",fabric);
}
// QueryWrapper queryWrapper=new QueryWrapper();
// queryWrapper.eq("product_id",productAccessories.getProductId());
// if(productAccessories.getAccessoriesId()!=null&&!productAccessories.getAccessoriesId().equals("")){
// String s="%"+productAccessories.getAccessoriesId()+"%";
// List<String> fabric = productAccessoriesService.findAll(s);
// queryWrapper.in("accessories_id",fabric);
// }
Page<ProductAccessories> page = new Page<ProductAccessories>(pageNo, pageSize);
IPage<ProductAccessories> pageList = productAccessoriesService.page(page, queryWrapper);
IPage<ProductAccessories> pageList = productAccessoriesService.page1(page, productAccessories);
return Result.OK(pageList);
}

@ -48,7 +48,7 @@ public class ProductAccessories implements Serializable {
/**产品id*/
@Excel(name = "产品id", width = 15)
@ApiModelProperty(value = "产品id")
@Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id")
@Dict(dictTable = "zy_product",dicText = "product_name",dicCode = "id")
private String productId;
/**辅料id*/
@Excel(name = "辅料id", width = 15)
@ -68,4 +68,6 @@ public class ProductAccessories implements Serializable {
@Excel(name = "差额", width = 15)
@ApiModelProperty(value = "差额")
private Double difference;
private String nums;
private String productCode;
}

@ -4,6 +4,8 @@ package org.jeecg.modules.product.pdaccessories.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
@ -24,4 +26,6 @@ public interface ProductAccessoriesMapper extends BaseMapper<ProductAccessories>
@Delete("delete from product_accessories where product_id=#{pd} and accessories_id=#{access}")
void deleteAccessories(@Param("pd") String productId, @Param("access") String listAccessory);
@Select("<script>select a.*,b.nums,c.product_code from product_accessories as a,zy_accessories as b,zy_product as c where c.id=a.product_id and a.product_id=#{productId} and a.accessories_id=b.id and a.accessories_id in (select id from zy_accessories <where><if test=\" id != null\">contents like #{id}</if><if test=\" number != null\">nums like #{number}</if></where>)</script>")
IPage<ProductAccessories> page1(Page<ProductAccessories> page, @Param("productId") String productId, @Param("id") String accessoriesId, @Param("number") String nums);
}

@ -1,6 +1,8 @@
package org.jeecg.modules.product.pdaccessories.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
@ -17,4 +19,6 @@ public interface IProductAccessoriesService extends IService<ProductAccessories>
List<String> findAll(String s);
void deleteAccessories(String productId, String listAccessory);
IPage<ProductAccessories> page1(Page<ProductAccessories> page, ProductAccessories productAccessories);
}

@ -1,6 +1,8 @@
package org.jeecg.modules.product.pdaccessories.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
import org.jeecg.modules.product.pdaccessories.mapper.ProductAccessoriesMapper;
import org.jeecg.modules.product.pdaccessories.service.IProductAccessoriesService;
@ -31,4 +33,17 @@ public class ProductAccessoriesServiceImpl extends ServiceImpl<ProductAccessorie
public void deleteAccessories(String productId, String listAccessory) {
productAccessoriesMapper.deleteAccessories(productId,listAccessory);
}
@Override
public IPage<ProductAccessories> page1(Page<ProductAccessories> page, ProductAccessories productAccessories) {
if(productAccessories.getNums()!=null){
String s="%"+productAccessories.getNums()+"%";
productAccessories.setNums(s);
}
if(productAccessories.getAccessoriesId()!=null){
String s="%"+productAccessories.getAccessoriesId()+"%";
productAccessories.setAccessoriesId(s);
}
return productAccessoriesMapper.page1(page,productAccessories.getProductId(),productAccessories.getAccessoriesId(),productAccessories.getNums());
}
}

@ -70,15 +70,15 @@ public class ProductFabricController extends JeecgController<ProductFabric, IPro
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// QueryWrapper<ProductFabric> queryWrapper = QueryGenerator.initQueryWrapper(productFabric, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("product_id",productFabric.getProductId());
if(productFabric.getFabricId()!=null&&!productFabric.getFabricId().equals("")){
String s="%"+productFabric.getFabricId()+"%";
List<String> fabric = productFabricService.findAll(s);
queryWrapper.in("fabric_id",fabric);
}
// QueryWrapper queryWrapper=new QueryWrapper();
// queryWrapper.eq("product_id",productFabric.getProductId());
// if(productFabric.getFabricId()!=null&&!productFabric.getFabricId().equals("")){
// String s="%"+productFabric.getFabricId()+"%";
// List<String> fabric = productFabricService.findAll(s);
// queryWrapper.in("fabric_id",fabric);
// }
Page<ProductFabric> page = new Page<ProductFabric>(pageNo, pageSize);
IPage<ProductFabric> pageList = productFabricService.page(page, queryWrapper);
IPage<ProductFabric> pageList = productFabricService.page1(page, productFabric);
return Result.OK(pageList);
}

@ -48,7 +48,7 @@ public class ProductFabric implements Serializable {
/**产品id*/
@Excel(name = "产品id", width = 15)
@ApiModelProperty(value = "产品id")
@Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id")
@Dict(dictTable = "zy_product",dicText = "product_name",dicCode = "id")
private String productId;
/**面料id*/
@Excel(name = "面料id", width = 15)
@ -68,4 +68,6 @@ public class ProductFabric implements Serializable {
@Excel(name = "差额", width = 15)
@ApiModelProperty(value = "差额")
private Double difference;
private String fabricNumber;
private String productCode;
}

@ -4,6 +4,8 @@ package org.jeecg.modules.product.pdfabric.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
@ -24,4 +26,7 @@ public interface ProductFabricMapper extends BaseMapper<ProductFabric> {
@Delete("delete from product_fabric where product_id=#{productId} and fabric_id=#{s1}")
void deleteFabric(@Param("productId") String productId, @Param("s1") String s1);
@Select("<script>select a.*,b.fabric_number,c.product_code from product_fabric as a,zy_fabric as b,zy_product as c where c.id=a.product_id and a.product_id=#{productId} and a.fabric_id=b.id and a.fabric_id in (select id from zy_fabric <where><if test=\" id != null\">name like #{id}</if><if test=\" number != null\">fabric_number like #{number}</if></where>)</script>")
IPage<ProductFabric> page1(Page<ProductFabric> page,@Param("productId") String productId, @Param("id") String fabricId, @Param("number") String fabricNumber);
}

@ -1,5 +1,7 @@
package org.jeecg.modules.product.pdfabric.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
@ -16,4 +18,6 @@ public interface IProductFabricService extends IService<ProductFabric> {
List<String> findAll(String s);
void deleteFabric(String productId, String s1);
IPage<ProductFabric> page1(Page<ProductFabric> page, ProductFabric productFabric);
}

@ -1,6 +1,8 @@
package org.jeecg.modules.product.pdfabric.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
import org.jeecg.modules.product.pdfabric.mapper.ProductFabricMapper;
import org.jeecg.modules.product.pdfabric.service.IProductFabricService;
@ -31,4 +33,17 @@ public class ProductFabricServiceImpl extends ServiceImpl<ProductFabricMapper, P
public void deleteFabric(String productId, String s1) {
productFabricMapper.deleteFabric(productId,s1);
}
@Override
public IPage<ProductFabric> page1(Page<ProductFabric> page, ProductFabric productFabric) {
if(productFabric.getFabricId()!=null){
String s="%"+productFabric.getFabricId();
productFabric.setFabricId(s);
}
if(productFabric.getFabricNumber()!=null){
String s="%"+productFabric.getFabricNumber();
productFabric.setFabricNumber(s);
}
return productFabricMapper.page1(page,productFabric.getProductId(),productFabric.getFabricId(),productFabric.getFabricNumber());
}
}

@ -82,17 +82,17 @@ public class ZyProductProcessController extends JeecgController<ZyProductProcess
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
//QueryWrapper<ZyProductProcess> queryWrapper = QueryGenerator.initQueryWrapper(zyProductProcess, req.getParameterMap());
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.orderByDesc("number");
queryWrapper.eq("product_id",zyProductProcess.getProductId());
if(zyProductProcess.getProcessId()!=null&&!zyProductProcess.getProcessId().equals("")){
String s="%"+zyProductProcess.getProcessId()+"%";
List<String> list=zyProductProcessService.find(s);
queryWrapper.in("process_id",list);
}
// QueryWrapper queryWrapper=new QueryWrapper();
// queryWrapper.orderByDesc("number");
// queryWrapper.eq("product_id",zyProductProcess.getProductId());
// if(zyProductProcess.getProcessId()!=null&&!zyProductProcess.getProcessId().equals("")){
// String s="%"+zyProductProcess.getProcessId()+"%";
// List<String> list=zyProductProcessService.find(s);
// queryWrapper.in("process_id",list);
// }
Page<ZyProductProcess> page = new Page<ZyProductProcess>(pageNo, pageSize);
IPage<ZyProductProcess> pageList = zyProductProcessService.page(page, queryWrapper);
IPage<ZyProductProcess> pageList = zyProductProcessService.page1(page,zyProductProcess);
return Result.OK(pageList);
}

@ -56,7 +56,7 @@ public class ZyProductProcess implements Serializable {
/**产品id*/
@Excel(name = "产品id", width = 15)
@ApiModelProperty(value = "产品id")
@Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id")
@Dict(dictTable = "zy_product",dicText = "product_name",dicCode = "id")
private String productId;
/**工序id*/
@Excel(name = "工序id", width = 15)
@ -68,4 +68,7 @@ public class ZyProductProcess implements Serializable {
@Excel(name = "序号", width = 15)
@ApiModelProperty(value = "序号")
private Integer number;
private String productCode;
private String processCode;
}

@ -2,6 +2,8 @@ package org.jeecg.modules.product.zyproductprocess.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -39,4 +41,7 @@ public interface ZyProductProcessMapper extends BaseMapper<ZyProductProcess> {
//设备
@Select("select machine_id from zy_process_machine where process_id =#{processId}")
List<String> findAllMachine(String processId);
//按照number降序排列,通过产品id筛选,然后通过processId和processCode筛选
@Select("<script>select c.*,a.process_code,b.product_code from zy_process as a,zy_product as b,zy_product_process as c where b.id=c.product_id and c.product_id=#{productId} and c.process_id=a.id and c.process_id in (select id from zy_process <where><if test=\" process != null\">process_name like #{process}</if><if test=\" code != null\">and process_code like #{code}</if></where>) order by number desc</script>")
IPage<ZyProductProcess> page1(Page<ZyProductProcess> page, @Param("productId") String productId, @Param("process") String processId, @Param("code") String processCode);
}

@ -1,6 +1,8 @@
package org.jeecg.modules.product.zyproductprocess.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
@ -29,4 +31,6 @@ public interface IZyProductProcessService extends IService<ZyProductProcess> {
List<String> findAllOperationtool(String processId);
List<String> findAllMachine(String processId);
IPage<ZyProductProcess> page1(Page<ZyProductProcess> page, ZyProductProcess zyProductProcess);
}

@ -1,6 +1,8 @@
package org.jeecg.modules.product.zyproductprocess.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
import org.jeecg.modules.product.zyproductprocess.mapper.ZyProductProcessMapper;
import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService;
@ -61,4 +63,18 @@ public class ZyProductProcessServiceImpl extends ServiceImpl<ZyProductProcessMap
public List<String> findAllMachine(String processId) {
return zyProductProcessMapper.findAllMachine(processId);
}
@Override
public IPage<ZyProductProcess> page1(Page<ZyProductProcess> page, ZyProductProcess zyProductProcess) {
if(zyProductProcess.getProcessId()!=null){
String s="%"+zyProductProcess.getProcessId()+"%";
zyProductProcess.setProcessId(s);
}
if(zyProductProcess.getProcessCode()!=null){
String s="%"+zyProductProcess.getProcessCode()+"%";
zyProductProcess.setProcessCode(s);
} System.err.println(zyProductProcess);
return zyProductProcessMapper.page1(page,zyProductProcess.getProductId(),zyProductProcess.getProcessId(),zyProductProcess.getProcessCode());
}
}

@ -80,41 +80,6 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return Result.OK(pageList);
}
// @AutoLog(value = "生产计划工序-分页列表查询")
// @ApiOperation(value = "生产计划工序-分页列表查询", notes = "生产计划工序-分页列表查询")
// @GetMapping(value = "/list2")
// public Result<?> queryPageList2(ZyPlanProcess zyPlanProcess,
// @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
// @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
// HttpServletRequest req) {
// QueryWrapper<ZyPlanProcess> queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap());
// Page<ZyPlanProcess> page = new Page<ZyPlanProcess>(pageNo, pageSize);
// IPage<ZyPlanProcess> pageList = zyPlanProcessService.page(page, queryWrapper);
// if (!ObjectUtils.isEmpty(pageList)) {
// String processIdList = "";
// String stationIdList = "";
// String machineIdList = "";
// String toolsIdList = "";
// String userIdList = "";
// List<ZyPlanProcess> records = pageList.getRecords();
// for (ZyPlanProcess e : records) {
// processIdList += e.getProcessId();
// stationIdList += e.getStationId();
// machineIdList += e.getMachineIds();
// toolsIdList += e.getToolsIds();
// userIdList += e.getUserIds();
// }
// for (ZyPlanProcess e : records) {
// e.setProcessId(processIdList);
// e.setStationId(stationIdList);
// e.setMachineIds(machineIdList);
// e.setToolsIds(toolsIdList);
// e.setUserIds(userIdList);
// }
// }
// return Result.OK(pageList);
// }
@ApiOperation(value = "生产计划工序-查询产品工序&计划", notes = "生产计划工序-查询产品工序&计划")
@GetMapping(value = "/getProcessDatalist")
public Result<?> getProcessDatalist(ZyPlanProcess zyPlanProcess,
@ -124,7 +89,6 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
// QueryWrapper<ZyPlanProcess> queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap());
// Page<ZyPlanProcess> page = new Page<ZyPlanProcess>(pageNo, pageSize);
List<ZyPlanProcess> processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess);
return Result.OK(processDatalist);
}
@ -144,6 +108,36 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return Result.OK();
}
/**
* 自动排位(自动匹配工序设备与工位设备填充)未实现
* 根据工序查询工序设备表zy_process_machine
* 用工序设备表数据与工位设备进行匹配(工位设备包含工序设备即是匹配成功则自动填充工位设备字段数据匹配不上则不自动填充由用户自己录入)
* @param zyPlanProcess
* @param req
* @return
*/
@ApiOperation(value = "自动排位", notes = "自动排位")
@GetMapping(value = "/autoFilling")
public Result<?> autoFilling(ZyPlanProcess zyPlanProcess,
HttpServletRequest req) {
zyPlanProcessService.autoFilling(zyPlanProcess);
return Result.OK();
}
/**
*
* @param zyPlanProcess
* @param req
* @return
*/
@ApiOperation(value = "生成物料单", notes = "生成物料单")
@GetMapping(value = "/createMaterialBill")
public Result<?> createMaterialBill(ZyPlanProcess zyPlanProcess,
HttpServletRequest req) {
zyPlanProcessService.createMaterialBill(zyPlanProcess);
return Result.OK();
}
@ApiOperation(value = "计划班组管理-查询产品工序&班组", notes = "计划班组管理-查询产品工序&班组")
@GetMapping(value = "/getTeamDatalist")
public Result<?> getTeamDatalist(ZyPlanProcess zyPlanProcess,
@ -196,10 +190,10 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
e.setStationNum(!ObjectUtils.isEmpty(station.getStationNum()) ? station.getStationNum() : null);
if (StringUtils.isNotBlank(e.getMachineIds())) {
e.setMachineNames(iStationMachineService.convertByMachineId(e.getStationId()));
e.setMachineNames(iStationMachineService.convertByMachineIds(Arrays.asList(e.getMachineIds().split(","))));
}
if (StringUtils.isNotBlank(e.getToolsIds())) {
e.setToolsNames(iStationToolService.convertByToolId(e.getStationId()));
e.setToolsNames(iStationToolService.convertByToolIds(Arrays.asList(e.getToolsIds().split(","))));
}
} else {
e.setMachineIds("");

@ -161,5 +161,6 @@ public class ZyPlanProcess implements Serializable {
@ApiModelProperty(value = "机器时长")
private Integer totalMachine;
@ApiModelProperty(value = "工位序号")
private Integer stationNum;
}

@ -2,6 +2,7 @@ package org.jeecg.modules.productplan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.productplan.entity.ZyPlanProcessAccessories;
/**
@ -10,6 +11,7 @@ import org.jeecg.modules.productplan.entity.ZyPlanProcessAccessories;
* @Date: 2023-01-10
* @Version: V1.0
*/
@Mapper
public interface ZyPlanProcessAccessoriesMapper extends BaseMapper<ZyPlanProcessAccessories> {
}

@ -2,6 +2,7 @@ package org.jeecg.modules.productplan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.productplan.entity.ZyPlanProcessFabric;
/**
@ -10,6 +11,7 @@ import org.jeecg.modules.productplan.entity.ZyPlanProcessFabric;
* @Date: 2023-01-09
* @Version: V1.0
*/
@Mapper
public interface ZyPlanProcessFabricMapper extends BaseMapper<ZyPlanProcessFabric> {
}

@ -22,4 +22,9 @@ public interface IZyPlanProcessService extends IService<ZyPlanProcess> {
Map<String,Object> getPlanInfo(ZyPlanProcess zyPlanProcess);
List<ProcessDataVo> getTeamDatalist(ZyPlanProcess zyPlanProcess);
void autoFilling(ZyPlanProcess zyPlanProcess);
void createMaterialBill(ZyPlanProcess zyPlanProcess);
}

@ -1,7 +1,9 @@
package org.jeecg.modules.productplan.service.impl;
import com.alibaba.fastjson.JSON;
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 org.apache.commons.lang3.StringUtils;
import org.jeecg.common.exception.JeecgBootException;
@ -15,28 +17,21 @@ import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService;
import org.jeecg.modules.demo.pro.entity.ZyProcessAccessories;
import org.jeecg.modules.demo.pro.entity.ZyProcessFabric;
import org.jeecg.modules.demo.pro.entity.ZyProcessMachine;
import org.jeecg.modules.demo.pro.service.IZyProcessAccessoriesService;
import org.jeecg.modules.demo.pro.service.IZyProcessFabricService;
import org.jeecg.modules.demo.pro.service.IZyProcessMachineService;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
import org.jeecg.modules.product.pdaccessories.service.IProductAccessoriesService;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
import org.jeecg.modules.product.pdfabric.service.IProductFabricService;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService;
import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.ZyPlanProcessAccessories;
import org.jeecg.modules.productplan.entity.ZyPlanProcessFabric;
import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import org.jeecg.modules.productplan.entity.*;
import org.jeecg.modules.productplan.entity.vo.ProcessDataVo;
import org.jeecg.modules.productplan.enums.ProductPlanStatusEnum;
import org.jeecg.modules.productplan.mapper.ZyPlanProcessAccessoriesMapper;
import org.jeecg.modules.productplan.mapper.ZyPlanProcessFabricMapper;
import org.jeecg.modules.productplan.mapper.ZyPlanProcessMapper;
import org.jeecg.modules.productplan.service.IZyPlanProcessAccessoriesService;
import org.jeecg.modules.productplan.service.IZyPlanProcessFabricService;
import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.jeecg.modules.productplan.service.*;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDepartService;
@ -44,8 +39,10 @@ import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.team.entity.Groupx;
import org.jeecg.modules.team.entity.GroupxMember;
import org.jeecg.modules.team.entity.Station;
import org.jeecg.modules.team.entity.StationMachine;
import org.jeecg.modules.team.service.IGroupxMemberService;
import org.jeecg.modules.team.service.IGroupxService;
import org.jeecg.modules.team.service.IStationMachineService;
import org.jeecg.modules.team.service.IStationService;
import org.jeecg.modules.team.vo.GroupxMemeberVo;
import org.jeecg.modules.team.vo.StationVo;
@ -60,6 +57,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@ -115,6 +113,12 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
@Autowired
private IZyPlanProcessFabricService iZyPlanProcessFabricService;
@Autowired
private ZyPlanProcessFabricMapper zyPlanProcessFabricMapper;
@Autowired
private ZyPlanProcessAccessoriesMapper zyPlanProcessAccessoriesMapper;
@Autowired
private IZyPlanProcessAccessoriesService iZyPlanProcessAccessoriesService;
@ -130,6 +134,18 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
@Autowired
private IZyAccessoriesService iZyAccessoriesService;
@Autowired
private IZyProcessMachineService iZyProcessMachineService;
@Autowired
private IStationMachineService iStationMachineService;
@Autowired
private IZyPlanFabricService iZyPlanFabricService;
@Autowired
private IZyPlanAccessoriesService iZyPlanAccessoriesService;
public List<ZyPlanProcess> getProcessDatalist(ZyPlanProcess zyPlanProcess) {
//生产计划id
String planId = zyPlanProcess.getPlanId();
@ -145,7 +161,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
if (ObjectUtils.isEmpty(zyProduct)) {
throw new JeecgBootException("产品不存在!");
}
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId));
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId).orderByAsc(ZyPlanProcess::getStationNum));
if (!ObjectUtils.isEmpty(planProcessList)) {
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId));
List<StationVo> stationVoList = new LinkedList<>();
@ -159,7 +175,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
stationVoList.add(stationVo);
});
}
Groupx groupx = iGroupxService.getOne(new LambdaQueryWrapper<Groupx>().eq(Groupx::getDepartId, departId).eq(Groupx::getId,zyProductPlan.getTeamId()));
Groupx groupx = iGroupxService.getOne(new LambdaQueryWrapper<Groupx>().eq(Groupx::getDepartId, departId).eq(Groupx::getId, zyProductPlan.getTeamId()));
List<GroupxMember> groupMembers = iGroupxMemberService.list(new LambdaQueryWrapper<GroupxMember>().eq(GroupxMember::getGroupxId, groupx.getId()));
List<GroupxMemeberVo> groupxMemeberVoList = new LinkedList<>();
@ -184,6 +200,96 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
return planProcessList;
}
@Override
public void autoFilling(ZyPlanProcess zyPlanProcess) {
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(zyPlanProcess.getPlanId());
if (ObjectUtils.isEmpty(zyProductPlan)) {
throw new JeecgBootException("生产计划不存在!");
}
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
//是否有计划工序
if (ObjectUtils.isEmpty(planProcessList)) return;
//生产计划车间工位列表
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, zyProductPlan.getWorkshopId()));
/**
* 遍历计划工序
* 用工序设备表数据与工位设备进行匹配
* 依次用该生产计划的车间工位设备循环与工序设备比对(工位设备包含工序设备即是匹配成功则自动填充工位设备字段数据匹配不上则不自动填充由用户自己录入)
* 根据工序查询工序设备表zy_process_machine
*/
Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).forEach(e -> {
List<ZyProcessMachine> machineList = iZyProcessMachineService.list(new LambdaQueryWrapper<ZyProcessMachine>().eq(ZyProcessMachine::getProcessId, e.getProcessId()));
this.diffMachine(e, stationList, machineList);
});
}
@Override
public void createMaterialBill(ZyPlanProcess zyPlanProcess) {
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(zyPlanProcess.getPlanId());
if (ObjectUtils.isEmpty(zyProductPlan)) {
throw new JeecgBootException("生产计划不存在!");
}
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
if(ObjectUtils.isEmpty(planProcessList)) return;
this.delBillData(zyPlanProcess);
List<String> idList = planProcessList.stream().map(ZyPlanProcess::getId).collect(Collectors.toList());
QueryWrapper qw = new QueryWrapper();
qw.select("fabric_id", "sum(amount) as count");
qw.in("plan_process_id", idList);
qw.groupBy("fabric_id");
List<Map<String, Object>> maplist = zyPlanProcessFabricMapper.selectMaps(qw);
List<ZyPlanFabric> zyPlanFabricList = new LinkedList<>();
for (Map<String, Object> mp : maplist) {
ZyPlanFabric zyPlanFabric = new ZyPlanFabric();
zyPlanFabric.setPlanId(zyPlanProcess.getPlanId());
zyPlanFabric.setFabricId(mp.get("fabric_id").toString());
zyPlanFabric.setAmount(new BigDecimal(mp.get("count").toString()));
zyPlanFabricList.add(zyPlanFabric);
}
iZyPlanFabricService.saveBatch(zyPlanFabricList);
QueryWrapper qw2 = new QueryWrapper();
qw2.select("accessories_id", "sum(amount) as count");
qw2.in("plan_process_id", idList);
qw2.groupBy("accessories_id");
List<Map<String, Object>> maplist2 = zyPlanProcessAccessoriesMapper.selectMaps(qw2);
List<ZyPlanAccessories> zyPlanAccessoriesList = new LinkedList<>();
for (Map<String, Object> mp : maplist2) {
ZyPlanAccessories zyPlanAccessories = new ZyPlanAccessories();
zyPlanAccessories.setPlanId(zyPlanProcess.getPlanId());
zyPlanAccessories.setAccessoriesId(mp.get("accessories_id").toString());
zyPlanAccessories.setAmount(new BigDecimal(mp.get("count").toString()));
zyPlanAccessoriesList.add(zyPlanAccessories);
}
iZyPlanAccessoriesService.saveBatch(zyPlanAccessoriesList);
}
void diffMachine(ZyPlanProcess zyPlanProcess, List<Station> stationList, List<ZyProcessMachine> machineList) {
if (!ObjectUtils.isEmpty(machineList)) {
List<String> machineList1 = machineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.toList());
Optional.ofNullable(stationList).orElse(new ArrayList<>()).forEach(e -> {
List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, e.getId()));
List<String> machineList2 = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList());
if (machineList2.containsAll(machineList1)) {
String collect = machineList1.stream().collect(Collectors.joining(","));
zyPlanProcess.setMachineIds(collect);
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(machineList1));
zyPlanProcess.setStationId(e.getId());
zyPlanProcess.setStationName(e.getStationName());
zyPlanProcess.setStationNum(e.getStationNum());
this.updateById(zyPlanProcess);
return;
}
});
}
}
@Override
@Transactional(readOnly = false, rollbackFor = Exception.class)
public List<ZyPlanProcess> syncProductBaseProcess(ZyPlanProcess zyPlanProcess) {
@ -267,17 +373,36 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
}
/**
* 删除工序面料&工序辅料表&生产计划工序表数据
*
* @param zyPlanProcess
*/
@Transactional(readOnly = false, rollbackFor = Exception.class)
public void delSyncData(ZyPlanProcess zyPlanProcess) {
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
if (!ObjectUtils.isEmpty(planProcessList)) {
List<String> collect = Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).stream().map(ZyPlanProcess::getProcessId).collect(Collectors.toList());
List<String> collect = Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).stream().map(ZyPlanProcess::getId).collect(Collectors.toList());
iZyPlanProcessFabricService.remove(new LambdaQueryWrapper<ZyPlanProcessFabric>().in(ZyPlanProcessFabric::getPlanProcessId, collect));
iZyPlanProcessAccessoriesService.remove(new LambdaQueryWrapper<ZyPlanProcessAccessories>().in(ZyPlanProcessAccessories::getPlanProcessId, collect));
this.remove(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
}
}
/**
* 删除物料单(生产计划面料&生产计划辅料)数据
*
* @param zyPlanProcess
*/
@Transactional(readOnly = false, rollbackFor = Exception.class)
public void delBillData(ZyPlanProcess zyPlanProcess) {
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
if (!ObjectUtils.isEmpty(planProcessList)) {
iZyPlanFabricService.remove(new LambdaQueryWrapper<ZyPlanFabric>().eq(ZyPlanFabric::getPlanId, zyPlanProcess.getPlanId()));
iZyPlanAccessoriesService.remove(new LambdaQueryWrapper<ZyPlanAccessories>().eq(ZyPlanAccessories::getPlanId, zyPlanProcess.getPlanId()));
}
}
void saveBatchAccessoriesByProcessIdList(List<ZyPlanProcess> planProcessList) {
Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).forEach(e -> {
List<ZyProcessAccessories> accessoriesList = this.iZyProcessAccessoriesService.list(new LambdaQueryWrapper<ZyProcessAccessories>()
@ -285,7 +410,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
List<ZyPlanProcessAccessories> list = new LinkedList<>();
Optional.ofNullable(accessoriesList).orElse(new ArrayList<>()).forEach(obj -> {
ZyPlanProcessAccessories en = new ZyPlanProcessAccessories();
en.setPlanProcessId(e.getProcessId());
en.setPlanProcessId(e.getId());
en.setPlanId(e.getPlanId());
en.setAccessoriesId(obj.getAccessoriesId());
ZyAccessories zyAccessories = iZyAccessoriesService.getById(obj.getAccessoriesId());
@ -297,7 +422,6 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
}
void saveBatchFabricByProcessIdList(List<ZyPlanProcess> planProcessList) {
if (!org.springframework.util.StringUtils.isEmpty(planProcessList)) {
planProcessList.forEach(e -> {
List<ZyProcessFabric> fabricList = this.iZyProcessFabricService.list(new LambdaQueryWrapper<ZyProcessFabric>()
@ -306,7 +430,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
if (!org.springframework.util.StringUtils.isEmpty(fabricList)) {
fabricList.forEach(obj -> {
ZyPlanProcessFabric en = new ZyPlanProcessFabric();
en.setPlanProcessId(e.getProcessId());
en.setPlanProcessId(e.getId());
en.setPlanId(e.getPlanId());
en.setFabricId(obj.getFabricId());
ZyFabric zyFabric = iZyFabricService.getById(obj.getFabricId());
@ -317,19 +441,6 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
}
});
}
// Optional.ofNullable(planProcessList).orElse(null).forEach(e -> {
// Optional.ofNullable(fabricList).orElse(null).forEach(obj -> {
// ZyPlanProcessFabric en = new ZyPlanProcessFabric();
// en.setPlanProcessId(e.getProcessId());
// en.setPlanId(e.getPlanId());
// en.setFabricId(obj.getFabricId());
// ZyFabric zyFabric = iZyFabricService.getById(obj.getFabricId());
// en.setFabricName(StringUtils.isNotBlank(zyFabric.getName()) ? zyFabric.getName() : "");
// list.add(en);
// });
// iZyPlanProcessFabricService.saveBatch(list);
// });
}
@ -443,4 +554,6 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
}
return result;
}
}

@ -70,7 +70,10 @@ public class StationMachineController extends JeecgController<StationMachine, IS
if (!ObjectUtils.isEmpty(records)) {
records.forEach(e -> {
ZyDevice zyDevice = iZyDeviceService.getById(e.getMachineId());
e.setCode(StringUtils.isNotBlank(zyDevice.getCode()) ? zyDevice.getCode() : "");
if (!ObjectUtils.isEmpty(zyDevice)) {
e.setCode(StringUtils.isNotBlank(zyDevice.getCode()) ? zyDevice.getCode() : "");
}
});
}
return Result.OK(pageList);

@ -14,6 +14,7 @@ import java.util.List;
*/
public interface IStationMachineService extends IService<StationMachine> {
String convertByMachineId(String stationId);
String convertByStationId(String stationId);
String convertByMachineIds(List<String> MachineIds);
}

@ -4,6 +4,8 @@ package org.jeecg.modules.team.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.team.entity.StationTool;
import java.util.List;
/**
* @Description: 工序工具管理
* @Author: jeecg-boot
@ -13,4 +15,5 @@ import org.jeecg.modules.team.entity.StationTool;
public interface IStationToolService extends IService<StationTool> {
String convertByToolId(String stationId);
String convertByToolIds(List<String> toolIdss);
}

@ -28,7 +28,27 @@ public class StationMachineServiceImpl extends ServiceImpl<StationMachineMapper,
private IZyDeviceService iZyDeviceService;
@Override
public String convertByMachineId(String stationId) {
public String convertByMachineIds(List<String> machineIds) {
// List<StationMachine> machineList = this.list(new LambdaQueryWrapper<StationMachine>().in(StationMachine::getMachineId, machineIds));
StringBuffer machineNames = new StringBuffer();
String machineNamesStr = "";
if (!ObjectUtils.isEmpty(machineIds)) {
machineIds.forEach(e -> {
ZyDevice zyDevice = iZyDeviceService.getById(e);
if (!ObjectUtils.isEmpty(zyDevice)) {
machineNames.append(zyDevice.getName()).append(",");
}
});
if (StringUtils.isNotBlank(machineNames.toString())) {
machineNamesStr = machineNames.toString();
machineNamesStr = machineNames.substring(0, machineNamesStr.length() - 1);
}
}
return machineNamesStr;
}
@Override
public String convertByStationId(String stationId) {
List<StationMachine> machineList = this.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, stationId));
StringBuffer machineNames = new StringBuffer();
String machineNamesStr = "";
@ -39,9 +59,11 @@ public class StationMachineServiceImpl extends ServiceImpl<StationMachineMapper,
machineNames.append(zyDevice.getName()).append(",");
}
});
if (StringUtils.isNotBlank(machineNames.toString())) {
machineNamesStr = machineNames.toString();
machineNamesStr = machineNames.substring(0, machineNamesStr.length() - 1);
}
}
machineNamesStr = machineNames.toString();
machineNamesStr = machineNames.substring(0, machineNamesStr.length() - 1);
return machineNamesStr;
}
}

@ -2,6 +2,7 @@ package org.jeecg.modules.team.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.modules.team.entity.StationTool;
import org.jeecg.modules.team.mapper.StationToolMapper;
import org.jeecg.modules.team.service.IStationToolService;
@ -37,9 +38,30 @@ public class StationToolServiceImpl extends ServiceImpl<StationToolMapper, Stati
toolNames.append(zyTool.getName()).append(",");
}
});
if (StringUtils.isNotBlank(toolNames.toString())) {
toolNamesStr = toolNames.toString();
toolNamesStr = toolNamesStr.substring(0, toolNamesStr.length() - 1);
}
}
return toolNamesStr;
}
@Override
public String convertByToolIds(List<String> toolList) {
StringBuffer toolNames = new StringBuffer();
String toolNamesStr = "";
if (!ObjectUtils.isEmpty(toolList)) {
toolList.forEach(e -> {
ZyTool zyTool = iZyToolService.getById(e);
if (!ObjectUtils.isEmpty(zyTool)) {
toolNames.append(zyTool.getName()).append(",");
}
});
if (StringUtils.isNotBlank(toolNames.toString())) {
toolNamesStr = toolNames.toString();
toolNamesStr = toolNamesStr.substring(0, toolNamesStr.length() - 1);
}
}
toolNamesStr = toolNames.toString();
toolNamesStr = toolNamesStr.substring(0, toolNamesStr.length() - 1);
return toolNamesStr;
}
}

Loading…
Cancel
Save