|
|
|
@ -96,6 +96,7 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
|
|
|
|
|
List<NewStyleModule> listNewStyleModules = new ArrayList<>(); |
|
|
|
|
QueryWrapper<ZyStyleModule> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
System.err.println("传来的 "+id); |
|
|
|
|
if (id != null) { |
|
|
|
|
queryWrapper.eq("style_id", id); |
|
|
|
|
} |
|
|
|
@ -111,7 +112,7 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<ZyStyleModule> list = zyStyleModuleService.list(queryWrapper); |
|
|
|
|
//System.out.println(list);
|
|
|
|
|
System.out.println(list); |
|
|
|
|
for (ZyStyleModule zyStyleModule : list) { |
|
|
|
|
NewStyleModule newSeMo = new NewStyleModule(); |
|
|
|
|
//编辑回显
|
|
|
|
@ -129,10 +130,12 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
ZyClothsModular modularById = zyClothsModularService.getById(modularId); |
|
|
|
|
newSeMo.setModularNums(modularById.getNums()); |
|
|
|
|
newSeMo.setModularName(modularById.getModularName()); |
|
|
|
|
|
|
|
|
|
newSeMo.setCreateTime(zyStyleModule.getCreateTime()); |
|
|
|
|
//服装类型
|
|
|
|
|
String typeId = zyStyleModule.getTypeId(); |
|
|
|
|
ZyClothsType typeById = zyClothsTypeService.getById(typeId); |
|
|
|
|
newSeMo.setCreateTime(zyStyleModule.getCreateTime()); |
|
|
|
|
|
|
|
|
|
if (typeById != null){ |
|
|
|
|
newSeMo.setTypeName(typeById.getTypeName()); |
|
|
|
|
} else { |
|
|
|
@ -185,13 +188,13 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
@PostMapping(value = "/add") |
|
|
|
|
public Result<String> add(@RequestBody ZyStyleModule zyStyleModule) { |
|
|
|
|
//根据styleId到原表 zy cloths style直接把名字拿过来,再根据名字到另一个表 zy cloths type 中把id拿过来
|
|
|
|
|
String styleId = zyStyleModule.getStyleId(); |
|
|
|
|
//String styleId = zyStyleModule.getStyleId();
|
|
|
|
|
|
|
|
|
|
ZyClothsStyle zyClothsStyle = zyClothsStyleService.getById(styleId); |
|
|
|
|
LambdaQueryWrapper<ZyClothsType> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
lambdaQueryWrapper.eq(ZyClothsType::getTypeName,zyClothsStyle.getTypeId()); |
|
|
|
|
ZyClothsType zyClothsType = zyClothsTypeService.getOne(lambdaQueryWrapper); |
|
|
|
|
zyStyleModule.setTypeId(zyClothsType.getId()); |
|
|
|
|
//ZyClothsStyle zyClothsStyle = zyClothsStyleService.getById(styleId);
|
|
|
|
|
//LambdaQueryWrapper<ZyClothsType> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
//lambdaQueryWrapper.eq(ZyClothsType::getTypeName,zyClothsStyle.getTypeId());
|
|
|
|
|
//ZyClothsType zyClothsType = zyClothsTypeService.getOne(lambdaQueryWrapper);
|
|
|
|
|
//zyStyleModule.setTypeId(zyClothsType.getId());
|
|
|
|
|
|
|
|
|
|
zyStyleModuleService.save(zyStyleModule); |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|