diff --git a/ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue b/ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue index 56681973..168a5ff7 100644 --- a/ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue +++ b/ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue @@ -270,7 +270,7 @@ export default { viewVid(record) { this.$refs.ZyClothsModularCompentList.showModal1(); this.$refs.ZyClothsModularCompentList.edit1(record); - console.log("zyclothsMclist" + record.id); + console.log("制衣模块传给模块部件的id zyclothsMclist" + record.id); this.$refs.ZyClothsModularCompentList.disableSubmit = false; }, viewVid2(record) { diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentListDetail.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentListDetail.vue index a10bb3fd..f81c86f2 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentListDetail.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentListDetail.vue @@ -93,8 +93,23 @@ showModal(record) { this.visible = true; this.model = record + this.$http.get('/base/zyClothsComponent/detail?id='+record.id).then( + res=>{ + // this.data = res.result + // this.ProcessData = res.result.zyProcess + // this.basicActionData = res.result.zyClothActions + // this.accessoriesData = res.result.zyFabrics + // this.fabricData = res.result.zyAccessories + console.log('工序详情页') + console.log(this.data) + console.log(this.accessoriesData) + console.log(this.fabricData) + this.img = "http://10.100.200.112/jeecg-boot/sys/common/static/"+this.data.image; + this.mp4 = "http://10.100.200.112/jeecg-boot/sys/common/static/"+this.data.vedio; + } + ) console.log('record') - console.log(record) + console.log(record.id) }, handleOk(e) { this.confirmLoading = true; diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularListDetail.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularListDetail.vue index 552150a1..e552f023 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularListDetail.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularListDetail.vue @@ -146,8 +146,24 @@ showModal(record) { this.visible = true; this.model = record - console.log('record') - console.log(record) + this.$http.get('/base/zyClothsModular/detail?id='+record.id).then( + res=>{ + // this.data = res.result + // this.ProcessData = res.result.zyProcess + // this.basicActionData = res.result.zyClothActions + // this.accessoriesData = res.result.zyFabrics + // this.fabricData = res.result.zyAccessories + console.log('工序详情页') + console.log(this.data) + console.log(this.accessoriesData) + console.log(this.fabricData) + this.img = "http://10.100.200.112/jeecg-boot/sys/common/static/"+this.data.image; + this.mp4 = "http://10.100.200.112/jeecg-boot/sys/common/static/"+this.data.vedio; + } + ) + + console.log('制衣模块 record id') + console.log(record.id) }, handleOk(e) { this.confirmLoading = true; diff --git a/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleListDetail.vue b/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleListDetail.vue index f8993e6b..13069f62 100644 --- a/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleListDetail.vue +++ b/ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleListDetail.vue @@ -440,7 +440,12 @@ showModal(record) { this.visible = true; this.model = record - console.log('this.model') + this.$http.get('/zyclothsstyle/zyClothsStyle/detail?id='+record.id).then( + res=>{ + + } + ) + console.log('this.model'+record.id) console.log(this.model) }, handleOk(e) { diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/service/IZyStyleModularService.java b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/service/IZyStyleModularService.java index 0eff4298..7456bed3 100644 --- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/service/IZyStyleModularService.java +++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/service/IZyStyleModularService.java @@ -3,6 +3,8 @@ package org.jeecg.modules.demo.zyStyleModular.service; import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: 款式工序表 * @Author: jeecg-boot @@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IZyStyleModularService extends IService { + List detail(String id); } diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/service/impl/ZyStyleModularServiceImpl.java b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/service/impl/ZyStyleModularServiceImpl.java index 272cfaea..ad3d6e47 100644 --- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/service/impl/ZyStyleModularServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/service/impl/ZyStyleModularServiceImpl.java @@ -7,6 +7,9 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import javax.annotation.Resource; +import java.util.List; + /** * @Description: 款式工序表 * @Author: jeecg-boot @@ -16,4 +19,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ZyStyleModularServiceImpl extends ServiceImpl implements IZyStyleModularService { + @Resource + private ZyStyleModularMapper zyStyleModularMapper; + + @Override + public List detail(String id) { + List list = zyStyleModularMapper.selectListByStyleId(id); + return list; + } } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java index 8b9950ba..82e3f9cd 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java @@ -12,6 +12,8 @@ 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.modules.demo.base.entity.ZyClothsComponent; +import org.jeecg.modules.demo.base.entity.vo.ZyClothsComponentDetail; +import org.jeecg.modules.demo.base.entity.vo.ZyClothsModularDetail; import org.jeecg.modules.demo.base.entity.vo.ZyProcessVo; import org.jeecg.modules.demo.base.service.IZyClothsComponentService; import org.jeecg.modules.demo.base.service.IZyClothsModularService; @@ -79,6 +81,20 @@ public class ZyClothsComponentController extends JeecgController detail(@RequestParam(name = "id", required = true) String id) { + System.out.println("controller层接受到的id:zy_cloths_component对象 Id: "+id); + ZyClothsComponentDetail detail = zyClothsComponentService.queryDetail(id); + return Result.OK(detail); + } + + /** * 添加 * 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 0ac4293f..4c27a837 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 @@ -12,6 +12,7 @@ import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.demo.base.entity.ZyClothsModular; import org.jeecg.modules.demo.base.entity.ZyClothsType; +import org.jeecg.modules.demo.base.entity.vo.ZyClothsModularDetail; import org.jeecg.modules.demo.base.service.IZyClothsModularService; import org.jeecg.modules.demo.base.service.IZyClothsTypeService; import org.springframework.beans.factory.annotation.Autowired; @@ -78,6 +79,19 @@ public class ZyClothsModularController extends JeecgController detail(@RequestParam(name = "id", required = true) String id) { + System.out.println("controller层接受到的id: zy_cloths_modularId: "+id); + ZyClothsModularDetail detail = zyClothsModularService.queryDetail(id); + return Result.OK(detail); + } + /** * 添加 * diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java index 30be0019..ce9481c0 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java @@ -4,6 +4,7 @@ import java.util.Arrays; import java.util.List; 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.modules.demo.accessories.entity.ZyAccessories; @@ -33,180 +34,182 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; - /** +/** * @Description: zy_process * @Author: jeecg-boot - * @Date: 2021-11-03 + * @Date: 2021-11-03 * @Version: V1.0 */ -@Api(tags="zy_process") +@Api(tags = "zy_process") @RestController @RequestMapping("/base/zyProcess") @Slf4j public class ZyProcessController extends JeecgController { - @Autowired - private IZyProcessService zyProcessService; - @Autowired - IZyProcessAccessoriesService zyProcessAccessoriesService; - @Autowired - IZyProcessActionService zyProcessActionService; - @Autowired - IZyProcessFabricService zyProcessFabricService; - @Autowired - private IZyDevicetypeService1 zyDevicetypeService; - @Autowired - private IZyToolTypesService zyToolTypesService; - /** - * 分页列表查询 - * - * @param zyProcess - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @AutoLog(value = "zy_process-分页列表查询") - @ApiOperation(value="zy_process-分页列表查询", notes="zy_process-分页列表查询") - @GetMapping(value = "/list") - public Result queryPageList(ZyProcess zyProcess, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyProcess, req.getParameterMap()); - //QueryWrapper queryWrapper = new QueryWrapper(); - Page page = new Page(pageNo, pageSize); - IPage pageList = zyProcessService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param zyProcess - * @return - */ - @AutoLog(value = "zy_process-添加") - @ApiOperation(value="zy_process-添加", notes="zy_process-添加") - @PostMapping(value = "/add") - public Result add(@RequestBody ZyProcess zyProcess) { - zyProcess.setCreateTime(null); - QueryWrapper queryWrapper=new QueryWrapper(); - queryWrapper.eq("process_name",zyProcess.getProcessName()); - int a=zyProcessService.count(queryWrapper); - if(a!=0) - return Result.error("添加失败,该工序名称已存在!!!"); - zyProcessService.save(zyProcess); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param zyProcess - * @return - */ - @AutoLog(value = "zy_process-编辑") - @ApiOperation(value="zy_process-编辑", notes="zy_process-编辑") - @PutMapping(value = "/edit") - public Result edit(@RequestBody ZyProcess zyProcess) { - QueryWrapper queryWrapper=new QueryWrapper(); - queryWrapper.eq("process_name",zyProcess.getProcessName()); - int a=zyProcessService.count(queryWrapper); - if(a!=0) - return Result.error("编辑失败,该工序名称已存在!!!"); - zyProcessService.updateById(zyProcess); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "zy_process-通过id删除") - @ApiOperation(value="zy_process-通过id删除", notes="zy_process-通过id删除") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - zyProcessService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "zy_process-批量删除") - @ApiOperation(value="zy_process-批量删除", notes="zy_process-批量删除") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.zyProcessService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - @AutoLog(value = "zy_process-通过id查询") - @ApiOperation(value="zy_process-通过id查询", notes="zy_process-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - ZyProcess zyProcess=zyProcessService.selectZyprocess(id); - List pageList=zyProcessAccessoriesService.selectByid(id); - List pageList1=zyProcessActionService.selectByid(id); - List pageList2=zyProcessFabricService.selectByid(id); - List pageList3=zyDevicetypeService.selectByid(id); - List pageList4=zyToolTypesService.selectByid(id); - ZyAllProcess zyAllProcess=new ZyAllProcess(); - zyAllProcess.setZyProcess(zyProcess); - zyAllProcess.setZyClothActions(pageList1); - zyAllProcess.setZyAccessories(pageList); - zyAllProcess.setZyFabrics(pageList2); - zyAllProcess.setZyDevicetypes(pageList3); - zyAllProcess.setZyToolTypes(pageList4); - - if(zyAllProcess==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(zyAllProcess); - } + @Autowired + private IZyProcessService zyProcessService; + @Autowired + IZyProcessAccessoriesService zyProcessAccessoriesService; + @Autowired + IZyProcessActionService zyProcessActionService; + @Autowired + IZyProcessFabricService zyProcessFabricService; + @Autowired + private IZyDevicetypeService1 zyDevicetypeService; + @Autowired + private IZyToolTypesService zyToolTypesService; + + /** + * 分页列表查询 + * + * @param zyProcess + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "zy_process-分页列表查询") + @ApiOperation(value = "zy_process-分页列表查询", notes = "zy_process-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(ZyProcess zyProcess, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyProcess, req.getParameterMap()); + //QueryWrapper queryWrapper = new QueryWrapper(); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyProcessService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param zyProcess + * @return + */ + @AutoLog(value = "zy_process-添加") + @ApiOperation(value = "zy_process-添加", notes = "zy_process-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody ZyProcess zyProcess) { + zyProcess.setCreateTime(null); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("process_name", zyProcess.getProcessName()); + int a = zyProcessService.count(queryWrapper); + if (a != 0) + return Result.error("添加失败,该工序名称已存在!!!"); + zyProcessService.save(zyProcess); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param zyProcess + * @return + */ + @AutoLog(value = "zy_process-编辑") + @ApiOperation(value = "zy_process-编辑", notes = "zy_process-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody ZyProcess zyProcess) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("process_name", zyProcess.getProcessName()); + int a = zyProcessService.count(queryWrapper); + if (a != 0) + return Result.error("编辑失败,该工序名称已存在!!!"); + zyProcessService.updateById(zyProcess); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "zy_process-通过id删除") + @ApiOperation(value = "zy_process-通过id删除", notes = "zy_process-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + zyProcessService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "zy_process-批量删除") + @ApiOperation(value = "zy_process-批量删除", notes = "zy_process-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.zyProcessService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } /** - * 导出excel - * - * @param request - * @param zyProcess - */ + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "zy_process-通过id查询") + @ApiOperation(value = "zy_process-通过id查询", notes = "zy_process-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + ZyProcess zyProcess = zyProcessService.selectZyprocess(id); + List pageList = zyProcessAccessoriesService.selectByid(id); + List pageList1 = zyProcessActionService.selectByid(id); + List pageList2 = zyProcessFabricService.selectByid(id); + List pageList3 = zyDevicetypeService.selectByid(id); + List pageList4 = zyToolTypesService.selectByid(id); + ZyAllProcess zyAllProcess = new ZyAllProcess(); + zyAllProcess.setZyProcess(zyProcess); + zyAllProcess.setZyClothActions(pageList1); + zyAllProcess.setZyAccessories(pageList); + zyAllProcess.setZyFabrics(pageList2); + zyAllProcess.setZyDevicetypes(pageList3); + zyAllProcess.setZyToolTypes(pageList4); + + if (zyAllProcess == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyAllProcess); + } + + /** + * 导出excel + * + * @param request + * @param zyProcess + */ @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ZyProcess zyProcess) { return super.exportXls(request, zyProcess, ZyProcess.class, "zy_process"); } /** - * 通过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, ZyProcess.class); } - @AutoLog(value = "zy_process-顺序查询") - @ApiOperation(value="zy_process-顺序查询", notes="zy_process-顺序查询") - @GetMapping(value = "/sort") - public Result sort(@RequestParam(name="id",required=true) String id) { - String sort=zyProcessService.sort(id); - if(sort==null){ - return Result.ok(0); - } - return Result.OK(sort.substring(10,sort.length())); - } + + @AutoLog(value = "zy_process-顺序查询") + @ApiOperation(value = "zy_process-顺序查询", notes = "zy_process-顺序查询") + @GetMapping(value = "/sort") + public Result sort(@RequestParam(name = "id", required = true) String id) { + String sort = zyProcessService.sort(id); + if (sort == null) { + return Result.ok(0); + } + return Result.OK(sort.substring(10, sort.length())); + } } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/vo/ZyClothsComponentDetail.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/vo/ZyClothsComponentDetail.java new file mode 100644 index 00000000..bc595942 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/vo/ZyClothsComponentDetail.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.demo.base.entity.vo; + +import lombok.Data; +import org.jeecg.modules.demo.base.entity.ZyClothsComponent; +import org.jeecg.modules.demo.pro.entity.ZyProcessComponent; + +import java.util.List; + +@Data +public class ZyClothsComponentDetail { + /**制衣部件 详情*/ + private ZyClothsComponent zyClothsComponent; + /**部件工序 详情*/ + private List zyProcessComponents; +} diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/vo/ZyClothsModularDetail.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/vo/ZyClothsModularDetail.java new file mode 100644 index 00000000..ef4d0879 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/vo/ZyClothsModularDetail.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.base.entity.vo; + + +import lombok.Data; +import org.jeecg.modules.demo.base.entity.ZyClothsModular; +import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; + +import java.util.List; + +@Data +public class ZyClothsModularDetail { + /**制衣模块*/ + private ZyClothsModular zyClothsModular; + /**模块部件*/ + private List zyClothsModularComponents; + /**模块工序*/ + private List zyProcessModularVos; + +} diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/vo/ZyProcessModularVo.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/vo/ZyProcessModularVo.java new file mode 100644 index 00000000..c8990cca --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/vo/ZyProcessModularVo.java @@ -0,0 +1,80 @@ +package org.jeecg.modules.demo.base.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.jeecg.common.aspect.annotation.Dict; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + +/** + * 不知道什么原因 在base模块中无法调用ZyProcessModular实体类 + * 因此创建这个类来接受数据 + * @Description: 模块工序表 + */ +@Data +@TableName("zy_process_modular") +public class ZyProcessModularVo implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /** + * 创建日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /** + * 更新日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /** + * 所属部门 + */ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /** + * 模块ID + */ + + @ApiModelProperty(value = "模块ID") + //@Dict(dictTable = "zy_cloths_modular", dicText = "modular_name", dicCode = "id") + private java.lang.String modularId; + /** + * 工序ID + */ + + @ApiModelProperty(value = "工序ID") + //@Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id") + private java.lang.String processId; + /** + * 序号 + */ + @ApiModelProperty(value = "序号") + private Integer serialnumber; +} + + 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 0eb2a68f..de9d3022 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 @@ -5,6 +5,7 @@ import java.util.List; import org.apache.ibatis.annotations.Param; import org.jeecg.modules.demo.base.entity.ZyClothsModular; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.demo.base.entity.vo.ZyProcessModularVo; /** * @Description: zy_cloths_modular @@ -16,4 +17,14 @@ public interface ZyClothsModularMapper extends BaseMapper { public List selectByType(@Param("cloths_type_id")String cloths_type_id); List selectNumsList1(); + + /**根据cloth_type_id查服装类型名称*/ + String getTypeNameById(String clothsTypeId); + + /**根据ZyClothsModular的id查询 模块工序 list信息*/ + List queryProcessModularList(String id); + + String getModularNameByModularId(String modularId); + + String getProcessNameByProcessId(String processId); } 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 ddf5b592..8087e4bf 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 @@ -21,8 +21,10 @@ public interface ZyClothsTypeMapper extends BaseMapper { @Select("select nums from zy_cloths_type where nums like 'QIYE%' order by nums desc limit 0,1 ") String sort(); + /**根据部门id拿到部门名称*/ String getEnterprisenameById(String enterpriseId); + /**根据部门名称拿到部门id*/ String getEnterpriseName(String enterpriseName); 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 7f71df05..eb783149 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 @@ -10,4 +10,24 @@ select nums from zy_cloths_modular + + + + diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java index d5a0ea36..934479d8 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java @@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Param; import org.jeecg.modules.demo.base.entity.ZyClothsComponent; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.demo.base.entity.ZyClothsModular; +import org.jeecg.modules.demo.base.entity.vo.ZyClothsComponentDetail; import org.jeecg.modules.demo.base.entity.vo.ZyProcessVo; import java.util.List; @@ -21,4 +22,6 @@ public interface IZyClothsComponentService extends IService { /**编码规则:服装类型(10)+序号(8)*/ String generateNumber(ZyClothsComponent zyClothsComponent); + + ZyClothsComponentDetail queryDetail(String id); } 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 41b1dae0..1073012c 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 @@ -3,6 +3,8 @@ package org.jeecg.modules.demo.base.service; import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: 制衣模块部件中间表 * @Author: jeecg-boot @@ -13,4 +15,6 @@ public interface IZyClothsModularCompentService extends IService detail(String id); } 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 2ce35e4c..bc02b072 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 @@ -2,6 +2,7 @@ package org.jeecg.modules.demo.base.service; import org.jeecg.modules.demo.base.entity.ZyClothsModular; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.demo.base.entity.vo.ZyClothsModularDetail; import java.util.List; @@ -16,4 +17,10 @@ public interface IZyClothsModularService extends IService { /**nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8)*/ String generateNumber(String id); + + /** + * 制衣模块详情 + * @param id 根据服装款式id进行查询 + */ + ZyClothsModularDetail queryDetail(String id); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java index 690a7d75..2f8794bf 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java @@ -1,17 +1,19 @@ package org.jeecg.modules.demo.base.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.entity.vo.ZyClothsComponentDetail; import org.jeecg.modules.demo.base.entity.vo.ZyProcessVo; import org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsModularMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper; import org.jeecg.modules.demo.base.service.IZyClothsComponentService; +import org.jeecg.modules.demo.pro.entity.ZyProcessComponent; +import org.jeecg.modules.demo.pro.service.IZyProcessComponentService; +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 org.springframework.util.StringUtils; import javax.annotation.Resource; @@ -23,20 +25,26 @@ import java.util.regex.Pattern; /** * @Description: zy_cloths_component * @Author: jeecg-boot - * @Date: 2021-11-10 + * @Date: 2021-11-10 * @Version: V1.0 */ @Service public class ZyClothsComponentServiceImpl extends ServiceImpl implements IZyClothsComponentService { + + @Autowired + private IZyProcessComponentService zyProcessComponentService; + @Resource private ZyClothsComponentMapper zyClothsComponentMapper; @Resource - ZyClothsTypeMapper zyClothsTypeMapper; + private ZyClothsModularMapper zyClothsModularMapper; + @Resource + private ZyClothsTypeMapper zyClothsTypeMapper; @Override public List selectList(String id) { - List list=baseMapper.selectlistid(id); - List zyProcessVoList=baseMapper.selectProcessVo(list); + List list = baseMapper.selectlistid(id); + List zyProcessVoList = baseMapper.selectProcessVo(list); return zyProcessVoList; } @@ -58,24 +66,71 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl zyProcessComponents = zyProcessComponentService.detail(id); + detail.setZyProcessComponents(zyProcessComponents); + + return detail; + } + + public ZyClothsComponent zyClothsComponentDetail(String id) { + ZyClothsComponent zyClothsComponent = zyClothsComponentMapper.selectById(id); + //翻译 + String clothsTypeId = zyClothsComponent.getClothsTypeId(); + if (StringUtils.hasText(clothsTypeId)) { + String typeNameById = zyClothsModularMapper.getTypeNameById(clothsTypeId); + if (StringUtils.hasText(typeNameById)){ + zyClothsComponent.setClothsTypeId(typeNameById); + } + } + String name = containChinese(zyClothsComponent.getEnterpriseId()); + zyClothsComponent.setEnterpriseId(name); + return zyClothsComponent; + + } + + //判断字符串中有没有汉字 这个方法的作用就是如果是汉字或者空就直接返回true + //如果是一些编码 那就根据编码查到对应的名字并返回 + //汉字:[19968,40869] + public String containChinese(String str) { + if (StringUtils.isEmpty(str)){ + return str; + } + for (int i = 0; i < str.length(); i++) { + int n = (int) str.charAt(i); + if (19968 <= n && n <= 40869) { + return str; + } + } + return zyClothsTypeMapper.getEnterprisenameById(str); + } + + + public Long orderNumber() { List listString = zyClothsComponentMapper.selectNumsList2(); //System.err.println(listString); List listLong = new ArrayList<>(); for (String nums : listString) { String REGEX = "[^0-9]"; String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim(); - if (!StringUtils.hasText(newNums)){ + if (!StringUtils.hasText(newNums)) { newNums = "0"; } if (newNums.length() > 8) { String substring = nums.substring(nums.length() - 8); listLong.add(Long.valueOf(substring)); - }else { + } else { listLong.add(Long.valueOf(newNums)); } } System.out.println(listLong); - return Collections.max(listLong)+1; + return Collections.max(listLong) + 1; } } 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 45dae427..9ee182a5 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 @@ -4,6 +4,7 @@ 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.stereotype.Service; @@ -11,6 +12,8 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import javax.annotation.Resource; +import java.util.List; +import java.util.regex.Pattern; /** * @Description: 制衣模块部件中间表 @@ -21,8 +24,13 @@ import javax.annotation.Resource; @Service public class ZyClothsModularCompentServiceImpl extends ServiceImpl implements IZyClothsModularCompentService { + @Autowired + private IZyClothsComponentService zyClothsComponentService; + @Resource private ZyClothsComponentMapper zyClothsComponentMapper; + @Resource + private ZyClothsModularCompentMapper zyClothsModularCompentMapper; /** * 把部件信息查出来 赋给模块部件表 * @param componentId 部件id @@ -37,4 +45,19 @@ public class ZyClothsModularCompentServiceImpl extends ServiceImpl detail(String id) { + List zyClothsModularComponents = zyClothsModularCompentMapper.queryList(id); + //只要数字 如果是纯数字 就把它替换了 + Pattern pattern = Pattern.compile("[^0-9]"); + for (ZyClothsModularCompent s : zyClothsModularComponents) { + String partsName = s.getPartsName(); + if (pattern.matcher(partsName).matches()) { + ZyClothsComponent byId = zyClothsComponentService.getById(partsName); + s.setPartsName(byId.getPartsName()); + } + } + return zyClothsModularComponents; + } } 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 a77f3d74..38c4a120 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 @@ -1,9 +1,13 @@ package org.jeecg.modules.demo.base.service.impl; import org.jeecg.modules.demo.base.entity.ZyClothsModular; +import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; import org.jeecg.modules.demo.base.entity.ZyClothsType; +import org.jeecg.modules.demo.base.entity.vo.ZyClothsModularDetail; +import org.jeecg.modules.demo.base.entity.vo.ZyProcessModularVo; import org.jeecg.modules.demo.base.mapper.ZyClothsModularMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper; +import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService; import org.jeecg.modules.demo.base.service.IZyClothsModularService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -25,10 +29,14 @@ import java.util.regex.Pattern; */ @Service public class ZyClothsModularServiceImpl extends ServiceImpl implements IZyClothsModularService { + + @Autowired + private IZyClothsModularCompentService zyClothsModularComponentService; + @Resource private ZyClothsModularMapper zyClothsModularMapper; @Resource - ZyClothsTypeMapper zyClothsTypeMapper; + private ZyClothsTypeMapper zyClothsTypeMapper; @Override public List selectByType(String cloths_type_id) { @@ -47,6 +55,73 @@ public class ZyClothsModularServiceImpl extends ServiceImpl zyClothsModularComponents = zyClothsModularComponentService.detail(id); + zyClothsModularDetail.setZyClothsModularComponents(zyClothsModularComponents); + + //模块工序 + List zyProcessModularVos = processModularDetail(id); + zyClothsModularDetail.setZyProcessModularVos(zyProcessModularVos); + + return zyClothsModularDetail; + } + + private List processModularDetail(String id) { + List zyProcessModularVos = zyClothsModularMapper.queryProcessModularList(id); + for (ZyProcessModularVo zyProcessModularVo: zyProcessModularVos) { + String modularName = zyClothsModularMapper.getModularNameByModularId(zyProcessModularVo.getModularId()); + if (StringUtils.hasText(modularName)){ + zyProcessModularVo.setModularId(modularName); + }else{ + zyProcessModularVo.setModularId("null"); + } + String processName = zyClothsModularMapper.getProcessNameByProcessId(zyProcessModularVo.getProcessId()); + if (StringUtils.hasText(processName)){ + zyProcessModularVo.setProcessId(processName); + }else{ + zyProcessModularVo.setProcessId("null"); + } + } + return zyProcessModularVos; + } + + private ZyClothsModular detail(String id) { + ZyClothsModular zyClothsModular = zyClothsModularMapper.selectById(id); + //翻译服装类型名称 和企业 + String clothsTypeId1 = zyClothsModular.getClothsTypeId(); + if (StringUtils.isEmpty(clothsTypeId1)){ + zyClothsModular.setClothsTypeId("null"); + return zyClothsModular; + } + String clothsTypeId = zyClothsModularMapper.getTypeNameById(zyClothsModular.getClothsTypeId()); + if (StringUtils.hasText(clothsTypeId)){ + zyClothsModular.setClothsTypeId(clothsTypeId); + } else { + zyClothsModular.setClothsTypeId("null"); + } + String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(zyClothsModular.getEnterpriseId()); + if (StringUtils.hasText(enterpriseName)){ + zyClothsModular.setEnterpriseId(enterpriseName); + }else { + zyClothsModular.setEnterpriseId("null"); + } + System.out.println("zyClothsModular 服装款式详情"+zyClothsModular); + return zyClothsModular; + } + + private Long orderNumber() { List listString = zyClothsModularMapper.selectNumsList1(); List listLong = new ArrayList<>(); diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/mapper/ZyProcessComponentMapper.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/mapper/ZyProcessComponentMapper.java index 89d34842..03992b67 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/mapper/ZyProcessComponentMapper.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/mapper/ZyProcessComponentMapper.java @@ -14,4 +14,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface ZyProcessComponentMapper extends BaseMapper { + List queryListByComponentId(String id); + + String getComponentNameByComponentId(String processId); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/mapper/xml/ZyProcessComponentMapper.xml b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/mapper/xml/ZyProcessComponentMapper.xml index 4cbd5bf4..c5f737dd 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/mapper/xml/ZyProcessComponentMapper.xml +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/mapper/xml/ZyProcessComponentMapper.xml @@ -2,4 +2,14 @@ + + diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/service/IZyProcessComponentService.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/service/IZyProcessComponentService.java index e38b5845..f6f5f6e0 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/service/IZyProcessComponentService.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/service/IZyProcessComponentService.java @@ -3,6 +3,8 @@ package org.jeecg.modules.demo.pro.service; import org.jeecg.modules.demo.pro.entity.ZyProcessComponent; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: zy_process_component * @Author: jeecg-boot @@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IZyProcessComponentService extends IService { + List detail(String id); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/service/impl/ZyProcessComponentServiceImpl.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/service/impl/ZyProcessComponentServiceImpl.java index 284fe75a..bfa6334e 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/service/impl/ZyProcessComponentServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/service/impl/ZyProcessComponentServiceImpl.java @@ -1,19 +1,52 @@ package org.jeecg.modules.demo.pro.service.impl; +import org.jeecg.modules.demo.base.mapper.ZyClothsModularMapper; import org.jeecg.modules.demo.pro.entity.ZyProcessComponent; import org.jeecg.modules.demo.pro.mapper.ZyProcessComponentMapper; import org.jeecg.modules.demo.pro.service.IZyProcessComponentService; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.List; /** * @Description: zy_process_component * @Author: jeecg-boot - * @Date: 2021-11-11 + * @Date: 2021-11-11 * @Version: V1.0 */ @Service public class ZyProcessComponentServiceImpl extends ServiceImpl implements IZyProcessComponentService { + @Resource + private ZyProcessComponentMapper zyProcessComponentMapper; + @Resource + private ZyClothsModularMapper zyClothsModularMapper; + + @Override + public List detail(String id) { + List zyProcessComponents = zyProcessComponentMapper.queryListByComponentId(id); + if (ObjectUtils.isEmpty(zyProcessComponents)) { + return zyProcessComponents; + } + for (ZyProcessComponent processComponent : zyProcessComponents) { + String processName = zyClothsModularMapper.getProcessNameByProcessId(processComponent.getProcessId()); + if (StringUtils.hasText(processName)){ + processComponent.setProcessId(processName); + }else{ + processComponent.setProcessId("null"); + } + String componentName = zyProcessComponentMapper.getComponentNameByComponentId(processComponent.getComponentId()); + if (StringUtils.hasText(componentName)){ + processComponent.setComponentId(componentName); + }else{ + processComponent.setComponentId("null"); + } + } + return zyProcessComponents; + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/controller/ZyStyleAccessoriesController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/controller/ZyStyleAccessoriesController.java index 5de0ca22..8d154c70 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/controller/ZyStyleAccessoriesController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/controller/ZyStyleAccessoriesController.java @@ -53,9 +53,9 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class ZyStyleAccessoriesController extends JeecgController { @Autowired private IZyStyleAccessoriesService zyStyleAccessoriesService; - @Autowired - private ZyStyleAccessoriesMapper zyStyleAccessoriesMapper; + @Resource + private ZyStyleAccessoriesMapper zyStyleAccessoriesMapper; @Resource private ZyStyleFabricMapper zyStyleFabricMapper; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/mapper/ZyStyleAccessoriesMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/mapper/ZyStyleAccessoriesMapper.java index a85e8414..6f6f0bc8 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/mapper/ZyStyleAccessoriesMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/mapper/ZyStyleAccessoriesMapper.java @@ -19,4 +19,7 @@ public interface ZyStyleAccessoriesMapper extends BaseMapper @Select("select count(*) from zy_style_accessories where style_id=#{styleId} and accessories_id=#{accessoriesId}") int count(@Param("accessoriesId") String accessoriesId, @Param("styleId") String styleId); + + @Select("select * from zy_style_accessories where style_id=#{styleId}") + List listByStyleId(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/service/IZyStyleAccessoriesService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/service/IZyStyleAccessoriesService.java index e52b263a..c1b09d56 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/service/IZyStyleAccessoriesService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/service/IZyStyleAccessoriesService.java @@ -3,6 +3,8 @@ package org.jeecg.modules.demo.zyaccessories.service; import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccessories; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: 款式辅料管理 * @Author: jeecg-boot @@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IZyStyleAccessoriesService extends IService { + List detail(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/service/impl/ZyStyleAccessoriesServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/service/impl/ZyStyleAccessoriesServiceImpl.java index b4874f7a..9db6eacb 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/service/impl/ZyStyleAccessoriesServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/service/impl/ZyStyleAccessoriesServiceImpl.java @@ -1,12 +1,17 @@ package org.jeecg.modules.demo.zyaccessories.service.impl; +import org.jeecg.common.api.vo.Result; import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccessories; import org.jeecg.modules.demo.zyaccessories.mapper.ZyStyleAccessoriesMapper; import org.jeecg.modules.demo.zyaccessories.service.IZyStyleAccessoriesService; +import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import javax.annotation.Resource; +import java.util.List; + /** * @Description: 款式辅料管理 * @Author: jeecg-boot @@ -16,4 +21,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ZyStyleAccessoriesServiceImpl extends ServiceImpl implements IZyStyleAccessoriesService { + @Resource + private ZyStyleAccessoriesMapper zyStyleAccessoriesMapper; + @Resource + private ZyStyleFabricMapper zyStyleFabricMapper; + + @Override + public List detail(String id) { + List list = zyStyleAccessoriesMapper.listByStyleId(id); + for (ZyStyleAccessories zy : list) { + String typeName = zyStyleFabricMapper.getTypeName(zy.getStyleId()); + zy.setTypeName(typeName); + } + return list; + } } 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 9a32d8b4..f864879f 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 @@ -20,17 +20,20 @@ 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.entity.ZyClothsComponent; -import org.jeecg.modules.demo.base.entity.ZyClothsModular; -import org.jeecg.modules.demo.base.entity.ZyClothsType; +import org.jeecg.modules.demo.accessories.entity.ZyAccessories; +import org.jeecg.modules.demo.base.entity.*; import org.jeecg.modules.demo.base.service.IZyClothsComponentService; import org.jeecg.modules.demo.base.service.IZyClothsModularService; import org.jeecg.modules.demo.base.service.IZyClothsTypeService; +import org.jeecg.modules.demo.device.entity.ZyDevicetypel; +import org.jeecg.modules.demo.fabric.entity.ZyFabric; import org.jeecg.modules.demo.pro.entity.NewZyProcessComponent; import org.jeecg.modules.demo.pro.entity.ZyProcessComponent; +import org.jeecg.modules.demo.tools.entity.ZyToolTypes; import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.service.ISysDepartService; import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; +import org.jeecg.modules.zyclothsstyle.entity.vo.AllClothStyle; import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper; import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; import org.jeecgframework.poi.excel.ExcelImportUtil; @@ -117,6 +120,20 @@ public class ZyClothsStyleController extends JeecgController detail(@RequestParam(name = "id", required = true) String id) { + System.out.println("controller层接受到的id: styleId: "+id); + AllClothStyle allClothStyle = zyClothsStyleService.queryDetail(id); + return Result.OK(allClothStyle); + } + + /** * 制衣部件 * diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/entity/vo/AllClothStyle.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/entity/vo/AllClothStyle.java new file mode 100644 index 00000000..0a7b58d7 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/entity/vo/AllClothStyle.java @@ -0,0 +1,25 @@ +package org.jeecg.modules.zyclothsstyle.entity.vo; + +import lombok.Data; +import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular; +import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccessories; +import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; +import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric; +import org.jeecg.modules.zystylemodule.entity.NewStyleModule; + +import java.util.List; + +@Data +public class AllClothStyle { + /**服装款式*/ + private ZyClothsStyle zyClothsStyle; + /**子模块 款式模块*/ + private List zyStyleModuleList; + /**子模块 款式面料*/ + private List zyStyleFabricList; + /**子模块 款式辅料*/ + private List zyStyleAccessoriesList; + /*子模块 款式型号 因风格问题 暂不开发*/ + /**子模块 款式工序*/ + private List zyStyleModularList; +} 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 6327de6f..f49f0bdd 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 @@ -21,4 +21,7 @@ public interface ZyClothsStyleMapper extends BaseMapper { @Select("select nums from zy_cloths_type where id=#{id} order by create_time DESC limit 0,1") String sort(String id); + + @Select("select depart_name from sys_depart where id=#{enterpriseId}") + String getEnterpriseName(String enterpriseId); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/IZyClothsStyleService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/IZyClothsStyleService.java index 5cec4a46..d288fc75 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/IZyClothsStyleService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/IZyClothsStyleService.java @@ -3,6 +3,7 @@ package org.jeecg.modules.zyclothsstyle.service; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; +import org.jeecg.modules.zyclothsstyle.entity.vo.AllClothStyle; /** * @Description: 服装款式表 @@ -13,7 +14,13 @@ import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; public interface IZyClothsStyleService extends IService { /**生成编号 类型编号(10位)+顺序号(8位)*/ - String generateNumber(ZyClothsStyle zyClothsStyle); + //String generateNumber(ZyClothsStyle zyClothsStyle); String sort(String id); + + /** + * 服装类型详情 + * @param id 根据服装款式id进行查询 + */ + AllClothStyle queryDetail(String id); } 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 9a409660..2a652006 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,24 +1,25 @@ package org.jeecg.modules.zyclothsstyle.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import org.bytedeco.javacpp.freenect; -import org.jeecg.modules.demo.base.entity.ZyClothsType; -import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular; +import org.jeecg.modules.demo.zyStyleModular.service.IZyStyleModularService; +import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccessories; +import org.jeecg.modules.demo.zyaccessories.service.IZyStyleAccessoriesService; import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; +import org.jeecg.modules.zyclothsstyle.entity.vo.AllClothStyle; import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper; import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; -import org.jetbrains.annotations.NotNull; +import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric; +import org.jeecg.modules.zystylefabric.service.IZyStyleFabricService; +import org.jeecg.modules.zystylemodule.entity.NewStyleModule; +import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.util.StringUtils; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.regex.Pattern; @@ -31,51 +32,90 @@ import java.util.regex.Pattern; */ @Service public class ZyClothsStyleServiceImpl extends ServiceImpl implements IZyClothsStyleService { + @Autowired + private IZyStyleModuleService zyStyleModuleService; + @Autowired + private IZyStyleFabricService zyStyleFabricService; + @Autowired + private IZyStyleModularService zyStyleModularService; + @Autowired + private IZyStyleAccessoriesService zyStyleAccessoriesService; @Resource private ZyClothsStyleMapper zyClothsStyleMapper; - @Resource - ZyClothsTypeMapper zyClothsTypeMapper; - /** - * 生成编号 类型编号(10位)+顺序号(8位) + * 服装类型详情 * - * @param zyClothsStyle + * @param id 根据服装款式id进行查询 */ @Override - public String generateNumber(ZyClothsStyle zyClothsStyle) { - //先拿到类型编号 - String nums = zyClothsStyle.getTypeId(); - ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums); - String nums1 = zyClothsType.getNums(); - //截取后十位 - //String substring = nums.substring(nums.length() - 10); - //再来一个顺序号 - String format = String.format("%08d", orderNumber()); - //生成编码 - return nums1 + format; + public AllClothStyle queryDetail(String id) { + AllClothStyle zyAllClothStyle = new AllClothStyle(); + //服装款式详情 + ZyClothsStyle zyClothsStyle = detail(id); + zyAllClothStyle.setZyClothsStyle(zyClothsStyle); + //服装 款式 模块详情 + List zyStyleModuleList = zyStyleModuleService.detail(id); + zyAllClothStyle.setZyStyleModuleList(zyStyleModuleList); + //服装 面料详情 + List zyStyleFabricList = zyStyleFabricService.detail(id); + zyAllClothStyle.setZyStyleFabricList(zyStyleFabricList); + //服装 辅料详情 + List zyStyleAccessoriesList = zyStyleAccessoriesService.detail(id); + zyAllClothStyle.setZyStyleAccessoriesList(zyStyleAccessoriesList); + + //服装 工序详情 + List zyStyleModularList = zyStyleModularService.detail(id); + zyAllClothStyle.setZyStyleModularList(zyStyleModularList); + + return zyAllClothStyle; } + public ZyClothsStyle detail(String id){ + ZyClothsStyle zyClothsStyle = zyClothsStyleMapper.selectById(id); + //翻译规格 shape 和企业 + String shape = zyClothsStyle.getShape(); + if (shape.equals("1")){ + zyClothsStyle.setShape("预制"); + }else if (shape.equals("0")){ + zyClothsStyle.setShape("定制"); + }else { + zyClothsStyle.setShape("null"); + } + String enterpriseName = zyClothsStyleMapper.getEnterpriseName(zyClothsStyle.getEnterpriseId()); + if (StringUtils.hasText(enterpriseName)){ + zyClothsStyle.setEnterpriseId(enterpriseName); + }else { + zyClothsStyle.setEnterpriseId("null"); + } + System.out.println("zyClothsStyle 服装款式详情"+zyClothsStyle); + return zyClothsStyle; + } + + @Override public String sort(String id) { String nums = zyClothsStyleMapper.sort(id); -// System.out.println(nums + " nums"); + //System.out.println(nums + " nums"); String format = String.format("%08d", orderNumber()); -// System.err.println(format + " format"); + //System.err.println(format + " format"); return nums + format; } + private Long orderNumber() { List numsList = zyClothsStyleMapper.selectNumsList(); -// System.out.println(numsList); -// System.out.println(numsList.size()); + /* + System.out.println(numsList); + System.out.println(numsList.size()); + */ List list = new ArrayList<>(); for (String nums : numsList) { String REGEX = "[^0-9]"; String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim(); - if (newNums.length()>8) { + if (newNums.length() > 8) { String substring = newNums.substring(newNums.length() - 8); list.add(Long.valueOf(substring)); continue; @@ -86,8 +126,10 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl { /** - * @param styleId zyClothsStyle 中的id 款式id + * 拿到服装类型名称 + * @param styleId zyClothsStyle 中的id 款式id */ @Select("select type_name from zy_cloths_style where id = #{styleId}") String getTypeName(String styleId); + + @Select("SELECT * FROM zy_style_fabric WHERE style_id = #{id}") + List listByStyleId(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/service/IZyStyleFabricService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/service/IZyStyleFabricService.java index 189c1b46..bf78f492 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/service/IZyStyleFabricService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/service/IZyStyleFabricService.java @@ -2,8 +2,11 @@ package org.jeecg.modules.zystylefabric.service; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric; import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric; +import java.util.List; + /** * @Description: 款式面料表 * @Author: jeecg-boot @@ -12,4 +15,5 @@ import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric; */ public interface IZyStyleFabricService extends IService { + List detail(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/service/impl/ZyStyleFabricServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/service/impl/ZyStyleFabricServiceImpl.java index 1fa9faba..1548f515 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/service/impl/ZyStyleFabricServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/service/impl/ZyStyleFabricServiceImpl.java @@ -1,12 +1,22 @@ package org.jeecg.modules.zystylefabric.service.impl; +import org.jeecg.modules.demo.fabric.entity.ZyFabric; +import org.jeecg.modules.demo.fabric.service.IZyFabricService; +import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; +import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; +import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric; import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric; import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper; import org.jeecg.modules.zystylefabric.service.IZyStyleFabricService; +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.List; + /** * @Description: 款式面料表 * @Author: jeecg-boot @@ -16,4 +26,45 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ZyStyleFabricServiceImpl extends ServiceImpl implements IZyStyleFabricService { + @Autowired + private IZyClothsStyleService zyClothsStyleService; + @Autowired + private IZyFabricService zyFabricService; + + @Resource + private ZyStyleFabricMapper zyStyleFabricMapper; + + @Override + public List detail(String id) { + List list = zyStyleFabricMapper.listByStyleId(id); + List newZyStyleFabrics = new ArrayList<>(); + for (ZyStyleFabric zyStyleF : list) { + System.out.println("****" + zyStyleF); + NewZyStyleFabric newZySF = new NewZyStyleFabric(); + //编辑回显 + newZySF.setId(zyStyleF.getId()); + newZySF.setFabricId(zyStyleF.getFabricId()); + newZySF.setStyleId(zyStyleF.getStyleId()); + + //拿到服装类型名称 + String typeName = zyStyleFabricMapper.getTypeName(newZySF.getStyleId()); + newZySF.setTypeName(typeName); + + //款式编号和名称 + String styleId = zyStyleF.getStyleId(); + ZyClothsStyle styleById = zyClothsStyleService.getById(styleId); + newZySF.setStyleNums(styleById.getNums()); + newZySF.setStyleNames(styleById.getStyleNames()); + //模块编号和名称 + String fabricId = zyStyleF.getFabricId(); + + ZyFabric fabricById = zyFabricService.getById(fabricId); + + newZySF.setFabricNumber(fabricById.getFabricNumber()); + newZySF.setFabricName(fabricById.getName()); + newZySF.setCreateTime(zyStyleF.getCreateTime()); + newZyStyleFabrics.add(newZySF); + } + return newZyStyleFabrics; + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java index 47430f8e..a6576726 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java @@ -75,7 +75,7 @@ public class ZyStyleModuleController extends JeecgController listNewStyleModules = new ArrayList<>(); QueryWrapper queryWrapper = new QueryWrapper<>(); - System.err.println("传来的 "+id); + System.err.println("ZyStyleModule 款式模块表 传来的 "+id); if (id != null) { queryWrapper.eq("style_id", id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/ZyStyleModuleMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/ZyStyleModuleMapper.java index e9d616b1..0caad037 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/ZyStyleModuleMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/ZyStyleModuleMapper.java @@ -15,5 +15,6 @@ import org.jeecg.modules.zystylemodule.entity.ZyStyleModule; */ public interface ZyStyleModuleMapper extends BaseMapper { + /**根据服装款式的id style_id 查询所有*/ List handWritingList(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/xml/ZyStyleModuleMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/xml/ZyStyleModuleMapper.xml index 2fc42d9b..2fa6b3be 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/xml/ZyStyleModuleMapper.xml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/xml/ZyStyleModuleMapper.xml @@ -2,8 +2,10 @@ - + SELECT * + FROM zy_style_module + WHERE style_id = #{id} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/IZyStyleModuleService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/IZyStyleModuleService.java index 94425386..78e9e8b7 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/IZyStyleModuleService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/IZyStyleModuleService.java @@ -15,5 +15,5 @@ import java.util.List; */ public interface IZyStyleModuleService extends IService { - + List detail(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/impl/ZyStyleModuleServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/impl/ZyStyleModuleServiceImpl.java index a0173d1e..3c9a78b5 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/impl/ZyStyleModuleServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/impl/ZyStyleModuleServiceImpl.java @@ -1,12 +1,24 @@ package org.jeecg.modules.zystylemodule.service.impl; +import org.jeecg.modules.demo.base.entity.ZyClothsModular; +import org.jeecg.modules.demo.base.service.IZyClothsModularService; +import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; +import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; +import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper; +import org.jeecg.modules.zystylemodule.entity.NewStyleModule; import org.jeecg.modules.zystylemodule.entity.ZyStyleModule; import org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper; import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; /** * @Description: 款式模块表 @@ -17,4 +29,59 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ZyStyleModuleServiceImpl extends ServiceImpl implements IZyStyleModuleService { + @Autowired + private IZyClothsModularService zyClothsModularService; + @Autowired + private IZyClothsStyleService zyClothsStyleService; + + @Resource + private ZyStyleFabricMapper zyStyleFabricMapper; + @Resource + private ZyStyleModuleMapper zyStyleModuleMapper; + + @Override + public List detail(String id) { + List list = zyStyleModuleMapper.handWritingList(id); + List newStyleModuleList = new ArrayList<>(); + for (ZyStyleModule zyStyleModule : list) { + NewStyleModule newSeMo = new NewStyleModule(); + //编辑回显 + newSeMo.setId(zyStyleModule.getId()); + newSeMo.setTypeId(zyStyleModule.getTypeId()); + newSeMo.setStyleId(zyStyleModule.getStyleId()); + newSeMo.setModularId(zyStyleModule.getModularId()); + //款式编号和名称 + String styleId = zyStyleModule.getStyleId(); + ZyClothsStyle styleById = zyClothsStyleService.getById(styleId); + newSeMo.setStyleNums(styleById.getNums()); + newSeMo.setStyleNames(styleById.getStyleNames()); + //模块编号和名称 + String modularId = zyStyleModule.getModularId(); + ZyClothsModular modularById = zyClothsModularService.getById(modularId); + if(StringUtils.isEmpty(modularById)){ + newSeMo.setModularNums("null"); + newSeMo.setModularName("null"); + }else { + newSeMo.setModularNums(modularById.getNums()); + newSeMo.setModularName(modularById.getModularName()); + } + + + newSeMo.setCreateTime(zyStyleModule.getCreateTime()); + //服装类型 服装类型的id 不知道什么情况 传的是zy_cloths_style中的type_id + //String styleId1 = zyStyleModule.getStyleId(); + String typeName = zyStyleFabricMapper.getTypeName(zyStyleModule.getStyleId()); + //System.out.println(typeId); + //String typeNameByTypeId = zyClothsStyleMapper.getTypeNameByTypeId(typeId); + //System.err.println(typeNameByTypeId); + if (typeName != null){ + newSeMo.setTypeName(typeName); + } else { + newSeMo.setTypeName("typeName为空"); + } + + newStyleModuleList.add(newSeMo); + } + return newStyleModuleList; + } }