|
|
|
@ -8,8 +8,11 @@ import java.util.stream.Collectors; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
import java.net.URLDecoder; |
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
@ -28,6 +31,7 @@ import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; |
|
|
|
|
import org.jeecg.modules.zystylefabric.entity.NewZyStyleFabric; |
|
|
|
|
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.INewZyStyleModuleService; |
|
|
|
|
import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService; |
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil; |
|
|
|
@ -66,6 +70,7 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsTypeService zyClothsTypeService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
@ -82,6 +87,13 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
/*LambdaQueryWrapper<ZyStyleModule> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
lambdaQueryWrapper.eq(ZyStyleModule::getStyleId,id); |
|
|
|
|
Page<NewStyleModule> page = new Page<>(pageNo,pageSize); |
|
|
|
|
Page<NewStyleModule> pageList = zyStyleModuleService.page(page, lambdaQueryWrapper); |
|
|
|
|
System.out.println(pageList.getRecords()); |
|
|
|
|
return Result.OK(pageList);*/ |
|
|
|
|
|
|
|
|
|
List<NewStyleModule> listNewStyleModules = new ArrayList<>(); |
|
|
|
|
QueryWrapper<ZyStyleModule> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
if (id != null) { |
|
|
|
@ -99,6 +111,7 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<ZyStyleModule> list = zyStyleModuleService.list(queryWrapper); |
|
|
|
|
//System.out.println(list);
|
|
|
|
|
for (ZyStyleModule zyStyleModule : list) { |
|
|
|
|
NewStyleModule newSeMo = new NewStyleModule(); |
|
|
|
|
//编辑回显
|
|
|
|
@ -119,13 +132,22 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
//服装类型
|
|
|
|
|
String typeId = zyStyleModule.getTypeId(); |
|
|
|
|
ZyClothsType typeById = zyClothsTypeService.getById(typeId); |
|
|
|
|
newSeMo.setCreateTime(zyStyleModule.getCreateTime()); |
|
|
|
|
if (typeById != null){ |
|
|
|
|
newSeMo.setTypeName(typeById.getTypeName()); |
|
|
|
|
} else { |
|
|
|
|
newSeMo.setTypeName("typeName为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
listNewStyleModules.add(newSeMo); |
|
|
|
|
} |
|
|
|
|
IPage<NewStyleModule> pageList = new Page<>(pageNo, pageSize, list.size()); |
|
|
|
|
IPage<NewStyleModule> pageList = new Page<>(pageNo, pageSize, listNewStyleModules.size()); |
|
|
|
|
pageList.setRecords(listNewStyleModules); |
|
|
|
|
|
|
|
|
|
System.out.println(pageList.getRecords()); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
@ -147,7 +169,7 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
Page<ZyStyleModule> page = new Page<ZyStyleModule>(pageNo, pageSize); |
|
|
|
|
|
|
|
|
|
IPage<ZyStyleModule> pageList = zyStyleModuleService.page(page, queryWrapper); |
|
|
|
|
System.out.println(zyStyleModule); |
|
|
|
|
//System.out.println(zyStyleModule);
|
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -162,6 +184,15 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS |
|
|
|
|
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_module:add")
|
|
|
|
|
@PostMapping(value = "/add") |
|
|
|
|
public Result<String> add(@RequestBody ZyStyleModule zyStyleModule) { |
|
|
|
|
//根据styleId到原表 zy cloths style直接把名字拿过来,再根据名字到另一个表 zy cloths type 中把id拿过来
|
|
|
|
|
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()); |
|
|
|
|
|
|
|
|
|
zyStyleModuleService.save(zyStyleModule); |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|
} |
|
|
|
|