|
|
@ -14,6 +14,7 @@ import org.jeecg.modules.demo.base.entity.ZyClothsType; |
|
|
|
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper; |
|
|
|
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper; |
|
|
|
import org.jeecg.modules.demo.base.service.IZyClothsTypeService; |
|
|
|
import org.jeecg.modules.demo.base.service.IZyClothsTypeService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
@ -79,6 +80,11 @@ 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) { |
|
|
|
|
|
|
|
//处理空值问题
|
|
|
|
|
|
|
|
// Result<?> resultEmpty = zyClothsTypeService.handleEmpty(zyClothsType);
|
|
|
|
|
|
|
|
// if (resultEmpty.getMessage().equals("都不为空")){
|
|
|
|
|
|
|
|
// return resultEmpty;
|
|
|
|
|
|
|
|
// }
|
|
|
|
if (StringUtils.isEmpty(zyClothsType.getNums())) { |
|
|
|
if (StringUtils.isEmpty(zyClothsType.getNums())) { |
|
|
|
return Result.error("服装类型编号 不能为空"); |
|
|
|
return Result.error("服装类型编号 不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
@ -207,5 +213,18 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo |
|
|
|
return Result.OK(a); |
|
|
|
return Result.OK(a); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getEnterpriseNum") |
|
|
|
|
|
|
|
public Result<?> enterpriseNum(@RequestParam(name = "id", required = true)String id) { |
|
|
|
|
|
|
|
if (StringUtils.isEmpty(id)) { |
|
|
|
|
|
|
|
return Result.error("请先选择一个企业"); |
|
|
|
|
|
|
|
} else if (id.contains(",")) { |
|
|
|
|
|
|
|
//id.contains(",") 判断是否字符中是否包含","
|
|
|
|
|
|
|
|
return Result.error("只能选择一个企业"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(id); |
|
|
|
|
|
|
|
//根据企业名称拿到企业编号
|
|
|
|
|
|
|
|
return Result.OK(zyClothsTypeService.getEnterpriseNums(enterpriseName)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|