|
|
@ -9,6 +9,7 @@ import java.io.UnsupportedEncodingException; |
|
|
|
import java.net.URLDecoder; |
|
|
|
import java.net.URLDecoder; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
|
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
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.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest; |
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest; |
|
|
@ -36,13 +38,13 @@ import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @Description: zy_cloths_type |
|
|
|
* @Description: zy_cloths_type |
|
|
|
* @Author: jeecg-boot |
|
|
|
* @Author: jeecg-boot |
|
|
|
* @Date: 2021-11-10 |
|
|
|
* @Date: 2021-11-10 |
|
|
|
* @Version: V1.0 |
|
|
|
* @Version: V1.0 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Api(tags="zy_cloths_type") |
|
|
|
@Api(tags = "zy_cloths_type") |
|
|
|
@RestController |
|
|
|
@RestController |
|
|
|
@RequestMapping("/base/zyClothsType") |
|
|
|
@RequestMapping("/base/zyClothsType") |
|
|
|
@Slf4j |
|
|
|
@Slf4j |
|
|
@ -60,11 +62,11 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@AutoLog(value = "zy_cloths_type-分页列表查询") |
|
|
|
@AutoLog(value = "zy_cloths_type-分页列表查询") |
|
|
|
@ApiOperation(value="zy_cloths_type-分页列表查询", notes="zy_cloths_type-分页列表查询") |
|
|
|
@ApiOperation(value = "zy_cloths_type-分页列表查询", notes = "zy_cloths_type-分页列表查询") |
|
|
|
@GetMapping(value = "/list") |
|
|
|
@GetMapping(value = "/list") |
|
|
|
public Result<?> queryPageList(ZyClothsType zyClothsType, |
|
|
|
public Result<?> queryPageList(ZyClothsType zyClothsType, |
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
HttpServletRequest req) { |
|
|
|
HttpServletRequest req) { |
|
|
|
QueryWrapper<ZyClothsType> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap()); |
|
|
|
QueryWrapper<ZyClothsType> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap()); |
|
|
|
Page<ZyClothsType> page = new Page<ZyClothsType>(pageNo, pageSize); |
|
|
|
Page<ZyClothsType> page = new Page<ZyClothsType>(pageNo, pageSize); |
|
|
@ -79,9 +81,18 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@AutoLog(value = "zy_cloths_type-添加") |
|
|
|
@AutoLog(value = "zy_cloths_type-添加") |
|
|
|
@ApiOperation(value="zy_cloths_type-添加", notes="zy_cloths_type-添加") |
|
|
|
@ApiOperation(value = "zy_cloths_type-添加", notes = "zy_cloths_type-添加") |
|
|
|
@PostMapping(value = "/add") |
|
|
|
@PostMapping(value = "/add") |
|
|
|
public Result<?> add(@RequestBody ZyClothsType zyClothsType) { |
|
|
|
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层处理
|
|
|
|
//生成编号 nums,编号,varchar,10,非空,不重复,企业缩写(4)+顺序号(6)在service层处理
|
|
|
|
zyClothsType.setNums(zyClothsTypeService.generateNumber()); |
|
|
|
zyClothsType.setNums(zyClothsTypeService.generateNumber()); |
|
|
|
zyClothsTypeService.save(zyClothsType); |
|
|
|
zyClothsTypeService.save(zyClothsType); |
|
|
@ -95,7 +106,7 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@AutoLog(value = "zy_cloths_type-编辑") |
|
|
|
@AutoLog(value = "zy_cloths_type-编辑") |
|
|
|
@ApiOperation(value="zy_cloths_type-编辑", notes="zy_cloths_type-编辑") |
|
|
|
@ApiOperation(value = "zy_cloths_type-编辑", notes = "zy_cloths_type-编辑") |
|
|
|
@PutMapping(value = "/edit") |
|
|
|
@PutMapping(value = "/edit") |
|
|
|
public Result<?> edit(@RequestBody ZyClothsType zyClothsType) { |
|
|
|
public Result<?> edit(@RequestBody ZyClothsType zyClothsType) { |
|
|
|
zyClothsTypeService.updateById(zyClothsType); |
|
|
|
zyClothsTypeService.updateById(zyClothsType); |
|
|
@ -109,9 +120,9 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@AutoLog(value = "zy_cloths_type-通过id删除") |
|
|
|
@AutoLog(value = "zy_cloths_type-通过id删除") |
|
|
|
@ApiOperation(value="zy_cloths_type-通过id删除", notes="zy_cloths_type-通过id删除") |
|
|
|
@ApiOperation(value = "zy_cloths_type-通过id删除", notes = "zy_cloths_type-通过id删除") |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
|
|
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
|
|
|
zyClothsTypeService.removeById(id); |
|
|
|
zyClothsTypeService.removeById(id); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
} |
|
|
|
} |
|
|
@ -123,9 +134,9 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@AutoLog(value = "zy_cloths_type-批量删除") |
|
|
|
@AutoLog(value = "zy_cloths_type-批量删除") |
|
|
|
@ApiOperation(value="zy_cloths_type-批量删除", notes="zy_cloths_type-批量删除") |
|
|
|
@ApiOperation(value = "zy_cloths_type-批量删除", notes = "zy_cloths_type-批量删除") |
|
|
|
@DeleteMapping(value = "/deleteBatch") |
|
|
|
@DeleteMapping(value = "/deleteBatch") |
|
|
|
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
|
|
|
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
|
|
|
this.zyClothsTypeService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
|
this.zyClothsTypeService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
|
return Result.OK("批量删除成功!"); |
|
|
|
return Result.OK("批量删除成功!"); |
|
|
|
} |
|
|
|
} |
|
|
@ -137,11 +148,11 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@AutoLog(value = "zy_cloths_type-通过id查询") |
|
|
|
@AutoLog(value = "zy_cloths_type-通过id查询") |
|
|
|
@ApiOperation(value="zy_cloths_type-通过id查询", notes="zy_cloths_type-通过id查询") |
|
|
|
@ApiOperation(value = "zy_cloths_type-通过id查询", notes = "zy_cloths_type-通过id查询") |
|
|
|
@GetMapping(value = "/queryById") |
|
|
|
@GetMapping(value = "/queryById") |
|
|
|
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
|
|
|
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
|
|
|
ZyClothsType zyClothsType = zyClothsTypeService.getById(id); |
|
|
|
ZyClothsType zyClothsType = zyClothsTypeService.getById(id); |
|
|
|
if(zyClothsType==null) { |
|
|
|
if (zyClothsType == null) { |
|
|
|
return Result.error("未找到对应数据"); |
|
|
|
return Result.error("未找到对应数据"); |
|
|
|
} |
|
|
|
} |
|
|
|
return Result.OK(zyClothsType); |
|
|
|
return Result.OK(zyClothsType); |
|
|
|