From 152c61ce57415dca222d7119ae230103e31d43cd Mon Sep 17 00:00:00 2001 From: wangjiadong <1654135867@qq.com> Date: Sun, 29 Jan 2023 16:51:50 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=B5=8B=E4=BD=93=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/CustomerMeasureList.vue | 20 +++--- .../controller/CustomerMeasureController.java | 61 +++++++++++++++++-- .../mapper/CustomerMeasureMapper.java | 17 ++++++ .../service/ICustomerMeasureService.java | 5 ++ .../impl/CustomerMeasureServiceImpl.java | 39 ++++++++++++ 5 files changed, 126 insertions(+), 16 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/customermeasure/admin/CustomerMeasureList.vue b/ant-design-vue-jeecg/src/views/customermeasure/admin/CustomerMeasureList.vue index 02be3562..8c987bb4 100644 --- a/ant-design-vue-jeecg/src/views/customermeasure/admin/CustomerMeasureList.vue +++ b/ant-design-vue-jeecg/src/views/customermeasure/admin/CustomerMeasureList.vue @@ -101,7 +101,7 @@ - + 排序 编辑 @@ -126,7 +126,7 @@ - + @@ -136,7 +136,7 @@ import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import CustomerMeasureModal from './modules/CustomerMeasureModal' -/* import CustomerMeasureModalpaixu from './modules/CustomerMeasureModalpaixu'*/ + import CustomerMeasureModal1 from './modules/CustomerMeasureModal1' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import { getAction } from '@/api/manage' @@ -144,8 +144,8 @@ name: 'CustomerMeasureList', mixins:[JeecgListMixin, mixinDevice], components: { - CustomerMeasureModal/*, - CustomerMeasureModalpaixu*/ + CustomerMeasureModal, + CustomerMeasureModal1 }, data () { return { @@ -284,20 +284,20 @@ superFieldList:[], } }, - created(record){ + /* created(record){ getAction(this.url.moreYear,{ id: record.id}) - }, + },*/ computed: { importExcelUrl: function(){ return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; }, }, methods: { - /* paixu: function (record) { - this.$refs.modalFormpaixu.edit(record.id); + paixu: function (record) { + this.$refs.modalFormpaixu.edit(record.userId); this.$refs.modalFormpaixu.title = record.userId_dictText+"测体管理"; this.$refs.modalFormpaixu.disableSubmit = false; - },*/ + }, initDictConfig(){ }, getSuperFieldList(){ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/controller/CustomerMeasureController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/controller/CustomerMeasureController.java index 619a9db9..b9683852 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/controller/CustomerMeasureController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/controller/CustomerMeasureController.java @@ -8,6 +8,7 @@ import java.util.stream.Collectors; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jeecg.common.api.vo.Result; @@ -50,7 +51,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class CustomerMeasureController extends JeecgController { @Autowired private ICustomerMeasureService customerMeasureService; - + /** * 分页列表查询 * @@ -72,7 +73,33 @@ public class CustomerMeasureController extends JeecgController pageList = customerMeasureService.page(page, queryWrapper); return Result.OK(pageList); } - + + + /** + * 分页列表查询 + * + * @param customerMeasure + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "顾客测体管理-分页列表查询") + @ApiOperation(value="顾客测体管理-分页列表查询", notes="顾客测体管理-分页列表查询") + @GetMapping(value = "/list1") + public Result queryPageList1(CustomerMeasure customerMeasure, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(customerMeasure, req.getParameterMap()); + System.out.println(req.toString()); + System.out.println(customerMeasure); + queryWrapper.eq("user_id",customerMeasure.getUserId()); + Page page = new Page(pageNo, pageSize); + IPage pageList = customerMeasureService.page(page, queryWrapper); + return Result.OK(pageList); + } + /** * 添加 * @@ -142,7 +169,7 @@ public class CustomerMeasureController extends JeecgController shang(@RequestParam(name="id",required=true) String id) { + customerMeasureService.up(id); + return Result.ok("升序成功"); + } + + + @AutoLog(value = "排序") + @ApiOperation(value="排序", notes="排序") + @GetMapping(value = "/down") + public Result xia(@RequestParam(name="id",required=true) String id) { + int a=customerMeasureService.findSort(id); + if(a==0){ + return Result.error("当前已经是最低级别!!!");}else { + customerMeasureService.down(id); + return Result.ok("降序成功"); + } + } + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/CustomerMeasureMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/CustomerMeasureMapper.java index 8ff16a67..72578fa7 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/CustomerMeasureMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/CustomerMeasureMapper.java @@ -5,6 +5,8 @@ package org.jeecg.modules.demo.customermeasure.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; @@ -17,4 +19,19 @@ import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; */ public interface CustomerMeasureMapper extends BaseMapper { + @Select("select sort from customer_measure where id=#{id} ") + Integer upfindsort(String id); + + @Select("select id from customer_measure where sort=#{i} ") + String findproid(int i); + + @Update("update customer_measure set sort =#{i} where id = #{id} ") + void innew(String id, int i); + + @Update("update customer_measure set sort =#{sort} where id = #{proid} ") + void innewpro(String proid, Integer sort); + + + @Select("select sort from customer_measure where id=#{id} ") + int findSort(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/ICustomerMeasureService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/ICustomerMeasureService.java index 8cd14d19..f2663e76 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/ICustomerMeasureService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/ICustomerMeasureService.java @@ -13,4 +13,9 @@ import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; */ public interface ICustomerMeasureService extends IService { + void up(String id); + + int findSort(String id); + + void down(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/impl/CustomerMeasureServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/impl/CustomerMeasureServiceImpl.java index dbebfabd..a5d6f903 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/impl/CustomerMeasureServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/impl/CustomerMeasureServiceImpl.java @@ -6,6 +6,7 @@ package org.jeecg.modules.demo.customermeasure.service.impl; import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper; import org.jeecg.modules.demo.customermeasure.service.ICustomerMeasureService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -19,4 +20,42 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class CustomerMeasureServiceImpl extends ServiceImpl implements ICustomerMeasureService { + + @Autowired + CustomerMeasureMapper customerMeasureMapper; + + @Override + public void up(String id) { + Integer sort = customerMeasureMapper.upfindsort(id); + if (sort>0) { + //升序前找到后一个排序 + String proid = customerMeasureMapper.findproid(sort + 1); + if (proid!="") { + //调换排序 + customerMeasureMapper.innew(id,sort+1); + customerMeasureMapper.innewpro(proid,sort); + } + } + + } + + @Override + public int findSort(String id) { + return customerMeasureMapper.findSort(id); + } + + @Override + public void down(String id) { + Integer sort = customerMeasureMapper.upfindsort(id); + if (sort>0) { + String proid = customerMeasureMapper.findproid(sort - 1); + if (proid!="") { + customerMeasureMapper.innew(id,sort-1); + customerMeasureMapper.innewpro(proid,sort); + } + } + + } + + } From c5179047a7b8ca3c00e8658f78c916b10f57f2d5 Mon Sep 17 00:00:00 2001 From: wangjiadong <1654135867@qq.com> Date: Sun, 29 Jan 2023 16:53:42 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=B5=8B=E4=BD=93=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/modules/CustomerMeasureList1.vue | 279 ++++++++++++++++++ .../admin/modules/CustomerMeasureModal1.vue | 61 ++++ 2 files changed, 340 insertions(+) create mode 100644 ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureList1.vue create mode 100644 ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureModal1.vue diff --git a/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureList1.vue b/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureList1.vue new file mode 100644 index 00000000..30c7552c --- /dev/null +++ b/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureList1.vue @@ -0,0 +1,279 @@ + + + + diff --git a/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureModal1.vue b/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureModal1.vue new file mode 100644 index 00000000..32b02c52 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureModal1.vue @@ -0,0 +1,61 @@ + + + From d3f05a4b9cd1fb37de52be2ab60b8b1203b44b9e Mon Sep 17 00:00:00 2001 From: lenovo <123> Date: Sun, 29 Jan 2023 17:03:25 +0800 Subject: [PATCH 3/7] =?UTF-8?q?2023-1-29=E4=BA=A7=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pdaccessories/ProductAccessoriesList.vue | 20 ++++++++++- .../product/pdfabric/ProductFabricList.vue | 21 ++++++++++- .../productProcess/ZyProductProcessList.vue | 32 +++++++++++++---- .../src/views/zyWorkProduct/ZyProductList.vue | 36 +++++++++---------- .../ProductAccessoriesController.java | 16 ++++----- .../entity/ProductAccessories.java | 4 ++- .../mapper/ProductAccessoriesMapper.java | 4 +++ .../service/IProductAccessoriesService.java | 4 +++ .../impl/ProductAccessoriesServiceImpl.java | 15 ++++++++ .../controller/ProductFabricController.java | 16 ++++----- .../pdfabric/entity/ProductFabric.java | 4 ++- .../pdfabric/mapper/ProductFabricMapper.java | 5 +++ .../service/IProductFabricService.java | 4 +++ .../impl/ProductFabricServiceImpl.java | 15 ++++++++ .../ZyProductProcessController.java | 18 +++++----- .../entity/ZyProductProcess.java | 5 ++- .../mapper/ZyProductProcessMapper.java | 5 +++ .../service/IZyProductProcessService.java | 4 +++ .../impl/ZyProductProcessServiceImpl.java | 16 +++++++++ 19 files changed, 189 insertions(+), 55 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/product/pdaccessories/ProductAccessoriesList.vue b/ant-design-vue-jeecg/src/views/product/pdaccessories/ProductAccessoriesList.vue index 80d3b134..17a12e2c 100644 --- a/ant-design-vue-jeecg/src/views/product/pdaccessories/ProductAccessoriesList.vue +++ b/ant-design-vue-jeecg/src/views/product/pdaccessories/ProductAccessoriesList.vue @@ -5,6 +5,11 @@
+ + + + + @@ -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){ diff --git a/ant-design-vue-jeecg/src/views/product/pdfabric/ProductFabricList.vue b/ant-design-vue-jeecg/src/views/product/pdfabric/ProductFabricList.vue index a485c5fc..ca848817 100644 --- a/ant-design-vue-jeecg/src/views/product/pdfabric/ProductFabricList.vue +++ b/ant-design-vue-jeecg/src/views/product/pdfabric/ProductFabricList.vue @@ -5,11 +5,17 @@
+ + + + + + 查询 @@ -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){ diff --git a/ant-design-vue-jeecg/src/views/product/productProcess/ZyProductProcessList.vue b/ant-design-vue-jeecg/src/views/product/productProcess/ZyProductProcessList.vue index 7fba391a..903dff23 100644 --- a/ant-design-vue-jeecg/src/views/product/productProcess/ZyProductProcessList.vue +++ b/ant-design-vue-jeecg/src/views/product/productProcess/ZyProductProcessList.vue @@ -5,6 +5,11 @@
+ + + + + @@ -30,13 +35,13 @@ - - - - 删除 - - 批量操作 - + + + + + + +
@@ -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(){ diff --git a/ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue b/ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue index 1c853513..8a3ad848 100644 --- a/ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue +++ b/ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue @@ -118,16 +118,16 @@ - 工序 + 工序 模块 - 面料 + 面料 - 辅料 + 辅料 设备 @@ -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, + } }); }, //跳转-设备 diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/controller/ProductAccessoriesController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/controller/ProductAccessoriesController.java index 4904828b..a714aa3f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/controller/ProductAccessoriesController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/controller/ProductAccessoriesController.java @@ -68,15 +68,15 @@ public class ProductAccessoriesController extends JeecgController 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 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 fabric = productAccessoriesService.findAll(s); +// queryWrapper.in("accessories_id",fabric); +// } Page page = new Page(pageNo, pageSize); - IPage pageList = productAccessoriesService.page(page, queryWrapper); + IPage pageList = productAccessoriesService.page1(page, productAccessories); return Result.OK(pageList); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/entity/ProductAccessories.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/entity/ProductAccessories.java index 583ca4bc..0a8bfd61 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/entity/ProductAccessories.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/entity/ProductAccessories.java @@ -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; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/mapper/ProductAccessoriesMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/mapper/ProductAccessoriesMapper.java index fba9f874..2ac630bd 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/mapper/ProductAccessoriesMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/mapper/ProductAccessoriesMapper.java @@ -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 @Delete("delete from product_accessories where product_id=#{pd} and accessories_id=#{access}") void deleteAccessories(@Param("pd") String productId, @Param("access") String listAccessory); + @Select("") + IPage page1(Page page, @Param("productId") String productId, @Param("id") String accessoriesId, @Param("number") String nums); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/IProductAccessoriesService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/IProductAccessoriesService.java index 1d63d862..914750a5 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/IProductAccessoriesService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/IProductAccessoriesService.java @@ -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 List findAll(String s); void deleteAccessories(String productId, String listAccessory); + + IPage page1(Page page, ProductAccessories productAccessories); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/impl/ProductAccessoriesServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/impl/ProductAccessoriesServiceImpl.java index 0310a358..96c626e8 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/impl/ProductAccessoriesServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdaccessories/service/impl/ProductAccessoriesServiceImpl.java @@ -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 page1(Page 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()); + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/controller/ProductFabricController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/controller/ProductFabricController.java index e1b164cf..c80964b6 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/controller/ProductFabricController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/controller/ProductFabricController.java @@ -70,15 +70,15 @@ public class ProductFabricController extends JeecgController 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 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 fabric = productFabricService.findAll(s); +// queryWrapper.in("fabric_id",fabric); +// } Page page = new Page(pageNo, pageSize); - IPage pageList = productFabricService.page(page, queryWrapper); + IPage pageList = productFabricService.page1(page, productFabric); return Result.OK(pageList); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/entity/ProductFabric.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/entity/ProductFabric.java index b55eff14..1b432d9a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/entity/ProductFabric.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/entity/ProductFabric.java @@ -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; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/mapper/ProductFabricMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/mapper/ProductFabricMapper.java index ac597696..b3945e26 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/mapper/ProductFabricMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/mapper/ProductFabricMapper.java @@ -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 { @Delete("delete from product_fabric where product_id=#{productId} and fabric_id=#{s1}") void deleteFabric(@Param("productId") String productId, @Param("s1") String s1); + + @Select("") + IPage page1(Page page,@Param("productId") String productId, @Param("id") String fabricId, @Param("number") String fabricNumber); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/IProductFabricService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/IProductFabricService.java index e2db1039..3a957e09 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/IProductFabricService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/IProductFabricService.java @@ -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 { List findAll(String s); void deleteFabric(String productId, String s1); + + IPage page1(Page page, ProductFabric productFabric); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/impl/ProductFabricServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/impl/ProductFabricServiceImpl.java index 84a3ff88..73c46170 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/impl/ProductFabricServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdfabric/service/impl/ProductFabricServiceImpl.java @@ -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 page1(Page 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()); + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/controller/ZyProductProcessController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/controller/ZyProductProcessController.java index 8d0f1c31..01537584 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/controller/ZyProductProcessController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/controller/ZyProductProcessController.java @@ -82,17 +82,17 @@ public class ZyProductProcessController extends JeecgController 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 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 list=zyProductProcessService.find(s); +// queryWrapper.in("process_id",list); +// } Page page = new Page(pageNo, pageSize); - IPage pageList = zyProductProcessService.page(page, queryWrapper); + IPage pageList = zyProductProcessService.page1(page,zyProductProcess); return Result.OK(pageList); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java index 9a3c84a0..bef04f79 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java @@ -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; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java index 9f38001c..1deb9c49 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java @@ -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 { //设备 @Select("select machine_id from zy_process_machine where process_id =#{processId}") List findAllMachine(String processId); + //按照number降序排列,通过产品id筛选,然后通过processId和processCode筛选 + @Select("") + IPage page1(Page page, @Param("productId") String productId, @Param("process") String processId, @Param("code") String processCode); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/IZyProductProcessService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/IZyProductProcessService.java index fe538ad6..42de9f93 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/IZyProductProcessService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/IZyProductProcessService.java @@ -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 { List findAllOperationtool(String processId); List findAllMachine(String processId); + + IPage page1(Page page, ZyProductProcess zyProductProcess); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/impl/ZyProductProcessServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/impl/ZyProductProcessServiceImpl.java index 4c0df1b4..e2044d35 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/impl/ZyProductProcessServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/service/impl/ZyProductProcessServiceImpl.java @@ -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 findAllMachine(String processId) { return zyProductProcessMapper.findAllMachine(processId); } + + @Override + public IPage page1(Page 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()); + } } From 9d92b39ff2928181978adc0864288073da65f4c8 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Mon, 30 Jan 2023 11:24:57 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=B7=A5=E5=BA=8F?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E7=94=9F=E6=88=90=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=8D=95=E3=80=81=E8=87=AA=E5=8A=A8=E6=8E=92=E4=BD=8D=201.30?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/productplan/ProductplanManage.vue | 58 +++++- .../productplan/modules/ZyProductPlanForm.vue | 2 +- .../controller/ZyPlanProcessController.java | 70 ++++--- .../productplan/entity/ZyPlanProcess.java | 1 + .../ZyPlanProcessAccessoriesMapper.java | 2 + .../mapper/ZyPlanProcessFabricMapper.java | 2 + .../service/IZyPlanProcessService.java | 5 + .../impl/ZyPlanProcessServiceImpl.java | 177 ++++++++++++++---- .../controller/StationMachineController.java | 5 +- .../team/service/IStationMachineService.java | 3 +- .../team/service/IStationToolService.java | 3 + .../impl/StationMachineServiceImpl.java | 28 ++- .../service/impl/StationToolServiceImpl.java | 26 ++- 13 files changed, 297 insertions(+), 85 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue b/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue index 34c84d1d..3e66ef30 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue @@ -48,10 +48,13 @@ > @@ -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; diff --git a/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue b/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue index 418bcb36..2d78b0f3 100644 --- a/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue +++ b/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue @@ -126,7 +126,7 @@ export default { workTime: '', status: 0, auditTimr: '', - speedUp: 0, + speedUp: 1, auditBy: 'admin', }, labelCol: { diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java index ff0c3aa8..967857d4 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java @@ -80,41 +80,6 @@ public class ZyPlanProcessController extends JeecgController queryPageList2(ZyPlanProcess zyPlanProcess, -// @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, -// @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, -// HttpServletRequest req) { -// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); -// Page page = new Page(pageNo, pageSize); -// IPage pageList = zyPlanProcessService.page(page, queryWrapper); -// if (!ObjectUtils.isEmpty(pageList)) { -// String processIdList = ""; -// String stationIdList = ""; -// String machineIdList = ""; -// String toolsIdList = ""; -// String userIdList = ""; -// List 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 queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); // Page page = new Page(pageNo, pageSize); List processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess); - return Result.OK(processDatalist); } @@ -144,6 +108,36 @@ public class ZyPlanProcessController extends JeecgController 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 { } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/mapper/ZyPlanProcessFabricMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/mapper/ZyPlanProcessFabricMapper.java index 1b11be2b..b42e529d 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/mapper/ZyPlanProcessFabricMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/mapper/ZyPlanProcessFabricMapper.java @@ -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 { } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java index bc7b7814..80aea3a9 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java @@ -22,4 +22,9 @@ public interface IZyPlanProcessService extends IService { Map getPlanInfo(ZyPlanProcess zyPlanProcess); List getTeamDatalist(ZyPlanProcess zyPlanProcess); + + void autoFilling(ZyPlanProcess zyPlanProcess); + + void createMaterialBill(ZyPlanProcess zyPlanProcess); + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java index b9fd87ad..1500aefe 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java @@ -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 getProcessDatalist(ZyPlanProcess zyPlanProcess) { //生产计划id String planId = zyPlanProcess.getPlanId(); @@ -145,7 +161,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl planProcessList = this.list(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, planId)); + List planProcessList = this.list(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, planId).orderByAsc(ZyPlanProcess::getStationNum)); if (!ObjectUtils.isEmpty(planProcessList)) { List stationList = iStationService.list(new LambdaQueryWrapper().eq(Station::getDepartId, departId)); List stationVoList = new LinkedList<>(); @@ -159,7 +175,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl().eq(Groupx::getDepartId, departId).eq(Groupx::getId,zyProductPlan.getTeamId())); + Groupx groupx = iGroupxService.getOne(new LambdaQueryWrapper().eq(Groupx::getDepartId, departId).eq(Groupx::getId, zyProductPlan.getTeamId())); List groupMembers = iGroupxMemberService.list(new LambdaQueryWrapper().eq(GroupxMember::getGroupxId, groupx.getId())); List groupxMemeberVoList = new LinkedList<>(); @@ -184,6 +200,96 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl planProcessList = this.list(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId())); + //是否有计划工序 + if (ObjectUtils.isEmpty(planProcessList)) return; + + //生产计划车间工位列表 + List stationList = iStationService.list(new LambdaQueryWrapper().eq(Station::getDepartId, zyProductPlan.getWorkshopId())); + + /** + * 遍历计划工序: + * 用工序设备表数据与工位设备进行匹配 + * 依次用该生产计划的车间工位设备循环与工序设备比对【(工位设备包含工序设备即是匹配成功,则自动填充工位、设备字段数据,匹配不上则不自动填充,由用户自己录入)】 + * 根据工序,查询工序设备表zy_process_machine, + */ + Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).forEach(e -> { + List machineList = iZyProcessMachineService.list(new LambdaQueryWrapper().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 planProcessList = this.list(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId())); + if(ObjectUtils.isEmpty(planProcessList)) return; + + this.delBillData(zyPlanProcess); + List 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> maplist = zyPlanProcessFabricMapper.selectMaps(qw); + List zyPlanFabricList = new LinkedList<>(); + for (Map 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> maplist2 = zyPlanProcessAccessoriesMapper.selectMaps(qw2); + List zyPlanAccessoriesList = new LinkedList<>(); + for (Map 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 stationList, List machineList) { + if (!ObjectUtils.isEmpty(machineList)) { + List machineList1 = machineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.toList()); + Optional.ofNullable(stationList).orElse(new ArrayList<>()).forEach(e -> { + List stationMachineList = iStationMachineService.list(new LambdaQueryWrapper().eq(StationMachine::getStationId, e.getId())); + List 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 syncProductBaseProcess(ZyPlanProcess zyPlanProcess) { @@ -267,17 +373,36 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl planProcessList = this.list(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId())); if (!ObjectUtils.isEmpty(planProcessList)) { - List collect = Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).stream().map(ZyPlanProcess::getProcessId).collect(Collectors.toList()); + List collect = Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).stream().map(ZyPlanProcess::getId).collect(Collectors.toList()); iZyPlanProcessFabricService.remove(new LambdaQueryWrapper().in(ZyPlanProcessFabric::getPlanProcessId, collect)); iZyPlanProcessAccessoriesService.remove(new LambdaQueryWrapper().in(ZyPlanProcessAccessories::getPlanProcessId, collect)); this.remove(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId())); } } + /** + * 删除物料单(生产计划面料&生产计划辅料)数据 + * + * @param zyPlanProcess + */ + @Transactional(readOnly = false, rollbackFor = Exception.class) + public void delBillData(ZyPlanProcess zyPlanProcess) { + List planProcessList = this.list(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId())); + if (!ObjectUtils.isEmpty(planProcessList)) { + iZyPlanFabricService.remove(new LambdaQueryWrapper().eq(ZyPlanFabric::getPlanId, zyPlanProcess.getPlanId())); + iZyPlanAccessoriesService.remove(new LambdaQueryWrapper().eq(ZyPlanAccessories::getPlanId, zyPlanProcess.getPlanId())); + } + } + void saveBatchAccessoriesByProcessIdList(List planProcessList) { Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).forEach(e -> { List accessoriesList = this.iZyProcessAccessoriesService.list(new LambdaQueryWrapper() @@ -285,7 +410,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl 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 planProcessList) { - if (!org.springframework.util.StringUtils.isEmpty(planProcessList)) { planProcessList.forEach(e -> { List fabricList = this.iZyProcessFabricService.list(new LambdaQueryWrapper() @@ -306,7 +430,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl { 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 { -// 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 { 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); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationMachineService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationMachineService.java index 64cabc24..7777515e 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationMachineService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationMachineService.java @@ -14,6 +14,7 @@ import java.util.List; */ public interface IStationMachineService extends IService { - String convertByMachineId(String stationId); + String convertByStationId(String stationId); + String convertByMachineIds(List MachineIds); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationToolService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationToolService.java index 2df93eac..73f61cb2 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationToolService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationToolService.java @@ -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 { String convertByToolId(String stationId); + String convertByToolIds(List toolIdss); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationMachineServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationMachineServiceImpl.java index 7171e687..9deda8f6 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationMachineServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationMachineServiceImpl.java @@ -28,7 +28,27 @@ public class StationMachineServiceImpl extends ServiceImpl machineIds) { +// List machineList = this.list(new LambdaQueryWrapper().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 machineList = this.list(new LambdaQueryWrapper().eq(StationMachine::getStationId, stationId)); StringBuffer machineNames = new StringBuffer(); String machineNamesStr = ""; @@ -39,9 +59,11 @@ public class StationMachineServiceImpl extends ServiceImpl 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; } } From f574cf15253d1114be204bce6e01c5612562bea0 Mon Sep 17 00:00:00 2001 From: mors <3067699729@qq.com> Date: Mon, 30 Jan 2023 15:02:47 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=9C=8D=E8=A3=85=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ZyClothsTypeController.java | 7 ++++--- .../demo/base/mapper/ZyClothsTypeMapper.java | 4 ++++ .../base/service/IZyClothsTypeService.java | 2 ++ .../service/impl/ZyClothsTypeServiceImpl.java | 18 ++++++++++++++++-- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java index 51f937fc..4c67e11e 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java @@ -227,9 +227,10 @@ public class ZyClothsTypeController extends JeecgController { /**根据部门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); diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java index 95894871..46b61cbd 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsTypeService.java @@ -19,6 +19,8 @@ public interface IZyClothsTypeService extends IService { /**根据企业名称拿到企业编号*/ String getEnterpriseNums(String enterpriseName); + /**根据企业名称拿到企业编号*/ + String getEnterpriseNumsTwo(String enterpriseName); Long orderNumber(); diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java index 761132ed..9ee3d13b 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java @@ -38,9 +38,10 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl listString = zyClothsTypeMapper.selectNumsList(); From 6f1ca4604937f9db7ad856623103b3d6411ec58f Mon Sep 17 00:00:00 2001 From: wangjiadong <1654135867@qq.com> Date: Mon, 30 Jan 2023 17:31:33 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/CustomerPaymentList.vue | 41 +++++++++++-------- .../admin/modules/CustomerPaymentForm.vue | 6 +++ .../controller/CustomerPaymentController.java | 40 ++++++++++++++++++ .../entity/CustomerPayment.java | 4 ++ .../mapper/CustomerPaymentMapper.java | 16 ++++++++ .../service/ICustomerPaymentService.java | 5 +++ .../impl/CustomerPaymentServiceImpl.java | 35 ++++++++++++++++ 7 files changed, 131 insertions(+), 16 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/customerpayment/admin/CustomerPaymentList.vue b/ant-design-vue-jeecg/src/views/customerpayment/admin/CustomerPaymentList.vue index 1cec0273..87572524 100644 --- a/ant-design-vue-jeecg/src/views/customerpayment/admin/CustomerPaymentList.vue +++ b/ant-design-vue-jeecg/src/views/customerpayment/admin/CustomerPaymentList.vue @@ -100,27 +100,21 @@ + 排序 + 编辑 - - - 更多 - - - 详情 - - - - 删除 - - - - + 详情 + + + 删除 + +
- + @@ -131,13 +125,15 @@ import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import CustomerPaymentModal from './modules/CustomerPaymentModal' + import CustomerPaymentModal1 from './modules/CustomerPaymentModal1' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' export default { name: 'CustomerPaymentList', mixins:[JeecgListMixin, mixinDevice], components: { - CustomerPaymentModal + CustomerPaymentModal, + CustomerPaymentModal1 }, data () { return { @@ -161,6 +157,12 @@ align:"center", dataIndex: 'userId_dictText' }, + { + title:'排序', + align:"center", + sorter: true, + dataIndex: 'sort' + }, { title:'支付类型', align:"center", @@ -201,6 +203,8 @@ } ], url: { + up: "/customerpayment/customerPayment/up", + down: "/customerpayment/customerPayment/down", list: "/customerpayment/customerPayment/list", delete: "/customerpayment/customerPayment/delete", deleteBatch: "/customerpayment/customerPayment/deleteBatch", @@ -221,6 +225,11 @@ }, }, methods: { + paixu: function (record) { + this.$refs.modalFormpaixu.edit(record.userId); + this.$refs.modalFormpaixu.title = record.userId_dictText+"测体管理"; + this.$refs.modalFormpaixu.disableSubmit = false; + }, initDictConfig(){ }, getSuperFieldList(){ diff --git a/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentForm.vue b/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentForm.vue index d6960db9..9fa82511 100644 --- a/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentForm.vue +++ b/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentForm.vue @@ -16,6 +16,12 @@ />
+ + + + + + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/controller/CustomerPaymentController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/controller/CustomerPaymentController.java index a8362916..ce6f561a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/controller/CustomerPaymentController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/controller/CustomerPaymentController.java @@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import org.jeecg.modules.demo.customerpayment.entity.CustomerPayment; import org.jeecg.modules.demo.customerpayment.service.ICustomerPaymentService; @@ -73,6 +74,23 @@ public class CustomerPaymentController extends JeecgController queryPageList1(CustomerPayment customerPayment, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(customerPayment, req.getParameterMap()); + queryWrapper.eq("user_id",customerPayment.getUserId()); + Page page = new Page(pageNo, pageSize); + IPage pageList = customerPaymentService.page(page, queryWrapper); + return Result.OK(pageList); + } + /** * 添加 * @@ -192,4 +210,26 @@ public class CustomerPaymentController extends JeecgController shang(@RequestParam(name="id",required=true) String id) { + customerPaymentService.up(id); + return Result.ok("升序成功"); + } + + + @AutoLog(value = "排序") + @ApiOperation(value="排序", notes="排序") + @GetMapping(value = "/down") + public Result xia(@RequestParam(name="id",required=true) String id) { + int a=customerPaymentService.findSort(id); + if(a==0){ + return Result.error("当前已经是最低级别!!!");}else { + customerPaymentService.down(id); + return Result.ok("降序成功"); + } + } + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/entity/CustomerPayment.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/entity/CustomerPayment.java index 3f337bdf..369f1084 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/entity/CustomerPayment.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/entity/CustomerPayment.java @@ -86,4 +86,8 @@ public class CustomerPayment implements Serializable { @Excel(name = "开户支行", width = 15) @ApiModelProperty(value = "开户支行") private java.lang.String bankzh; + /**排序*/ + @Excel(name = "排序", width = 15) + @ApiModelProperty(value = "排序") + private java.lang.Integer sort; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/mapper/CustomerPaymentMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/mapper/CustomerPaymentMapper.java index 18baa625..13a07c5a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/mapper/CustomerPaymentMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/mapper/CustomerPaymentMapper.java @@ -5,6 +5,8 @@ import java.util.List; import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; import org.jeecg.modules.demo.customerpayment.entity.CustomerPayment; /** @@ -15,4 +17,18 @@ import org.jeecg.modules.demo.customerpayment.entity.CustomerPayment; */ public interface CustomerPaymentMapper extends BaseMapper { + @Select("select sort from customer_payment where id=#{id} ") + Integer upfindsort(String id); + + @Select("select id from customer_payment where sort=#{i} ") + String findproid(int i); + + @Update("update customer_payment set sort =#{i} where id = #{id} ") + void innew(String id, int i); + + @Update("update customer_payment set sort =#{sort} where id = #{proid} ") + void innewpro(String proid, Integer sort); + + @Select("select sort from customer_payment where id=#{id} ") + int findSort(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/service/ICustomerPaymentService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/service/ICustomerPaymentService.java index a01a559e..a549c4e2 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/service/ICustomerPaymentService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/service/ICustomerPaymentService.java @@ -11,4 +11,9 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface ICustomerPaymentService extends IService { + void up(String id); + + int findSort(String id); + + void down(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/service/impl/CustomerPaymentServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/service/impl/CustomerPaymentServiceImpl.java index 7ec889c6..58d88097 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/service/impl/CustomerPaymentServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerpayment/service/impl/CustomerPaymentServiceImpl.java @@ -3,6 +3,7 @@ package org.jeecg.modules.demo.customerpayment.service.impl; import org.jeecg.modules.demo.customerpayment.entity.CustomerPayment; import org.jeecg.modules.demo.customerpayment.mapper.CustomerPaymentMapper; import org.jeecg.modules.demo.customerpayment.service.ICustomerPaymentService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,4 +17,38 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class CustomerPaymentServiceImpl extends ServiceImpl implements ICustomerPaymentService { + @Autowired + CustomerPaymentMapper customerPaymentMapper; + + + @Override + public void up(String id) { + Integer sort = customerPaymentMapper.upfindsort(id); + if (sort>0) { + //升序前找到后一个排序 + String proid = customerPaymentMapper.findproid(sort + 1); + if (proid!="") { + //调换排序 + customerPaymentMapper.innew(id,sort+1); + customerPaymentMapper.innewpro(proid,sort); + } + } + } + + @Override + public int findSort(String id) { + return customerPaymentMapper.findSort(id); + } + + @Override + public void down(String id) { + Integer sort = customerPaymentMapper.upfindsort(id); + if (sort>0) { + String proid = customerPaymentMapper.findproid(sort - 1); + if (proid!="") { + customerPaymentMapper.innew(id,sort-1); + customerPaymentMapper.innewpro(proid,sort); + } + } + } } From 89e874e9595919f70c158c4c47a09297714fa912 Mon Sep 17 00:00:00 2001 From: wangjiadong <1654135867@qq.com> Date: Mon, 30 Jan 2023 17:33:30 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/modules/CustomerPaymentList1.vue | 264 ++++++++++++++++++ .../admin/modules/CustomerPaymentModal1.vue | 60 ++++ 2 files changed, 324 insertions(+) create mode 100644 ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentList1.vue create mode 100644 ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentModal1.vue diff --git a/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentList1.vue b/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentList1.vue new file mode 100644 index 00000000..738d4944 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentList1.vue @@ -0,0 +1,264 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentModal1.vue b/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentModal1.vue new file mode 100644 index 00000000..e64bde74 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentModal1.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file