|
|
@ -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; |
|
|
@ -82,6 +84,15 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo |
|
|
|
@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); |
|
|
|