|
|
|
@ -10,6 +10,7 @@ import java.io.UnsupportedEncodingException; |
|
|
|
|
import java.net.URLDecoder; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
@ -47,196 +48,199 @@ import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
/** |
|
|
|
|
* @Description: 服装款式表 |
|
|
|
|
* @Author: jeecg-boot |
|
|
|
|
* @Date: 2022-09-04 |
|
|
|
|
* @Date: 2022-09-04 |
|
|
|
|
* @Version: V1.0 |
|
|
|
|
*/ |
|
|
|
|
@Api(tags="服装款式表") |
|
|
|
|
@Api(tags = "服装款式表") |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping("/zyclothsstyle/zyClothsStyle") |
|
|
|
|
@Slf4j |
|
|
|
|
public class ZyClothsStyleController extends JeecgController<ZyClothsStyle, IZyClothsStyleService> { |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsStyleService zyClothsStyleService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsComponentService zyClothsComponentService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysDepartService sysDepartService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsModularService zyClothsModularService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsTypeService zyClothsTypeService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
|
* @param zyClothsStyle |
|
|
|
|
* @param pageNo |
|
|
|
|
* @param pageSize |
|
|
|
|
* @param req |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-分页列表查询") |
|
|
|
|
@ApiOperation(value="服装款式表-分页列表查询", notes="服装款式表-分页列表查询") |
|
|
|
|
@GetMapping(value = "/list") |
|
|
|
|
public Result<?> queryPageList(ZyClothsStyle zyClothsStyle, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
QueryWrapper<ZyClothsStyle> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsStyle, req.getParameterMap()); |
|
|
|
|
Page<ZyClothsStyle> page = new Page<ZyClothsStyle>(pageNo, pageSize); |
|
|
|
|
IPage<ZyClothsStyle> pageList = zyClothsStyleService.page(page, queryWrapper); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-查询所有") |
|
|
|
|
@ApiOperation(value="服装款式表-查询所有", notes="服装款式表-查询所有") |
|
|
|
|
@GetMapping(value = "/findAll") |
|
|
|
|
public Result<?> findAll() { |
|
|
|
|
List<ZyClothsStyle> list = zyClothsStyleService.list(); |
|
|
|
|
|
|
|
|
|
for(ZyClothsStyle zycl : list){ |
|
|
|
|
String id = zycl.getEnterpriseId(); |
|
|
|
|
if(id != null){ |
|
|
|
|
SysDepart byId = sysDepartService.getById(id); |
|
|
|
|
zycl.setEnterpriseId(byId.getDepartName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Result.OK(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 制衣部件 |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-制衣部件查询所有") |
|
|
|
|
@ApiOperation(value="服装款式表-制衣部件查询所有", notes="服装款式表-制衣部件查询所有") |
|
|
|
|
@GetMapping(value = "/cloCfindAll") |
|
|
|
|
public Result<?> cloCfindAll() { |
|
|
|
|
List<ZyClothsComponent> list = zyClothsComponentService.list(); |
|
|
|
|
|
|
|
|
|
for(ZyClothsComponent zycl : list){ |
|
|
|
|
|
|
|
|
|
String id = zycl.getModularId(); |
|
|
|
|
String enterpriseId = zycl.getEnterpriseId(); |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsStyleService zyClothsStyleService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsComponentService zyClothsComponentService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysDepartService sysDepartService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsModularService zyClothsModularService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsTypeService zyClothsTypeService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
|
* @param zyClothsStyle |
|
|
|
|
* @param pageNo |
|
|
|
|
* @param pageSize |
|
|
|
|
* @param req |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-分页列表查询") |
|
|
|
|
@ApiOperation(value = "服装款式表-分页列表查询", notes = "服装款式表-分页列表查询") |
|
|
|
|
@GetMapping(value = "/list") |
|
|
|
|
public Result<?> queryPageList(ZyClothsStyle zyClothsStyle, |
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
QueryWrapper<ZyClothsStyle> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsStyle, req.getParameterMap()); |
|
|
|
|
Page<ZyClothsStyle> page = new Page<ZyClothsStyle>(pageNo, pageSize); |
|
|
|
|
IPage<ZyClothsStyle> pageList = zyClothsStyleService.page(page, queryWrapper); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-查询所有") |
|
|
|
|
@ApiOperation(value = "服装款式表-查询所有", notes = "服装款式表-查询所有") |
|
|
|
|
@GetMapping(value = "/findAll") |
|
|
|
|
public Result<?> findAll() { |
|
|
|
|
List<ZyClothsStyle> list = zyClothsStyleService.list(); |
|
|
|
|
|
|
|
|
|
for (ZyClothsStyle zycl : list) { |
|
|
|
|
String id = zycl.getEnterpriseId(); |
|
|
|
|
if (id != null) { |
|
|
|
|
SysDepart byId = sysDepartService.getById(id); |
|
|
|
|
zycl.setEnterpriseId(byId.getDepartName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Result.OK(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 制衣部件 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-制衣部件查询所有") |
|
|
|
|
@ApiOperation(value = "服装款式表-制衣部件查询所有", notes = "服装款式表-制衣部件查询所有") |
|
|
|
|
@GetMapping(value = "/cloCfindAll") |
|
|
|
|
public Result<?> cloCfindAll() { |
|
|
|
|
List<ZyClothsComponent> list = zyClothsComponentService.list(); |
|
|
|
|
|
|
|
|
|
for (ZyClothsComponent zycl : list) { |
|
|
|
|
|
|
|
|
|
String id = zycl.getModularId(); |
|
|
|
|
String enterpriseId = zycl.getEnterpriseId(); |
|
|
|
|
/*if(id!=null || (enterpriseId !=null&&enterpriseId.isEmpty())){ |
|
|
|
|
ZyClothsType byId = zyClothsTypeService.getById(id); |
|
|
|
|
SysDepart byId1 = sysDepartService.getById(enterpriseId); |
|
|
|
|
zycl.setClothsTypeId(byId.getTypeName()); |
|
|
|
|
zycl.setEnterpriseId(byId1.getDepartName()); |
|
|
|
|
}*/ |
|
|
|
|
if(id!=null){ |
|
|
|
|
ZyClothsModular byId = zyClothsModularService.getById(id); |
|
|
|
|
zycl.setModularId(byId.getModularName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (id != null) { |
|
|
|
|
ZyClothsModular byId = zyClothsModularService.getById(id); |
|
|
|
|
zycl.setModularId(byId.getModularName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/*if(id!=null || (enterpriseId !=null&&enterpriseId.isEmpty())){ |
|
|
|
|
ZyClothsType byId = zyClothsTypeService.getById(id); |
|
|
|
|
SysDepart byId1 = sysDepartService.getById(enterpriseId); |
|
|
|
|
zycl.setClothsTypeId(byId.getTypeName()); |
|
|
|
|
zycl.setEnterpriseId(byId1.getDepartName()); |
|
|
|
|
}*/ |
|
|
|
|
return Result.OK(list); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 添加 |
|
|
|
|
* |
|
|
|
|
* @param zyClothsStyle |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-添加") |
|
|
|
|
@ApiOperation(value="服装款式表-添加", notes="服装款式表-添加") |
|
|
|
|
@PostMapping(value = "/add") |
|
|
|
|
public Result<?> add(@RequestBody ZyClothsStyle zyClothsStyle) { |
|
|
|
|
zyClothsStyleService.save(zyClothsStyle); |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑 |
|
|
|
|
* |
|
|
|
|
* @param zyClothsStyle |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-编辑") |
|
|
|
|
@ApiOperation(value="服装款式表-编辑", notes="服装款式表-编辑") |
|
|
|
|
@PutMapping(value = "/edit") |
|
|
|
|
public Result<?> edit(@RequestBody ZyClothsStyle zyClothsStyle) { |
|
|
|
|
zyClothsStyleService.updateById(zyClothsStyle); |
|
|
|
|
return Result.OK("编辑成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id删除 |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-通过id删除") |
|
|
|
|
@ApiOperation(value="服装款式表-通过id删除", notes="服装款式表-通过id删除") |
|
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
zyClothsStyleService.removeById(id); |
|
|
|
|
return Result.OK("删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量删除 |
|
|
|
|
* |
|
|
|
|
* @param ids |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-批量删除") |
|
|
|
|
@ApiOperation(value="服装款式表-批量删除", notes="服装款式表-批量删除") |
|
|
|
|
@DeleteMapping(value = "/deleteBatch") |
|
|
|
|
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
|
|
|
|
this.zyClothsStyleService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
|
|
return Result.OK("批量删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id查询 |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-通过id查询") |
|
|
|
|
@ApiOperation(value="服装款式表-通过id查询", notes="服装款式表-通过id查询") |
|
|
|
|
@GetMapping(value = "/queryById") |
|
|
|
|
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
ZyClothsStyle zyClothsStyle = zyClothsStyleService.getById(id); |
|
|
|
|
if(zyClothsStyle==null) { |
|
|
|
|
return Result.error("未找到对应数据"); |
|
|
|
|
} |
|
|
|
|
return Result.OK(zyClothsStyle); |
|
|
|
|
} |
|
|
|
|
return Result.OK(list); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加 |
|
|
|
|
* |
|
|
|
|
* @param zyClothsStyle |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-添加") |
|
|
|
|
@ApiOperation(value = "服装款式表-添加", notes = "服装款式表-添加") |
|
|
|
|
@PostMapping(value = "/add") |
|
|
|
|
public Result<?> add(@RequestBody ZyClothsStyle zyClothsStyle) { |
|
|
|
|
//生成编号 类型编号(10位)+顺序号(8位)在service层处理
|
|
|
|
|
zyClothsStyle.setNums(zyClothsStyleService.generateNumber(zyClothsStyle)); |
|
|
|
|
zyClothsStyleService.save(zyClothsStyle); |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑 |
|
|
|
|
* |
|
|
|
|
* @param zyClothsStyle |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-编辑") |
|
|
|
|
@ApiOperation(value = "服装款式表-编辑", notes = "服装款式表-编辑") |
|
|
|
|
@PutMapping(value = "/edit") |
|
|
|
|
public Result<?> edit(@RequestBody ZyClothsStyle zyClothsStyle) { |
|
|
|
|
zyClothsStyleService.updateById(zyClothsStyle); |
|
|
|
|
return Result.OK("编辑成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id删除 |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-通过id删除") |
|
|
|
|
@ApiOperation(value = "服装款式表-通过id删除", notes = "服装款式表-通过id删除") |
|
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
|
|
|
|
zyClothsStyleService.removeById(id); |
|
|
|
|
return Result.OK("删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量删除 |
|
|
|
|
* |
|
|
|
|
* @param ids |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-批量删除") |
|
|
|
|
@ApiOperation(value = "服装款式表-批量删除", notes = "服装款式表-批量删除") |
|
|
|
|
@DeleteMapping(value = "/deleteBatch") |
|
|
|
|
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
|
|
|
|
this.zyClothsStyleService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
|
|
return Result.OK("批量删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id查询 |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "服装款式表-通过id查询") |
|
|
|
|
@ApiOperation(value = "服装款式表-通过id查询", notes = "服装款式表-通过id查询") |
|
|
|
|
@GetMapping(value = "/queryById") |
|
|
|
|
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
|
|
|
|
ZyClothsStyle zyClothsStyle = zyClothsStyleService.getById(id); |
|
|
|
|
if (zyClothsStyle == null) { |
|
|
|
|
return Result.error("未找到对应数据"); |
|
|
|
|
} |
|
|
|
|
return Result.OK(zyClothsStyle); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 导出excel |
|
|
|
|
* |
|
|
|
|
* @param request |
|
|
|
|
* @param zyClothsStyle |
|
|
|
|
*/ |
|
|
|
|
* 导出excel |
|
|
|
|
* |
|
|
|
|
* @param request |
|
|
|
|
* @param zyClothsStyle |
|
|
|
|
*/ |
|
|
|
|
@RequestMapping(value = "/exportXls") |
|
|
|
|
public ModelAndView exportXls(HttpServletRequest request, ZyClothsStyle zyClothsStyle) { |
|
|
|
|
return super.exportXls(request, zyClothsStyle, ZyClothsStyle.class, "服装款式表"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过excel导入数据 |
|
|
|
|
* |
|
|
|
|
* @param request |
|
|
|
|
* @param response |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
* 通过excel导入数据 |
|
|
|
|
* |
|
|
|
|
* @param request |
|
|
|
|
* @param response |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
|
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
|
|
|
|
return super.importExcel(request, response, ZyClothsStyle.class); |
|
|
|
|