2022-12-06 赵玉瑞 修改产品管理部分问题

zhc4dev
赵玉瑞 2 years ago
parent b66926ca3c
commit 9203804650
  1. 6
      ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
  2. 225
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java

@ -13,9 +13,9 @@
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('zy_cloths_component')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0">

@ -9,6 +9,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;
@ -27,6 +28,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@ -36,135 +38,144 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
/**
* @Description: zy_cloths_type
* @Author: jeecg-boot
* @Date: 2021-11-10
* @Date: 2021-11-10
* @Version: V1.0
*/
@Api(tags="zy_cloths_type")
@Api(tags = "zy_cloths_type")
@RestController
@RequestMapping("/base/zyClothsType")
@Slf4j
public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClothsTypeService> {
@Autowired
private IZyClothsTypeService zyClothsTypeService;
@Autowired
private IZyClothsTypeService zyClothsTypeService;
/**
* 分页列表查询
*
* @param zyClothsType
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "zy_cloths_type-分页列表查询")
@ApiOperation(value="zy_cloths_type-分页列表查询", notes="zy_cloths_type-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyClothsType zyClothsType,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyClothsType> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap());
Page<ZyClothsType> page = new Page<ZyClothsType>(pageNo, pageSize);
IPage<ZyClothsType> pageList = zyClothsTypeService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 分页列表查询
*
* @param zyClothsType
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "zy_cloths_type-分页列表查询")
@ApiOperation(value = "zy_cloths_type-分页列表查询", notes = "zy_cloths_type-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyClothsType zyClothsType,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyClothsType> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap());
Page<ZyClothsType> page = new Page<ZyClothsType>(pageNo, pageSize);
IPage<ZyClothsType> pageList = zyClothsTypeService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyClothsType
* @return
*/
@AutoLog(value = "zy_cloths_type-添加")
@ApiOperation(value="zy_cloths_type-添加", notes="zy_cloths_type-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsType zyClothsType) {
//生成编号 nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)在service层处理
zyClothsType.setNums(zyClothsTypeService.generateNumber());
zyClothsTypeService.save(zyClothsType);
return Result.OK("添加成功!");
}
/**
* 添加
*
* @param zyClothsType
* @return
*/
@AutoLog(value = "zy_cloths_type-添加")
@ApiOperation(value = "zy_cloths_type-添加", notes = "zy_cloths_type-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsType zyClothsType) {
//类型名称输入时没有最大长度限制,提交时才提示。前端校验、后台校验
//type_name,类型名称,varchar,50,非空,同类型下不重复
String typeName = zyClothsType.getTypeName();
if (!StringUtils.hasText(typeName)) {
return Result.error("类型名称 不能为空");
}
if (typeName.length() > 10) {
return Result.error("类型名称长度不能超过10");
}
//生成编号 nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)在service层处理
zyClothsType.setNums(zyClothsTypeService.generateNumber());
zyClothsTypeService.save(zyClothsType);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyClothsType
* @return
*/
@AutoLog(value = "zy_cloths_type-编辑")
@ApiOperation(value="zy_cloths_type-编辑", notes="zy_cloths_type-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyClothsType zyClothsType) {
zyClothsTypeService.updateById(zyClothsType);
return Result.OK("编辑成功!");
}
/**
* 编辑
*
* @param zyClothsType
* @return
*/
@AutoLog(value = "zy_cloths_type-编辑")
@ApiOperation(value = "zy_cloths_type-编辑", notes = "zy_cloths_type-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyClothsType zyClothsType) {
zyClothsTypeService.updateById(zyClothsType);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "zy_cloths_type-通过id删除")
@ApiOperation(value="zy_cloths_type-通过id删除", notes="zy_cloths_type-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
zyClothsTypeService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "zy_cloths_type-通过id删除")
@ApiOperation(value = "zy_cloths_type-通过id删除", notes = "zy_cloths_type-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
zyClothsTypeService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "zy_cloths_type-批量删除")
@ApiOperation(value="zy_cloths_type-批量删除", notes="zy_cloths_type-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.zyClothsTypeService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "zy_cloths_type-批量删除")
@ApiOperation(value = "zy_cloths_type-批量删除", notes = "zy_cloths_type-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.zyClothsTypeService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "zy_cloths_type-通过id查询")
@ApiOperation(value="zy_cloths_type-通过id查询", notes="zy_cloths_type-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
ZyClothsType zyClothsType = zyClothsTypeService.getById(id);
if(zyClothsType==null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyClothsType);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "zy_cloths_type-通过id查询")
@ApiOperation(value = "zy_cloths_type-通过id查询", notes = "zy_cloths_type-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
ZyClothsType zyClothsType = zyClothsTypeService.getById(id);
if (zyClothsType == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyClothsType);
}
/**
* 导出excel
*
* @param request
* @param zyClothsType
*/
* 导出excel
*
* @param request
* @param zyClothsType
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyClothsType zyClothsType) {
return super.exportXls(request, zyClothsType, ZyClothsType.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, ZyClothsType.class);

Loading…
Cancel
Save