From 4e329c4c159065c7b2430669a0622fe977fb1ce7 Mon Sep 17 00:00:00 2001 From: mors <3067699729@qq.com> Date: Fri, 2 Dec 2022 20:01:49 +0800 Subject: [PATCH] =?UTF-8?q?2022-12-02=20=E8=B5=B5=E7=8E=89=E7=91=9E=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../process/modules/ZyClothsModularForm.vue | 21 +- .../process/modules/ZyClothsTypeForm.vue | 18 +- .../views/zyclothsstyle/ZyClothsStyleList.vue | 19 +- .../modules/ZyClothsStyleForm.vue | 16 +- .../ZyStyleAccessoriesList.vue | 339 +++++++------ .../views/zystylefabric/ZyStyleFabricList.vue | 338 +++++++------ .../views/zystylemodel/ZyStyleModelList.vue | 472 +++++++++--------- .../zystylemodular/ZyStyleModularList.vue | 244 ++++++--- .../views/zystylemodule/ZyStyleModuleList.vue | 106 ++-- .../controller/ZyStyleModularController.java | 240 ++++----- .../zyStyleModular/entity/ZyStyleModular.java | 5 + .../mapper/ZyStyleModularMapper.java | 2 + .../mapper/xml/ZyStyleModularMapper.xml | 5 + .../controller/ZyClothsModularController.java | 2 + .../demo/base/entity/ZyClothsModular.java | 1 + .../base/mapper/ZyClothsModularMapper.java | 1 + .../base/mapper/xml/ZyClothsModularMapper.xml | 9 +- .../base/service/IZyClothsModularService.java | 2 + .../impl/ZyClothsModularServiceImpl.java | 35 +- .../demo/pro/entity/ZyProcessComponent.java | 4 + .../system/mapper/xml/SysLogMapper.xml | 27 +- .../system/service/impl/SysBaseApiImpl.java | 6 +- .../entity/ZyProcessModular.java | 4 + .../controller/ZyClothsStyleController.java | 14 +- .../mapper/ZyClothsStyleMapper.java | 7 +- .../mapper/xml/ZyClothsStyleMapper.xml | 8 +- .../impl/ZyClothsStyleServiceImpl.java | 38 +- 27 files changed, 1139 insertions(+), 844 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue index 6bc3aae7..09468606 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue @@ -4,10 +4,15 @@ - - + + + + + + + @@ -33,11 +38,7 @@ - - - - - + @@ -80,9 +81,9 @@ }, confirmLoading: false, validatorRules: { - nums: [ - { required: true, message: '请输入编号!'}, - ], + // nums: [ + // { required: true, message: '请输入编号!'}, + // ], modularName: [ { required: true, message: '请输入模块名称!'}, ], diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue index 0e4a62d6..2fefb067 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsTypeForm.vue @@ -3,9 +3,18 @@ + + + + + - + + {{ typeId }} @@ -25,11 +34,7 @@ <!– –> --> - - - - - + @@ -74,6 +79,7 @@ ], typeName: [ { required: true, message: '请输入类型名称!'}, + { pattern: /^[0-9A-Za-z\u4e00-\u9fa5.,;,。;、!?]{0,5}$/, message: '文本长度过长'}, ], enterpriseId: [ { required: true, message: '请输入企业!'}, diff --git a/ant-design-vue-jeecg/src/views/zyclothsstyle/ZyClothsStyleList.vue b/ant-design-vue-jeecg/src/views/zyclothsstyle/ZyClothsStyleList.vue index d0849a83..92f4745a 100644 --- a/ant-design-vue-jeecg/src/views/zyclothsstyle/ZyClothsStyleList.vue +++ b/ant-design-vue-jeecg/src/views/zyclothsstyle/ZyClothsStyleList.vue @@ -162,6 +162,7 @@ export default { return parseInt(index) + 1; } }, + { title: '款式名称', align: "center", @@ -178,11 +179,7 @@ export default { align: "center", dataIndex: 'specification' }, - { - title: '服装类型', - align: "center", - dataIndex: 'typeId_dictText' - }, + { title: '形式', align: "center", @@ -256,6 +253,7 @@ export default { query: { // 路由携带参数 'id': record.id, 'typeId': record.typeId, + 'styleNames': record.styleNames, } }); }, @@ -265,34 +263,39 @@ export default { path: '/src/views/zystylefabric/ZyStyleFabricList', query: { // 路由携带参数 'id': record.id, + 'styleNames': record.styleNames, } }); }, + //管理辅料 jumpPage3(record) { this.$router.push({ path: '/src/views/zystyleaccessories/ZyStyleAccessoriesList', query: { // 路由携带参数 'id': record.id, + 'styleNames': record.styleNames, } }); }, - //管理辅料 + //款式型号管理 jumpPage4(record) { this.$router.push({ path: '/src/views/zystylemodel/ZyStyleModelList', query: { // 路由携带参数 'id': record.id, + 'styleNames': record.styleNames, } }); }, - //管理工序 + //款式工序管理 jumpPage5(record) { this.$router.push({ //path: '/process/ZyProcessList', path: '/zystylemodular/ZyStyleModularList', query: { // 路由携带参数 'id': record.id, - } + 'styleNames': record.styleNames, + }, }); }, getSuperFieldList() { diff --git a/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue b/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue index c3421754..06fa526c 100644 --- a/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue +++ b/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue @@ -28,11 +28,11 @@ - - - - - + + + + + @@ -147,9 +147,9 @@ typeId: [ { required: true, message: '请选择服装类型!'}, ], - nums: [ - { required: true, message: '请输入编号!'}, - ], + // nums: [ + // { required: true, message: '请输入编号!'}, + // ], styleNames: [ { required: true, message: '请输入名称!'}, ], diff --git a/ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue b/ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue index 100a1fa7..c9a96b1f 100644 --- a/ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue +++ b/ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue @@ -6,16 +6,19 @@ - - + + - - + + - - + + @@ -24,6 +27,7 @@ 重置 + {{biaoTi}} @@ -34,23 +38,32 @@
新增 导出 - + 导入 - + - 删除 + + + 删除 + - 批量操作 + 批量操作 + + + 返回
@@ -73,7 +86,8 @@ \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue b/ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue index ee3f6213..fdb28f44 100644 --- a/ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue +++ b/ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue @@ -5,13 +5,15 @@ - - + + - + @@ -20,31 +22,40 @@ 重置 + {{biaoTi}}
+
新增 导出 - + - + - 删除 + + + 删除 + - 批量操作 + 批量操作 + + + 返回
@@ -67,7 +78,8 @@ @@ -134,6 +138,7 @@ export default { data() { return { description: '款式模块表管理页面', + biaoTi: '', // 表头 columns: [ { @@ -147,35 +152,37 @@ export default { } }, { - title: '款式名称', + title: '服装类型', align: "center", - dataIndex: 'styleNames' + dataIndex: 'typeName' }, { title: '款式编号', align: "center", dataIndex: 'styleNums' }, + { + title: '款式名称', + align: "center", + dataIndex: 'styleNames' + }, + /*{ title: '服装类型', align: "center", dataIndex: 'typeId' },*/ { - title: '服装类型', + title: '模块编号', align: "center", - dataIndex: 'typeName' + dataIndex: 'modularNums' }, { title: '模块名称', align: "center", dataIndex: 'modularName' }, - { - title: '模块编号', - align: "center", - dataIndex: 'modularNums' - }, + { title: '创建时间', align: "center", @@ -200,8 +207,8 @@ export default { }, //参数 - loadRouteType:false, - id:"", + loadRouteType: false, + id: "", typeId: "", dictOptions: {}, superFieldList: [], @@ -209,7 +216,7 @@ export default { }, created() { //this.getSuperFieldList(); - this.loadParameter() ; + this.loadParameter(); }, computed: { importExcelUrl: function () { @@ -217,23 +224,35 @@ export default { }, }, methods: { + fanHui() { + this.$router.push({ + path: '/src/views/zyclothsstyle/ZyClothsStyleList', + // query: { // 路由携带参数 + // 'id': record.id, + // 'typeId': record.typeId, + // } + // }); + }); + }, initDictConfig() { }, - valueChange(value){ - if (value) this.loadData() - }, + valueChange(value) { + if (value) this.loadData() + }, //加载传递参数 loadParameter() { if (this.loadRouteType === false) { this.id = this.$route.query.id; this.typeId = this.$route.query.typeId; - console.log('********id对应的为款式style_id: '+this.id); - console.log('******typeId此为类型typeId: '+this.typeId); + this.biaoTi = this.$route.query.styleNames+"款式模块管理"; + console.log('********id对应的为款式style_id: ' + this.id); + console.log('********biaoTi: ' + this.biaoTi); + console.log('******typeId此为类型typeId: ' + this.typeId); this.loadRouteType = true; } }, loadData(arg) { - if(!this.url.list){ + if (!this.url.list) { this.$message.error("请设置url.list属性!"); return } @@ -247,15 +266,14 @@ export default { getAction(this.url.list, params).then((res) => { if (res.success) { //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ - this.dataSource = res.result.records||res.result; - if(res.result.total) - { + this.dataSource = res.result.records || res.result; + if (res.result.total) { this.ipagination.total = res.result.total; - }else{ + } else { this.ipagination.total = 0; } //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ - }else{ + } else { this.$message.warning(res.message) } }).finally(() => { @@ -265,16 +283,16 @@ export default { getQueryParams() { //获取查询条件 let sqp = {} - if(this.superQueryParams){ - sqp['superQueryParams']=encodeURI(this.superQueryParams) + if (this.superQueryParams) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams) sqp['superQueryMatchType'] = this.superQueryMatchType } - var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters); + var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters); param.field = this.getQueryField(); param.pageNo = this.ipagination.current; param.pageSize = this.ipagination.pageSize; //param.id=this.id; - param.id=this.$route.query.id; + param.id = this.$route.query.id; return filterObj(param); }, getSuperFieldList() { diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/controller/ZyStyleModularController.java b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/controller/ZyStyleModularController.java index f8fac28b..9d9fa4f7 100644 --- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/controller/ZyStyleModularController.java +++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/controller/ZyStyleModularController.java @@ -7,12 +7,15 @@ import java.util.stream.Collectors; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; 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.zyStyleModular.entity.ZyStyleModular; +import org.jeecg.modules.demo.zyStyleModular.mapper.ZyStyleModularMapper; import org.jeecg.modules.demo.zyStyleModular.service.IZyStyleModularService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -36,144 +39,147 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; - /** +/** * @Description: 款式工序表 * @Author: jeecg-boot - * @Date: 2022-11-14 + * @Date: 2022-11-14 * @Version: V1.0 */ -@Api(tags="款式工序表") +@Api(tags = "款式工序表") @RestController @RequestMapping("/zyStyleModular/zyStyleModular") @Slf4j public class ZyStyleModularController extends JeecgController { - @Autowired - private IZyStyleModularService zyStyleModularService; - - /** - * 分页列表查询 - * - * @param zyStyleModular - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @AutoLog(value = "款式工序表-分页列表查询") - @ApiOperation(value="款式工序表-分页列表查询", notes="款式工序表-分页列表查询") - @GetMapping(value = "/list") - public Result queryPageList(ZyStyleModular zyStyleModular, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyStyleModular, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = zyStyleModularService.page(page, queryWrapper); - return Result.OK(pageList); - } + @Autowired + private IZyStyleModularService zyStyleModularService; + @Resource + private ZyStyleModularMapper zyStyleModularMapper; + /** + * 分页列表查询 + * + * @param zyStyleModular + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "款式工序表-分页列表查询") + @ApiOperation(value = "款式工序表-分页列表查询", notes = "款式工序表-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(ZyStyleModular zyStyleModular, String id, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyStyleModular, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyStyleModularService.page(page, queryWrapper); + List list = zyStyleModularMapper.selectListByStyleId(id); + pageList.setRecords(list); + return Result.OK(pageList); + } - /** - * 添加 - * - * @param zyStyleModular - * @return - */ - @AutoLog(value = "款式工序表-添加") - @ApiOperation(value="款式工序表-添加", notes="款式工序表-添加") - @PostMapping(value = "/add") - public Result add(@RequestBody ZyStyleModular zyStyleModular) { - String[] split = zyStyleModular.getProcessId().split(","); - QueryWrapper queryWrapper=new QueryWrapper(); - queryWrapper.eq("style_id",zyStyleModular.getStyleId()); - for (String s : split) { - zyStyleModular.setProcessId(s); - zyStyleModular.setId(null); - queryWrapper.eq("process_id",zyStyleModular.getProcessId()); - int a=zyStyleModularService.count(queryWrapper); - if(a>=1) - return Result.error("存在以添加过的数据!!!"); - zyStyleModularService.save(zyStyleModular); - } - return Result.OK("添加成功!"); - } + /** + * 添加 + * + * @param zyStyleModular + * @return + */ + @AutoLog(value = "款式工序表-添加") + @ApiOperation(value = "款式工序表-添加", notes = "款式工序表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody ZyStyleModular zyStyleModular) { + String[] split = zyStyleModular.getProcessId().split(","); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("style_id", zyStyleModular.getStyleId()); + for (String s : split) { + zyStyleModular.setProcessId(s); + zyStyleModular.setId(null); + queryWrapper.eq("process_id", zyStyleModular.getProcessId()); + int a = zyStyleModularService.count(queryWrapper); + if (a >= 1) + return Result.error("存在以添加过的数据!!!"); + zyStyleModularService.save(zyStyleModular); + } + return Result.OK("添加成功!"); + } - /** - * 编辑 - * - * @param zyStyleModular - * @return - */ - @AutoLog(value = "款式工序表-编辑") - @ApiOperation(value="款式工序表-编辑", notes="款式工序表-编辑") - @PutMapping(value = "/edit") - public Result edit(@RequestBody ZyStyleModular zyStyleModular) { - zyStyleModularService.updateById(zyStyleModular); - return Result.OK("编辑成功!"); - } + /** + * 编辑 + * + * @param zyStyleModular + * @return + */ + @AutoLog(value = "款式工序表-编辑") + @ApiOperation(value = "款式工序表-编辑", notes = "款式工序表-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody ZyStyleModular zyStyleModular) { + zyStyleModularService.updateById(zyStyleModular); + return Result.OK("编辑成功!"); + } - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "款式工序表-通过id删除") - @ApiOperation(value="款式工序表-通过id删除", notes="款式工序表-通过id删除") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - zyStyleModularService.removeById(id); - return Result.OK("删除成功!"); - } + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "款式工序表-通过id删除") + @ApiOperation(value = "款式工序表-通过id删除", notes = "款式工序表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + zyStyleModularService.removeById(id); + return Result.OK("删除成功!"); + } - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "款式工序表-批量删除") - @ApiOperation(value="款式工序表-批量删除", notes="款式工序表-批量删除") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.zyStyleModularService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "款式工序表-批量删除") + @ApiOperation(value = "款式工序表-批量删除", notes = "款式工序表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.zyStyleModularService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } - /** - * 通过id查询 - * - * @param id - * @return - */ - @AutoLog(value = "款式工序表-通过id查询") - @ApiOperation(value="款式工序表-通过id查询", notes="款式工序表-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - ZyStyleModular zyStyleModular = zyStyleModularService.getById(id); - if(zyStyleModular==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(zyStyleModular); - } + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "款式工序表-通过id查询") + @ApiOperation(value = "款式工序表-通过id查询", notes = "款式工序表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + ZyStyleModular zyStyleModular = zyStyleModularService.getById(id); + if (zyStyleModular == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyStyleModular); + } /** - * 导出excel - * - * @param request - * @param zyStyleModular - */ + * 导出excel + * + * @param request + * @param zyStyleModular + */ @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ZyStyleModular zyStyleModular) { return super.exportXls(request, zyStyleModular, ZyStyleModular.class, "款式工序表"); } /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, ZyStyleModular.class); diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java index 8818cc72..0444a4d0 100644 --- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java +++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java @@ -64,4 +64,9 @@ public class ZyStyleModular implements Serializable { @ApiModelProperty(value = "工序id") @Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id") private String processId; + + /**序号*/ + @Excel(name = "序号", width = 15,dicCode = "序号") + @ApiModelProperty(value = "序号") + private Integer order; } diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/ZyStyleModularMapper.java b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/ZyStyleModularMapper.java index fb4dc6a0..9e543fb6 100644 --- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/ZyStyleModularMapper.java +++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/ZyStyleModularMapper.java @@ -14,4 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface ZyStyleModularMapper extends BaseMapper { + List selectListByStyleId(String styleId); + } diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/xml/ZyStyleModularMapper.xml b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/xml/ZyStyleModularMapper.xml index d5e9ff86..af1d4f42 100644 --- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/xml/ZyStyleModularMapper.xml +++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/xml/ZyStyleModularMapper.xml @@ -2,4 +2,9 @@ + diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java index cb4018e2..51098213 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java @@ -103,6 +103,8 @@ public class ZyClothsModularController extends JeecgController add(@RequestBody ZyClothsModular zyClothsModular) { + //nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8) + zyClothsModular.setNums(zyClothsModularService.generateNumber(zyClothsModular)); zyClothsModularService.save(zyClothsModular); return Result.OK("添加成功!"); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsModular.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsModular.java index 09666f52..611e2375 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsModular.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsModular.java @@ -76,4 +76,5 @@ public class ZyClothsModular implements Serializable { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "updateTime") private java.util.Date updateTime; + } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularMapper.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularMapper.java index 626d703b..0eb2a68f 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularMapper.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularMapper.java @@ -15,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; public interface ZyClothsModularMapper extends BaseMapper { public List selectByType(@Param("cloths_type_id")String cloths_type_id); + List selectNumsList1(); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularMapper.xml b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularMapper.xml index 9dab77a8..7f71df05 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularMapper.xml +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularMapper.xml @@ -2,7 +2,12 @@ + diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularService.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularService.java index bf000916..5cd86ee6 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularService.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularService.java @@ -14,4 +14,6 @@ import java.util.List; public interface IZyClothsModularService extends IService { public List selectByType(String cloths_type_id); + /**nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8)*/ + String generateNumber(ZyClothsModular zyClothsModular); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java index 94c27399..e228e589 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java @@ -8,7 +8,11 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.regex.Pattern; /** * @Description: zy_cloths_modular @@ -18,7 +22,7 @@ import java.util.List; */ @Service public class ZyClothsModularServiceImpl extends ServiceImpl implements IZyClothsModularService { - @Autowired + @Resource private ZyClothsModularMapper zyClothsModularMapper; @Override @@ -26,4 +30,33 @@ public class ZyClothsModularServiceImpl extends ServiceImpl listString = zyClothsModularMapper.selectNumsList1(); + List listLong = new ArrayList<>(); + for (String nums : listString) { + String REGEX = "[^0-9]"; + String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim(); + if (newNums.length() > 8) { + String substring = nums.substring(nums.length() - 8); + listLong.add(Long.valueOf(substring)); + }else { + listLong.add(Long.valueOf(newNums)); + } + } + System.out.println(listLong); + return Collections.max(listLong)+1; + + } } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java index c73b6955..370dd852 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java @@ -49,6 +49,10 @@ public class ZyProcessComponent implements Serializable { @Dict(dicCode = "pingjing") @ApiModelProperty(value = "是否瓶颈工序") private String bottleneck; + /**序号*/ + @Excel(name = "序号", width = 15,dicCode = "序号") + @ApiModelProperty(value = "序号") + private Integer order; /**创建时间*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysLogMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysLogMapper.xml index 80eb9603..a9f38d18 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysLogMapper.xml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysLogMapper.xml @@ -6,7 +6,7 @@ DELETE FROM sys_log - + select count(1) from sys_log where log_type = 1 and create_time >= #{dayStart} and create_time < #{dayEnd} - + - + + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java index 2c4dfc7c..9153ea8e 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java @@ -50,7 +50,7 @@ import java.util.*; /** * @Description: 底层共通业务API,提供其他独立模块调用 * @Author: scott - * @Date:2019-4-20 + * @Date:2019-4-20 * @Version:V1.0 */ @Slf4j @@ -60,7 +60,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { private static String DB_TYPE = ""; @Autowired private ISysMessageTemplateService sysMessageTemplateService; - @Resource + @Autowired private SysLogMapper sysLogMapper; @Resource private SysUserMapper userMapper; @@ -1067,4 +1067,4 @@ public class SysBaseApiImpl implements ISysBaseAPI { return null; } -} \ No newline at end of file +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java index 86809eb3..57e83acc 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java @@ -62,4 +62,8 @@ public class ZyProcessModular implements Serializable { @ApiModelProperty(value = "工序ID") @Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id") private java.lang.String processId; + /**序号*/ + @Excel(name = "序号", width = 15,dicCode = "序号") + @ApiModelProperty(value = "序号") + private Integer order; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/controller/ZyClothsStyleController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/controller/ZyClothsStyleController.java index be6f9187..c7dfc33a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/controller/ZyClothsStyleController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/controller/ZyClothsStyleController.java @@ -11,6 +11,7 @@ import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.util.oConvertUtils; @@ -158,8 +159,17 @@ public class ZyClothsStyleController extends JeecgController add(@RequestBody ZyClothsStyle zyClothsStyle) { - //生成编号 类型编号(10位)+顺序号(8位)在service层处理 -// zyClothsStyle.setNums(zyClothsStyleService.generateNumber(zyClothsStyle)); + //生成编号 类型编号(10位)+顺序号(8位)在service层处理 + zyClothsStyle.setNums(zyClothsStyleService.generateNumber(zyClothsStyle)); + //同类型的款式名称不能重复 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ZyClothsStyle::getTypeName, zyClothsStyle.getTypeName()); + List zyClothsStyleList = zyClothsStyleService.list(queryWrapper); + for (ZyClothsStyle zy : zyClothsStyleList) { + if (zyClothsStyle.getStyleNames().equals(zy.getStyleNames())){ + return Result.error("添加失败!数据已存在"); + } + } zyClothsStyleService.save(zyClothsStyle); return Result.OK("添加成功!"); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/mapper/ZyClothsStyleMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/mapper/ZyClothsStyleMapper.java index 4dfe0d64..db6fc50c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/mapper/ZyClothsStyleMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/mapper/ZyClothsStyleMapper.java @@ -1,12 +1,10 @@ package org.jeecg.modules.zyclothsstyle.mapper; -import java.util.List; - -import org.apache.ibatis.annotations.Param; - import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; +import java.util.List; + /** * @Description: 服装款式表 * @Author: jeecg-boot @@ -15,4 +13,5 @@ import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; */ public interface ZyClothsStyleMapper extends BaseMapper { + List selectNumsList(); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/mapper/xml/ZyClothsStyleMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/mapper/xml/ZyClothsStyleMapper.xml index ade30c40..29a6aedc 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/mapper/xml/ZyClothsStyleMapper.xml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/mapper/xml/ZyClothsStyleMapper.xml @@ -1,5 +1,9 @@ - + - \ No newline at end of file + + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java index 4ae25cd1..2d9c44ed 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java @@ -1,22 +1,35 @@ package org.jeecg.modules.zyclothsstyle.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.bytedeco.javacpp.freenect; import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper; import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + /** * @Description: 服装款式表 * @Author: jeecg-boot - * @Date: 2022-09-04 + * @Date: 2022-09-04 * @Version: V1.0 */ @Service public class ZyClothsStyleServiceImpl extends ServiceImpl implements IZyClothsStyleService { + @Resource + private ZyClothsStyleMapper zyClothsStyleMapper; + /** * 生成编号 类型编号(10位)+顺序号(8位) * @@ -25,9 +38,26 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl zyClothsStyleList = zyClothsStyleMapper.selectNumsList(); + List list = new ArrayList<>(); + for (String nums : zyClothsStyleList) { + if (nums.length() > 8) { + String substring = nums.substring(nums.length() - 8); + list.add(Long.valueOf(substring)); + }else { + list.add(Long.valueOf(nums)); + } + } + return Collections.max(list)+1; } }