diff --git a/ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue b/ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue index 67c2036d..dd5936d8 100644 --- a/ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue +++ b/ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue @@ -13,23 +13,29 @@
新增 导出 - - - + + + - + - 删除 + + + 删除 + - 批量操作 + 批量操作 + +
- 已选择 {{ selectedRowKeys.length }}项 + 已选择 {{ selectedRowKeys.length }}清空
@@ -52,7 +58,8 @@ - - 管理 + + 管理 编辑 - + 详情 - + 删除 - + @@ -106,148 +113,148 @@ \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/process/ZyClothsModularCompentList.vue b/ant-design-vue-jeecg/src/views/process/ZyClothsModularCompentList.vue index e9c713b5..f920ec33 100644 --- a/ant-design-vue-jeecg/src/views/process/ZyClothsModularCompentList.vue +++ b/ant-design-vue-jeecg/src/views/process/ZyClothsModularCompentList.vue @@ -1,13 +1,16 @@ \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/process/ZyProcessList.vue b/ant-design-vue-jeecg/src/views/process/ZyProcessList.vue index f0269e4c..ccb9a065 100644 --- a/ant-design-vue-jeecg/src/views/process/ZyProcessList.vue +++ b/ant-design-vue-jeecg/src/views/process/ZyProcessList.vue @@ -21,9 +21,9 @@ - - - + + + diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularCompentModal.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularCompentModal.vue index 1bcc9cc8..010a3f49 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularCompentModal.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularCompentModal.vue @@ -8,28 +8,47 @@ :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @cancel="handleCancel" cancelText="关闭"> - + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/process/modules/list/ZyClothsComponentList.vue b/ant-design-vue-jeecg/src/views/process/modules/list/ZyClothsComponentList.vue new file mode 100644 index 00000000..aa25f3e1 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/process/modules/list/ZyClothsComponentList.vue @@ -0,0 +1,254 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularCompentController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularCompentController.java index dd4aca3b..0d30dce4 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularCompentController.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularCompentController.java @@ -12,14 +12,14 @@ import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.demo.base.entity.ZyClothsComponent; import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; -import org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper; +import org.jeecg.modules.demo.base.mapper.ZyClothsModularCompentMapper; import org.jeecg.modules.demo.base.service.IZyClothsComponentService; import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.NumberUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; @@ -41,7 +41,10 @@ public class ZyClothsModularCompentController extends JeecgController queryPageList(ZyClothsModularCompent zyClothsModularCompent, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + String modularId, HttpServletRequest req) { + System.out.println("接受到的modularId: "+modularId); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModularCompent, req.getParameterMap()); + queryWrapper.eq("modular_id", modularId); Page page = new Page(pageNo, pageSize); IPage pageList = zyClothsModularCompentService.page(page, queryWrapper); + List recordList = zyClothsModularCompentMapper.queryList(modularId); + pageList.setRecords(recordList); List records = pageList.getRecords(); - Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?"); + //Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?"); + //只要数字 如果是纯数字 就把它替换了 + Pattern pattern = Pattern.compile("[^0-9]"); for (ZyClothsModularCompent s : records) { String partsName = s.getPartsName(); - if (pattern.matcher(partsName).matches()){ + if (pattern.matcher(partsName).matches()) { ZyClothsComponent byId = zyClothsComponentService.getById(partsName); - s.setPartsName(byId.getPartsName()) ; + s.setPartsName(byId.getPartsName()); } } @@ -85,7 +95,21 @@ public class ZyClothsModularCompentController extends JeecgController add(@RequestBody ZyClothsModularCompent zyClothsModularCompent) { - zyClothsModularCompentService.save(zyClothsModularCompent); + System.out.println(zyClothsModularCompent); + String[] split = zyClothsModularCompent.getComponentId().split(","); + for (String componentId : split) { + //把部件信息查出来 赋给模块部件表 + //System.out.println("+++部件id: "+componentId); + //看是否有重复信息 + int a = zyClothsModularCompentMapper.count(zyClothsModularCompent.getModularId(),componentId); + if (a >= 1){ + return Result.error("添加失败,存在该款式部件"); + } + ZyClothsModularCompent zy = zyClothsModularCompentService.handleComponent(componentId); + zy.setModularId(zyClothsModularCompent.getModularId()); + zyClothsModularCompentService.save(zy); + } + return Result.OK("添加成功!"); } 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 bcec6b5d..0ac4293f 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 @@ -1,199 +1,201 @@ package org.jeecg.modules.demo.base.controller; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; -import org.jeecg.modules.demo.base.entity.ZyClothsComponent; import org.jeecg.modules.demo.base.entity.ZyClothsModular; import org.jeecg.modules.demo.base.entity.ZyClothsType; import org.jeecg.modules.demo.base.service.IZyClothsModularService; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - import org.jeecg.modules.demo.base.service.IZyClothsTypeService; -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.jeecg.common.system.base.controller.JeecgController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; - /** +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + +/** * @Description: zy_cloths_modular * @Author: jeecg-boot - * @Date: 2021-11-10 + * @Date: 2021-11-10 * @Version: V1.0 */ -@Api(tags="zy_cloths_modular") +@Api(tags = "zy_cloths_modular") @RestController @RequestMapping("/base/zyClothsModular") @Slf4j public class ZyClothsModularController extends JeecgController { - @Autowired - private IZyClothsModularService zyClothsModularService; - @Autowired - private IZyClothsTypeService zyClothsTypeService; - - - /** - * 分页列表查询 - * - * @param zyClothsModular - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @AutoLog(value = "zy_cloths_modular-分页列表查询") - @ApiOperation(value="zy_cloths_modular-分页列表查询", notes="zy_cloths_modular-分页列表查询") - @GetMapping(value = "/list") - public Result queryPageList(ZyClothsModular zyClothsModular, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModular, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = zyClothsModularService.page(page, queryWrapper); - return Result.OK(pageList); - } - - @AutoLog(value = "zy_cloths_modular-查询所有") - @ApiOperation(value="zy_cloths_modular-查询所有", notes="zy_cloths_modular-查询所有") - @GetMapping(value = "/findAll") - public Result findAll() { - List list = zyClothsModularService.list(); - for(ZyClothsModular zycl : list){ - String id = zycl.getClothsTypeId(); - if(id!=null){ - ZyClothsType byId = zyClothsTypeService.getById(id); - zycl.setClothsTypeId(byId.getTypeName()); - } - - } - return Result.OK(list); - } - - /** - * 添加 - * - * @param zyClothsModular - * @return - */ - @AutoLog(value = "zy_cloths_modular-添加") - @ApiOperation(value="zy_cloths_modular-添加", notes="zy_cloths_modular-添加") - @PostMapping(value = "/add") - public Result add(@RequestBody ZyClothsModular zyClothsModular) { - //nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8) - zyClothsModular.setNums(zyClothsModularService.generateNumber(zyClothsModular)); - //模块名称不能重复 - List zyClothsModularList = zyClothsModularService.list(); - for (ZyClothsModular zy : zyClothsModularList) { - if (zyClothsModular.getModularName().equals(zy.getModularName())){ - return Result.error("添加失败!模块名称已存在"); - } - } - zyClothsModularService.save(zyClothsModular); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param zyClothsModular - * @return - */ - @AutoLog(value = "zy_cloths_modular-编辑") - @ApiOperation(value="zy_cloths_modular-编辑", notes="zy_cloths_modular-编辑") - @PutMapping(value = "/edit") - public Result edit(@RequestBody ZyClothsModular zyClothsModular) { - zyClothsModularService.updateById(zyClothsModular); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "zy_cloths_modular-通过id删除") - @ApiOperation(value="zy_cloths_modular-通过id删除", notes="zy_cloths_modular-通过id删除") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - zyClothsModularService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "zy_cloths_modular-批量删除") - @ApiOperation(value="zy_cloths_modular-批量删除", notes="zy_cloths_modular-批量删除") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.zyClothsModularService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - @AutoLog(value = "zy_cloths_modular-通过id查询") - @ApiOperation(value="zy_cloths_modular-通过id查询", notes="zy_cloths_modular-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - ZyClothsModular zyClothsModular = zyClothsModularService.getById(id); - if(zyClothsModular==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(zyClothsModular); - } + @Autowired + private IZyClothsModularService zyClothsModularService; + @Autowired + private IZyClothsTypeService zyClothsTypeService; + + + /** + * 分页列表查询 + * + * @param zyClothsModular + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "zy_cloths_modular-分页列表查询") + @ApiOperation(value = "zy_cloths_modular-分页列表查询", notes = "zy_cloths_modular-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(ZyClothsModular zyClothsModular, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModular, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyClothsModularService.page(page, queryWrapper); + return Result.OK(pageList); + } + + @AutoLog(value = "zy_cloths_modular-查询所有") + @ApiOperation(value = "zy_cloths_modular-查询所有", notes = "zy_cloths_modular-查询所有") + @GetMapping(value = "/findAll") + public Result findAll() { + List list = zyClothsModularService.list(); + for (ZyClothsModular zycl : list) { + String id = zycl.getClothsTypeId(); + if (id != null) { + ZyClothsType byId = zyClothsTypeService.getById(id); + zycl.setClothsTypeId(byId.getTypeName()); + } + + } + return Result.OK(list); + } + + /** + * 添加 + * + * @param zyClothsModular + * @return + */ + @AutoLog(value = "zy_cloths_modular-添加") + @ApiOperation(value = "zy_cloths_modular-添加", notes = "zy_cloths_modular-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody ZyClothsModular zyClothsModular) { + //zyClothsModular.setNums(zyClothsModularService.generateNumber(zyClothsModular)); + //模块名称不能重复 + List zyClothsModularList = zyClothsModularService.list(); + for (ZyClothsModular zy : zyClothsModularList) { + if (zyClothsModular.getModularName().equals(zy.getModularName())) { + return Result.error("添加失败!模块名称已存在"); + } + } + zyClothsModularService.save(zyClothsModular); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param zyClothsModular + * @return + */ + @AutoLog(value = "zy_cloths_modular-编辑") + @ApiOperation(value = "zy_cloths_modular-编辑", notes = "zy_cloths_modular-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody ZyClothsModular zyClothsModular) { + zyClothsModularService.updateById(zyClothsModular); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "zy_cloths_modular-通过id删除") + @ApiOperation(value = "zy_cloths_modular-通过id删除", notes = "zy_cloths_modular-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + zyClothsModularService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "zy_cloths_modular-批量删除") + @ApiOperation(value = "zy_cloths_modular-批量删除", notes = "zy_cloths_modular-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.zyClothsModularService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "zy_cloths_modular-通过id查询") + @ApiOperation(value = "zy_cloths_modular-通过id查询", notes = "zy_cloths_modular-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + ZyClothsModular zyClothsModular = zyClothsModularService.getById(id); + if (zyClothsModular == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyClothsModular); + } + + /** + * sort 编码 + * + * @param id 服装类型的id + * @return + */ + @AutoLog(value = "编码-通过id查询") + @ApiOperation(value = "编码-通过id查询", notes = "编码-通过id查询") + @GetMapping(value = "/sort") + public Result sort(@RequestParam(name = "id", required = true) String id) { + //根据zy cloths type服装类型的id 进行自动编码 + //nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8) + String clothsTypeNums = zyClothsModularService.generateNumber(id); + if (clothsTypeNums == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(clothsTypeNums); + } /** - * 导出excel - * - * @param request - * @param zyClothsModular - */ + * 导出excel + * + * @param request + * @param zyClothsModular + */ @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ZyClothsModular zyClothsModular) { return super.exportXls(request, zyClothsModular, ZyClothsModular.class, "zy_cloths_modular"); } /** - * 通过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, ZyClothsModular.class); diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java index c65c3a5d..df976a6b 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java @@ -24,4 +24,6 @@ public interface ZyClothsComponentMapper extends BaseMapper { String getComponentNameById(String componentId); List selectNumsList2(); + + ZyClothsComponent queryById(String componentId); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularCompentMapper.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularCompentMapper.java index 0dc4786e..2c17827b 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularCompentMapper.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularCompentMapper.java @@ -3,15 +3,21 @@ package org.jeecg.modules.demo.base.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 制衣模块部件中间表 * @Author: jeecg-boot - * @Date: 2022-11-11 + * @Date: 2022-11-11 * @Version: V1.0 */ public interface ZyClothsModularCompentMapper extends BaseMapper { + @Select("select count(*) from zy_cloths_modular_compent where modular_id = #{ModularId} and component_id=#{componentId}") + int count(@Param("ModularId")String ModularId, @Param("componentId")String componentId); + + //根据modularId查询 + List queryList(String modularId); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java index 1f52237a..ddf5b592 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java @@ -27,4 +27,7 @@ public interface ZyClothsTypeMapper extends BaseMapper { void setEnterpriseId(String id); + + @Select("select nums from zy_cloths_type where id = #{id} ") + String selectNumOne(String id); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml index bf05980e..47fe55e1 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml @@ -33,4 +33,9 @@ select nums from zy_cloths_component + diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularCompentMapper.xml b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularCompentMapper.xml index a753adb6..f8596c2f 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularCompentMapper.xml +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularCompentMapper.xml @@ -2,4 +2,9 @@ + diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularCompentService.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularCompentService.java index 297e0283..41b1dae0 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularCompentService.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularCompentService.java @@ -11,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IZyClothsModularCompentService extends IService { + /**把部件信息查出来 赋给模块部件表*/ + ZyClothsModularCompent handleComponent(String componentId); } 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 5cd86ee6..2ce35e4c 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 @@ -15,5 +15,5 @@ public interface IZyClothsModularService extends IService { public List selectByType(String cloths_type_id); /**nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8)*/ - String generateNumber(ZyClothsModular zyClothsModular); + String generateNumber(String id); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularCompentServiceImpl.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularCompentServiceImpl.java index 33d4caaf..45dae427 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularCompentServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularCompentServiceImpl.java @@ -1,12 +1,17 @@ package org.jeecg.modules.demo.base.service.impl; +import org.jeecg.modules.demo.base.entity.ZyClothsComponent; import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; +import org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsModularCompentMapper; import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import javax.annotation.Resource; + /** * @Description: 制衣模块部件中间表 * @Author: jeecg-boot @@ -16,4 +21,20 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ZyClothsModularCompentServiceImpl extends ServiceImpl implements IZyClothsModularCompentService { + @Resource + private ZyClothsComponentMapper zyClothsComponentMapper; + /** + * 把部件信息查出来 赋给模块部件表 + * @param componentId 部件id + */ + @Override + public ZyClothsModularCompent handleComponent(String componentId) { + System.out.println("service层的id:"+componentId); + ZyClothsComponent zyClothsComponent = zyClothsComponentMapper.queryById(componentId); + ZyClothsModularCompent zy = new ZyClothsModularCompent(); + zy.setPartsName(zyClothsComponent.getPartsName()); + zy.setNums(zyClothsComponent.getNums()); + zy.setComponentId(componentId); + return zy; + } } 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 00d1ceee..a77f3d74 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 @@ -39,13 +39,11 @@ public class ZyClothsModularServiceImpl extends ServiceImpl 8) { String substring = nums.substring(nums.length() - 8); listLong.add(Long.valueOf(substring)); + continue; } if (StringUtils.isEmpty(newNums)) { newNums = "0";