|
|
|
@ -1,13 +1,12 @@ |
|
|
|
|
package org.jeecg.modules.zyclothsstyle.controller; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
import java.net.URLDecoder; |
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
|
@ -32,6 +31,7 @@ import org.jeecg.modules.demo.pro.entity.ZyProcessComponent; |
|
|
|
|
import org.jeecg.modules.system.entity.SysDepart; |
|
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
|
|
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; |
|
|
|
|
import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper; |
|
|
|
|
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; |
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil; |
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
|
|
|
@ -40,6 +40,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; |
|
|
|
@ -72,6 +73,9 @@ public class ZyClothsStyleController extends JeecgController<ZyClothsStyle, IZyC |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsTypeService zyClothsTypeService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private ZyClothsStyleMapper zyClothsStyleMapper; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
@ -160,13 +164,16 @@ public class ZyClothsStyleController extends JeecgController<ZyClothsStyle, IZyC |
|
|
|
|
@PostMapping(value = "/add") |
|
|
|
|
public Result<?> add(@RequestBody ZyClothsStyle zyClothsStyle) { |
|
|
|
|
//生成编号 类型编号(10位)+顺序号(8位)在service层处理
|
|
|
|
|
zyClothsStyle.setNums(zyClothsStyleService.generateNumber(zyClothsStyle)); |
|
|
|
|
//zyClothsStyle.setNums(zyClothsStyleService.generateNumber(zyClothsStyle));
|
|
|
|
|
//同类型的款式名称不能重复
|
|
|
|
|
if (StringUtils.isEmpty(zyClothsStyle.getTypeName())) { |
|
|
|
|
return Result.error("添加失败!服装类型不能为空"); |
|
|
|
|
} |
|
|
|
|
LambdaQueryWrapper<ZyClothsStyle> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper.eq(ZyClothsStyle::getTypeName, zyClothsStyle.getTypeName()); |
|
|
|
|
List<ZyClothsStyle> zyClothsStyleList = zyClothsStyleService.list(queryWrapper); |
|
|
|
|
for (ZyClothsStyle zy : zyClothsStyleList) { |
|
|
|
|
if (zyClothsStyle.getStyleNames().equals(zy.getStyleNames())){ |
|
|
|
|
if (zyClothsStyle.getStyleNames().equals(zy.getStyleNames())) { |
|
|
|
|
return Result.error("添加失败!数据已存在"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -174,6 +181,21 @@ public class ZyClothsStyleController extends JeecgController<ZyClothsStyle, IZyC |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* getAction的url sort 编码 |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "顺序查询") |
|
|
|
|
@ApiOperation(value = "顺序查询", notes = "顺序查询") |
|
|
|
|
@GetMapping(value = "/sort") |
|
|
|
|
public Result<?> sort(@RequestParam(name = "id", required = true) String id) { |
|
|
|
|
String sort = zyClothsStyleService.sort(id); |
|
|
|
|
System.err.println(sort+ " sort"); |
|
|
|
|
if (StringUtils.isEmpty(sort)) { |
|
|
|
|
return Result.OK(0); |
|
|
|
|
} |
|
|
|
|
return Result.OK(sort); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑 |
|
|
|
|
* |
|
|
|
|