diff --git a/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue
index 46651051..21485668 100644
--- a/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue
+++ b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue
@@ -1,275 +1,280 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/util/UniqueRanNumUtils.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/util/UniqueRanNumUtils.java
new file mode 100644
index 00000000..d9825785
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/util/UniqueRanNumUtils.java
@@ -0,0 +1,83 @@
+package org.jeecg.common.util;
+
+import java.util.Random;
+
+public class UniqueRanNumUtils {
+
+ /**
+ * 自定义进制(排除0,1,o,l)
+ */
+ private static final char[] CUSTOM = new char[]{'Q', 'W', 'E', '8', 'A', 'S', '2', 'D', 'Z', 'X', '9', 'C', '7', 'P', '5', 'I', 'K', '3', 'M', 'J', 'U', 'F', 'R', '4', 'V', 'Y', 'L', 'T', 'N', '6', 'B', 'G'};
+
+ /**
+ * 不能与自定义进制有重复
+ */
+ private static final char FLAG = 'H';
+
+ /**
+ * 进制长度
+ */
+ private static final int LENGTH = CUSTOM.length;
+
+ /**
+ * 序列最小长度
+ */
+ private static final int MINLENGTH = 6;
+
+ /**
+ * 根据ID生成六位随机码
+ * @return 随机码
+ */
+ public static String generateCode(long id) {
+ char[] buf = new char[32];
+ int charPos = 32;
+
+ while ((id / LENGTH) > 0) {
+ int ind = (int) (id % LENGTH);
+ buf[--charPos] = CUSTOM[ind];
+ id /= LENGTH;
+ }
+ buf[--charPos] = CUSTOM[(int) (id % LENGTH)];
+ String str = new String(buf, charPos, (32 - charPos));
+ // 不够长度的自动随机补全
+ if (str.length() < MINLENGTH) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(FLAG);
+ Random rnd = new Random();
+ for (int i = 1; i < MINLENGTH - str.length(); i++) {
+ sb.append(CUSTOM[rnd.nextInt(LENGTH)]);
+ }
+ str += sb.toString();
+ }
+ return str;
+ }
+
+ public static long codeToId(String code) {
+ char chs[] = code.toCharArray();
+ long res = 0L;
+ for (int i = 0; i < chs.length; i++) {
+ int ind = 0;
+ for (int j = 0; j < LENGTH; j++) {
+ if (chs[i] == CUSTOM[j]) {
+ ind = j;
+ break;
+ }
+ }
+ if (chs[i] == FLAG) {
+ break;
+ }
+ if (i > 0) {
+ res = res * LENGTH + ind;
+ } else {
+ res = ind;
+ }
+ }
+ return res;
+ }
+
+ public static void main(String[] args) {
+ for (int i = 0; i < 10; i++) {
+ System.out.println(generateCode(i));
+ }
+ }
+}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java
index 2a43b838..a7f5093d 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java
@@ -1,845 +1,852 @@
-package org.jeecg.modules.demo.zygoods.controller;
-
-import java.util.*;
-import java.util.stream.Collectors;
-import java.io.IOException;
-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;
-import org.jeecg.modules.demo.base.entity.ZyClothsModular;
-import org.jeecg.modules.demo.base.entity.ZyClothsType;
-import org.jeecg.modules.demo.base.service.IZyClothsModularService;
-import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
-import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories;
-import org.jeecg.modules.demo.goodsaccessories.service.IGoodsAccessoriesService;
-import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric;
-import org.jeecg.modules.demo.goodsfabric.service.IGoodsFabricService;
-import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule;
-import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService;
-import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
-import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService;
-import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccessories;
-import org.jeecg.modules.demo.zyaccessories.service.IZyStyleAccessoriesService;
-import org.jeecg.modules.demo.zygoods.entity.*;
-import org.jeecg.modules.demo.zygoods.service.IZyGoodsService;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.extern.slf4j.Slf4j;
-
-import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
-import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService;
-import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric;
-import org.jeecg.modules.zystylefabric.service.IZyStyleFabricService;
-import org.jeecg.modules.zystylemodel.entity.ZyStyleModel;
-import org.jeecg.modules.zystylemodel.service.IZyStyleModelService;
-import org.jeecg.modules.zystylemodule.entity.ZyStyleModule;
-import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-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.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.jeecg.common.aspect.annotation.AutoLog;
-
- /**
- * @Description: 商品表
- * @Author: jeecg-boot
- * @Date: 2022-12-07
- * @Version: V1.0
- */
-@Api(tags="商品表")
-@RestController
-@RequestMapping("/zygoods/zyGoods")
-@Slf4j
-public class ZyGoodsController extends JeecgController {
- @Autowired
- private IZyGoodsService zyGoodsService;
- @Autowired
- private IGoodsModuleService goodsModuleService;
- @Autowired
- private IZyStyleModuleService zyStyleModuleService;
- @Autowired
- private IZyClothsModularService zyClothsModularService;
- @Autowired
- private IZyClothsStyleService zyClothsStyleService;
- @Autowired
- private IZyStyleModelService zyStyleModelService;
- @Autowired
- private IZyClothsTypeService zyClothsTypeService;
- @Autowired
- private IZyStyleFabricService zyStyleFabricService;
- @Autowired
- private IZyStyleAccessoriesService zyStyleAccessoriesService;
- @Autowired
- private IGoodsAccessoriesService goodsAccessoriesService;
- @Autowired
- private IGoodsFabricService goodsFabricService;
- @Autowired
- private IOrderGoodsService orderGoodsService;
-
- /**
- * 分页列表查询
- *
- * @param zyGoods
- * @param pageNo
- * @param pageSize
- * @param req
- * @return
- */
- @AutoLog(value = "商品表-分页列表查询")
- @ApiOperation(value="商品表-分页列表查询", notes="商品表-分页列表查询")
- @GetMapping(value = "/list")
- public Result> queryPageList(ZyGoods zyGoods,
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
- HttpServletRequest req) {
- QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
- Page page = new Page(pageNo, pageSize);
- IPage pageList = zyGoodsService.page(page, queryWrapper);
- return Result.OK(pageList);
- }
-
- /**
- * 添加
- *
- * @param zyGoods
- * @return
- */
- @AutoLog(value = "商品表-添加")
- @ApiOperation(value="商品表-添加", notes="商品表-添加")
- @PostMapping(value = "/add")
- public Result> add(@RequestBody ZyGoods zyGoods,HttpServletRequest req) {
- ZyClothsStyle zyClothsStyle = zyClothsStyleService.getById(zyGoods.getStyleId());
- zyGoods.setSpecification(zyClothsStyle.getSpecification());
- zyGoods.setProductOverview(zyClothsStyle.getProductOverview());
- zyGoods.setStructure(zyClothsStyle.getStructure());
- zyGoods.setCharacteristic(zyClothsStyle.getCharacteristic());
- zyGoods.setFoldingPackaging(zyClothsStyle.getFoldingPackaging());
- zyGoods.setAccLogos(zyClothsStyle.getAccLogos());
- zyGoods.setSewingForm(zyClothsStyle.getSewingForm());
- zyGoodsService.save(zyGoods);
- ZyStyleModule zyStyleModule = new ZyStyleModule();
- QueryWrapper queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModule, req.getParameterMap());
- queryWrapperzsm.eq("style_id",zyGoods.getStyleId());
- List listzsm = zyStyleModuleService.list(queryWrapperzsm);
- for (int i = 0 ; i < listzsm.size() ; i++){
- GoodsModule goodsModule = new GoodsModule();
- goodsModule.setGoodsId(zyGoods.getId());
- goodsModule.setStyleId(zyGoods.getStyleId());
- goodsModule.setStyleModuleId(listzsm.get(i).getId());
- goodsModule.setModuleId(listzsm.get(i).getModularId());
- //部位暂时没有字段,zy_cloths_modular的place
- //goodsModule.setPlace();
- goodsModuleService.save(goodsModule);
- }
- ZyStyleFabric zyStyleFabric = new ZyStyleFabric();
- QueryWrapper queryWrapperzsf = QueryGenerator.initQueryWrapper(zyStyleFabric, req.getParameterMap());
- queryWrapperzsf.eq("style_id",zyGoods.getStyleId());
- List listzsf = zyStyleFabricService.list(queryWrapperzsf);
- for (int j = 0 ; j < listzsf.size() ; j++){
- GoodsFabric goodsFabric = new GoodsFabric();
- goodsFabric.setGoodsId(zyGoods.getId());
- goodsFabric.setFabricId(listzsf.get(j).getFabricId());
- goodsFabricService.save(goodsFabric);
- }
- ZyStyleAccessories zyStyleAccessories = new ZyStyleAccessories();
- QueryWrapper queryWrapperzsa = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap());
- queryWrapperzsa.eq("style_id",zyGoods.getStyleId());
- List listzsa = zyStyleAccessoriesService.list(queryWrapperzsa);
- for (int k = 0 ; k < listzsa.size() ; k++){
- GoodsAccessories goodsAccessories = new GoodsAccessories();
- goodsAccessories.setGoodsId(zyGoods.getId());
- goodsAccessories.setAccessoriesId(listzsa.get(k).getAccessoriesId());
- goodsAccessoriesService.save(goodsAccessories);
- }
- return Result.OK("添加成功!");
- }
-
- /**
- * 编辑
- *
- * @param zyGoods
- * @return
- */
- @AutoLog(value = "商品表-编辑")
- @ApiOperation(value="商品表-编辑", notes="商品表-编辑")
- @PutMapping(value = "/edit")
- public Result> edit(@RequestBody ZyGoods zyGoods,HttpServletRequest req) {
- ZyClothsStyle zyClothsStyle = zyClothsStyleService.getById(zyGoods.getStyleId());
- zyGoods.setSpecification(zyClothsStyle.getSpecification());
- zyGoods.setProductOverview(zyClothsStyle.getProductOverview());
- zyGoods.setStructure(zyClothsStyle.getStructure());
- zyGoods.setCharacteristic(zyClothsStyle.getCharacteristic());
- zyGoods.setFoldingPackaging(zyClothsStyle.getFoldingPackaging());
- zyGoods.setAccLogos(zyClothsStyle.getAccLogos());
- zyGoods.setSewingForm(zyClothsStyle.getSewingForm());
- zyGoodsService.updateById(zyGoods);
- GoodsModule goodsModule = new GoodsModule();
- QueryWrapper queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap());
- queryWrappergm.eq("goods_id",zyGoods.getId());
- goodsModuleService.remove(queryWrappergm);
- ZyStyleModule zyStyleModule = new ZyStyleModule();
- QueryWrapper queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModule, req.getParameterMap());
- queryWrapperzsm.eq("style_id",zyGoods.getStyleId());
- List listzsm = zyStyleModuleService.list(queryWrapperzsm);
- for (int i = 0 ; i < listzsm.size() ; i++){
- GoodsModule goodsModule1 = new GoodsModule();
- goodsModule1.setGoodsId(zyGoods.getId());
- goodsModule1.setStyleId(zyGoods.getStyleId());
- goodsModule1.setStyleModuleId(listzsm.get(i).getId());
- goodsModule1.setModuleId(listzsm.get(i).getModularId());
- //部位暂时没有字段,zy_cloths_modular的place
- //goodsModule1.setPlace();
- goodsModuleService.save(goodsModule1);
- }
- GoodsFabric goodsFabric = new GoodsFabric();
- QueryWrapper queryWrappergf = QueryGenerator.initQueryWrapper(goodsFabric, req.getParameterMap());
- queryWrappergf.eq("goods_id",zyGoods.getId());
- goodsFabricService.remove(queryWrappergf);
- ZyStyleFabric zyStyleFabric = new ZyStyleFabric();
- QueryWrapper queryWrapperzsf = QueryGenerator.initQueryWrapper(zyStyleFabric, req.getParameterMap());
- queryWrapperzsf.eq("style_id",zyGoods.getStyleId());
- List listzsf = zyStyleFabricService.list(queryWrapperzsf);
- for (int j = 0 ; j < listzsf.size() ; j++){
- GoodsFabric goodsFabric1 = new GoodsFabric();
- goodsFabric1.setGoodsId(zyGoods.getId());
- goodsFabric1.setFabricId(listzsf.get(j).getFabricId());
- goodsFabricService.save(goodsFabric1);
- }
- GoodsAccessories goodsAccessories = new GoodsAccessories();
- QueryWrapper queryWrapperga = QueryGenerator.initQueryWrapper(goodsAccessories, req.getParameterMap());
- queryWrapperga.eq("goods_id",zyGoods.getId());
- goodsAccessoriesService.remove(queryWrapperga);
- ZyStyleAccessories zyStyleAccessories = new ZyStyleAccessories();
- QueryWrapper queryWrapperzsa = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap());
- queryWrapperzsa.eq("style_id",zyGoods.getStyleId());
- List listzsa = zyStyleAccessoriesService.list(queryWrapperzsa);
- for (int k = 0 ; k < listzsa.size() ; k++){
- GoodsAccessories goodsAccessories1 = new GoodsAccessories();
- goodsAccessories1.setGoodsId(zyGoods.getId());
- goodsAccessories1.setAccessoriesId(listzsa.get(k).getAccessoriesId());
- goodsAccessoriesService.save(goodsAccessories1);
- }
- return Result.OK("编辑成功!");
- }
- /**
- * 更新商品辅料
- *
- * @param id
- * @return
- */
- @AutoLog(value = "更新商品辅料")
- @ApiOperation(value="更新商品辅料", notes="更新商品辅料")
- @GetMapping(value = "/upfl")
- public Result> upfl(@RequestParam(name="id",required=true) String id,HttpServletRequest req) {
- ZyGoods zyGoods = zyGoodsService.getById(id);
- GoodsAccessories goodsAccessories = new GoodsAccessories();
- QueryWrapper queryWrapperga = QueryGenerator.initQueryWrapper(goodsAccessories, req.getParameterMap());
- queryWrapperga.eq("goods_id",id);
- goodsAccessoriesService.remove(queryWrapperga);
- ZyStyleAccessories zyStyleAccessories = new ZyStyleAccessories();
- QueryWrapper queryWrapperzsa = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap());
- queryWrapperzsa.eq("style_id",zyGoods.getStyleId());
- List listzsa = zyStyleAccessoriesService.list(queryWrapperzsa);
- for (int k = 0 ; k < listzsa.size() ; k++){
- GoodsAccessories goodsAccessories1 = new GoodsAccessories();
- goodsAccessories1.setGoodsId(id);
- goodsAccessories1.setAccessoriesId(listzsa.get(k).getAccessoriesId());
- goodsAccessoriesService.save(goodsAccessories1);
- }
- return Result.OK("更新成功!");
- }
- /**
- * 更新商品模块
- *
- * @param id
- * @return
- */
- @AutoLog(value = "更新商品模块")
- @ApiOperation(value="更新商品模块", notes="更新商品模块")
- @GetMapping(value = "/upmk")
- public Result> upmk(@RequestParam(name="id",required=true) String id,HttpServletRequest req) {
- ZyGoods zyGoods = zyGoodsService.getById(id);
- GoodsModule goodsModule = new GoodsModule();
- QueryWrapper queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap());
- queryWrappergm.eq("goods_id",id);
- goodsModuleService.remove(queryWrappergm);
- ZyStyleModule zyStyleModule = new ZyStyleModule();
- QueryWrapper queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModule, req.getParameterMap());
- queryWrapperzsm.eq("style_id",zyGoods.getStyleId());
- List listzsm = zyStyleModuleService.list(queryWrapperzsm);
- for (int i = 0 ; i < listzsm.size() ; i++){
- GoodsModule goodsModule1 = new GoodsModule();
- goodsModule1.setGoodsId(id);
- goodsModule1.setStyleId(zyGoods.getStyleId());
- goodsModule1.setStyleModuleId(listzsm.get(i).getId());
- goodsModule1.setModuleId(listzsm.get(i).getModularId());
- //部位暂时没有字段,zy_cloths_modular的place
- //goodsModule1.setPlace();
- goodsModuleService.save(goodsModule1);
- }
- return Result.OK("更新成功!");
- }
- /**
- * 更新商品面料
- *
- * @param id
- * @return
- */
- @AutoLog(value = "更新商品面料")
- @ApiOperation(value="更新商品面料", notes="更新商品面料")
- @GetMapping(value = "/upml")
- public Result> upml(@RequestParam(name="id",required=true) String id,HttpServletRequest req) {
- ZyGoods zyGoods = zyGoodsService.getById(id);
- GoodsFabric goodsFabric = new GoodsFabric();
- QueryWrapper queryWrappergf = QueryGenerator.initQueryWrapper(goodsFabric, req.getParameterMap());
- queryWrappergf.eq("goods_id",zyGoods.getId());
- goodsFabricService.remove(queryWrappergf);
- ZyStyleFabric zyStyleFabric = new ZyStyleFabric();
- QueryWrapper queryWrapperzsf = QueryGenerator.initQueryWrapper(zyStyleFabric, req.getParameterMap());
- queryWrapperzsf.eq("style_id",zyGoods.getStyleId());
- List listzsf = zyStyleFabricService.list(queryWrapperzsf);
- for (int j = 0 ; j < listzsf.size() ; j++){
- GoodsFabric goodsFabric1 = new GoodsFabric();
- goodsFabric1.setGoodsId(zyGoods.getId());
- goodsFabric1.setFabricId(listzsf.get(j).getFabricId());
- goodsFabricService.save(goodsFabric1);
- }
- return Result.OK("更新成功!");
- }
-
- /**
- * 通过id删除
- *
- * @param id
- * @return
- */
- @AutoLog(value = "商品表-通过id删除")
- @ApiOperation(value="商品表-通过id删除", notes="商品表-通过id删除")
- @DeleteMapping(value = "/delete")
- public Result> delete(@RequestParam(name="id",required=true) String id,HttpServletRequest req) {
- zyGoodsService.removeById(id);
- GoodsModule goodsModule = new GoodsModule();
- QueryWrapper queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap());
- queryWrappergm.eq("goods_id",id);
- goodsModuleService.remove(queryWrappergm);
- return Result.OK("删除成功!");
- }
-
- /**
- * 批量删除
- *
- * @param ids
- * @return
- */
- @AutoLog(value = "商品表-批量删除")
- @ApiOperation(value="商品表-批量删除", notes="商品表-批量删除")
- @DeleteMapping(value = "/deleteBatch")
- public Result> deleteBatch(@RequestParam(name="ids",required=true) String ids,HttpServletRequest req) {
- this.zyGoodsService.removeByIds(Arrays.asList(ids.split(",")));
- String [] str = ids.split(",");
- for(int i = 0 ; i < str.length ; i++){
- GoodsModule goodsModule = new GoodsModule();
- QueryWrapper queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap());
- queryWrappergm.eq("goods_id",str[i]);
- goodsModuleService.remove(queryWrappergm);
- }
- return Result.OK("批量删除成功!");
- }
-
- /**
- * 通过id查询
- *
- * @param id
- * @return
- */
- @AutoLog(value = "商品表-通过id查询")
- @ApiOperation(value="商品表-通过id查询", notes="商品表-通过id查询")
- @GetMapping(value = "/queryById")
- public Result> queryById(@RequestParam(name="id",required=true) String id) {
- ZyGoods zyGoods = zyGoodsService.getById(id);
- if(zyGoods==null) {
- return Result.error("未找到对应数据");
- }
- return Result.OK(zyGoods);
- }
-
- /**
- * 动态获取商品编码
- *
- * @param
- * @return
- */
- @AutoLog(value = "商品表-通过id查询")
- @ApiOperation(value="商品表-通过id查询", notes="商品表-通过id查询")
- @GetMapping(value = "/getspbh")
- public Result> getspbh(@RequestParam(name="lxid",required=true) String lxid,@RequestParam(name="xhid",required=true) String xhid,HttpServletRequest req) {
- String spbh = "";
- ZyClothsType zyClothsType = zyClothsTypeService.getById(lxid);
- //服装类型编号
- String lxbh = zyClothsType.getNums();
- //型号编码
- ZyStyleModel zyStyleModel = zyStyleModelService.getById(xhid);
- String xhbm =zyStyleModel.getModelNumber();
- //顺序号
- String sxh = "";
- ZyGoods zyGoods = new ZyGoods();
- QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
- queryWrapper.eq("cloths_type_id",lxid);
- queryWrapper.eq("model_id",xhid);
- List list = zyGoodsService.list(queryWrapper);
- sxh = list.size()+1+"";
- spbh = lxbh + xhbm + sxh;
- return Result.OK(spbh);
- }
-
- /**
- * 动态服装款式
- *
- * @param
- * @return
- */
- @AutoLog(value = "商品表-通过id查询")
- @ApiOperation(value="商品表-通过id查询", notes="商品表-通过id查询")
- @GetMapping(value = "/getzystyle")
- public Result> getzystyle(@RequestParam(name="ksid",required=true) String ksid) {
- ZyClothsStyle zyClothsStyle = zyClothsStyleService.getById(ksid);
- return Result.OK(zyClothsStyle);
- }
-
- /**
- * 导出excel
- *
- * @param request
- * @param zyGoods
- */
- @RequestMapping(value = "/exportXls")
- public ModelAndView exportXls(HttpServletRequest request, ZyGoods zyGoods) {
- return super.exportXls(request, zyGoods, ZyGoods.class, "商品表");
- }
-
- /**
- * 通过excel导入数据
- *
- * @param request
- * @param response
- * @return
- */
- @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
- public Result> importExcel(HttpServletRequest request, HttpServletResponse response) {
- return super.importExcel(request, response, ZyGoods.class);
- }
- /**
- * 商城接口最新定制
- *
- * @param orderGoods
- * @param pageNo
- * @param pageSize
- * @param req
- * @return
- */
- @AutoLog(value = "最新定制")
- @ApiOperation(value="最新定制", notes="最新定制")
- @GetMapping(value = "/zxdz")
- public Result> zxdz(OrderGoods orderGoods,
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
- @RequestParam(name="pageSize", defaultValue="3") Integer pageSize,
- HttpServletRequest req) {
- QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap());
- queryWrapper.eq("customized",1);
- Page page = new Page(pageNo, pageSize);
- IPage pageList = orderGoodsService.page(page, queryWrapper);
- List zxdzList = new ArrayList();
- for(int i = 0 ; i < pageList.getRecords().size();i++){
- Zxdz zxdz = new Zxdz();
- zxdz.setId(pageList.getRecords().get(i).getId());
- zxdz.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageList.getRecords().get(i).getDefaultPicture());
- zxdz.setPrice(pageList.getRecords().get(i).getUnitPrice());
- zxdz.setTitle1(zyClothsTypeService.getById(pageList.getRecords().get(i).getClothsTypeId()).getTypeName());
- zxdz.setTitle2(pageList.getRecords().get(i).getGoodsName());
- zxdzList.add(zxdz);
- }
- return Result.OK(zxdzList);
- }
-
- /**
- * 商城接口推荐商品
- *
- * @param zyGoods
- * @param pageNo
- * @param pageSize
- * @param req
- * @return
- */
- @AutoLog(value = "推荐商品")
- @ApiOperation(value="推荐商品", notes="推荐商品")
- @GetMapping(value = "/tjsp")
- public Result> tjsp(ZyGoods zyGoods,
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
- @RequestParam(name="pageSize", defaultValue="3") Integer pageSize,
- HttpServletRequest req) {
- QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
- queryWrapper.eq("recommend",1);
- Page page = new Page(pageNo, pageSize);
- IPage pageList = zyGoodsService.page(page, queryWrapper);
- List tcspList = new ArrayList();
- for(int i = 0 ; i < pageList.getRecords().size();i++){
- Tcsp tcsp = new Tcsp();
- tcsp.setId(pageList.getRecords().get(i).getId());
- tcsp.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageList.getRecords().get(i).getDefaultPicture());
- tcsp.setTime(pageList.getRecords().get(i).getUnitPrice());
- tcsp.setTitle(pageList.getRecords().get(i).getGoodsName());
- tcspList.add(tcsp);
- }
- return Result.OK(tcspList);
- }
- /**
- * 商城接口服装类型
- *
- * @param zyGoods
- * @param req
- * @return
- */
- @AutoLog(value = "服装类型")
- @ApiOperation(value="服装类型", notes="服装类型")
- @GetMapping(value = "/fzlx")
- public Result> fzlx(ZyGoods zyGoods,HttpServletRequest req,
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
- Map> map = new HashMap<>();
- //男装
- ZyClothsType zyClothsType = new ZyClothsType();
- QueryWrapper queryWrapperzlt1 = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap());
- queryWrapperzlt1.eq("type_name","男装");
- ZyClothsType zyClothsType2 = zyClothsTypeService.getOne(queryWrapperzlt1);
- QueryWrapper queryWrapperzlt2 = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap());
- queryWrapperzlt2.eq("type_id",zyClothsType2.getId());
- List listzct = zyClothsTypeService.list(queryWrapperzlt2);
- String ids = "";
- for (int i = 0 ; i < listzct.size() ; i++){
- ids = ids + listzct.get(i).getId()+",";
- }
- String [] str = ids.substring(0,ids.length()-1).split(",");
- QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
- queryWrapper.in("cloths_type_id",str);
- Page page = new Page(pageNo, pageSize);
- IPage pageList = zyGoodsService.page(page, queryWrapper);
- List nfzlxList = new ArrayList();
- for(int j = 0 ; j < pageList.getRecords().size();j++){
- Fzlx fzlx = new Fzlx();
- fzlx.setId(pageList.getRecords().get(j).getId());
- fzlx.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageList.getRecords().get(j).getDefaultPicture());
- fzlx.setTitle1(zyClothsTypeService.getById(pageList.getRecords().get(j).getClothsTypeId()).getTypeName());
- fzlx.setTitle2(pageList.getRecords().get(j).getGoodsName());
- String tag1 = zyClothsStyleService.getById(pageList.getRecords().get(j).getStyleId()).getCharacteristic();
- if(tag1.length()>7){
- fzlx.setTag1(tag1.substring(0,7)+"...");
- }else{
- fzlx.setTag1(tag1);
- }
- String tag2 = zyClothsStyleService.getById(pageList.getRecords().get(j).getStyleId()).getStructure();
- if(tag2.length()>7){
- fzlx.setTag2(tag2.substring(0,7)+"...");
- }else{
- fzlx.setTag2(tag2);
- }
- fzlx.setPrice(pageList.getRecords().get(j).getUnitPrice());
- fzlx.setSold(pageList.getRecords().get(j).getNum());
- nfzlxList.add(fzlx);
- }
- map.put("nz",nfzlxList);
- //女装
- ZyClothsType zyClothsTypen = new ZyClothsType();
- QueryWrapper queryWrapperzlt1n = QueryGenerator.initQueryWrapper(zyClothsTypen, req.getParameterMap());
- queryWrapperzlt1n.eq("type_name","女装");
- ZyClothsType zyClothsType2n = zyClothsTypeService.getOne(queryWrapperzlt1n);
- QueryWrapper queryWrapperzlt2n = QueryGenerator.initQueryWrapper(zyClothsTypen, req.getParameterMap());
- queryWrapperzlt2n.eq("type_id",zyClothsType2n.getId());
- List listzctn = zyClothsTypeService.list(queryWrapperzlt2n);
- String idsn = "";
- for (int k = 0 ; k < listzctn.size() ; k++){
- idsn = idsn + listzctn.get(k).getId()+",";
- }
- String [] strn = idsn.substring(0,idsn.length()-1).split(",");
- QueryWrapper queryWrappern = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
- queryWrappern.in("cloths_type_id",strn);
- Page pagen = new Page(pageNo, pageSize);
- IPage pageListn = zyGoodsService.page(pagen, queryWrappern);
- List nfzlxListn = new ArrayList();
- for(int l = 0 ; l < pageListn.getRecords().size();l++){
- Fzlx fzlx = new Fzlx();
- fzlx.setId(pageListn.getRecords().get(l).getId());
- fzlx.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageListn.getRecords().get(l).getDefaultPicture());
- fzlx.setTitle1(zyClothsTypeService.getById(pageListn.getRecords().get(l).getClothsTypeId()).getTypeName());
- fzlx.setTitle2(pageListn.getRecords().get(l).getGoodsName());
- String tag1 = zyClothsStyleService.getById(pageListn.getRecords().get(l).getStyleId()).getCharacteristic();
- if(tag1.length()>7){
- fzlx.setTag1(tag1.substring(0,7)+"...");
- }else{
- fzlx.setTag1(tag1);
- }
- String tag2 = zyClothsStyleService.getById(pageListn.getRecords().get(l).getStyleId()).getStructure();
- if(tag2.length()>7){
- fzlx.setTag2(tag2.substring(0,7)+"...");
- }else{
- fzlx.setTag2(tag2);
- }
- fzlx.setPrice(pageListn.getRecords().get(l).getUnitPrice());
- fzlx.setSold(pageListn.getRecords().get(l).getNum());
- nfzlxListn.add(fzlx);
- }
- map.put("nvz",nfzlxListn);
- //童装
- ZyClothsType zyClothsTypet = new ZyClothsType();
- QueryWrapper queryWrapperzlt1t = QueryGenerator.initQueryWrapper(zyClothsTypet, req.getParameterMap());
- queryWrapperzlt1t.eq("type_name","童装");
- ZyClothsType zyClothsType2t = zyClothsTypeService.getOne(queryWrapperzlt1t);
- QueryWrapper queryWrapperzlt2t = QueryGenerator.initQueryWrapper(zyClothsTypet, req.getParameterMap());
- queryWrapperzlt2t.eq("type_id",zyClothsType2t.getId());
- List listzctt = zyClothsTypeService.list(queryWrapperzlt2t);
- String idst = "";
- for (int m = 0 ; m < listzctt.size() ; m++){
- idst = idst + listzctt.get(m).getId()+",";
- }
- String [] strt = idst.substring(0,idst.length()-1).split(",");
- QueryWrapper queryWrappert = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
- queryWrappert.in("cloths_type_id",strt);
- Page paget = new Page(pageNo, pageSize);
- IPage pageListt = zyGoodsService.page(paget, queryWrappert);
- List nfzlxListt = new ArrayList();
- for(int n = 0 ; n < pageListt.getRecords().size();n++){
- Fzlx fzlx = new Fzlx();
- fzlx.setId(pageListt.getRecords().get(n).getId());
- fzlx.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageListt.getRecords().get(n).getDefaultPicture());
- fzlx.setTitle1(zyClothsTypeService.getById(pageListt.getRecords().get(n).getClothsTypeId()).getTypeName());
- fzlx.setTitle2(pageListt.getRecords().get(n).getGoodsName());
- String tag1 = zyClothsStyleService.getById(pageListt.getRecords().get(n).getStyleId()).getCharacteristic();
- if(tag1.length()>7){
- fzlx.setTag1(tag1.substring(0,7)+"...");
- }else{
- fzlx.setTag1(tag1);
- }
- String tag2 = zyClothsStyleService.getById(pageListt.getRecords().get(n).getStyleId()).getStructure();
- if(tag2.length()>7){
- fzlx.setTag2(tag2.substring(0,7)+"...");
- }else{
- fzlx.setTag2(tag2);
- }
- fzlx.setPrice(pageListt.getRecords().get(n).getUnitPrice());
- fzlx.setSold(pageListt.getRecords().get(n).getNum());
- nfzlxListt.add(fzlx);
- }
- map.put("tz",nfzlxListt);
- return Result.OK(map);
- }
- /**
- * 商城接口服装类型菜单
- *
- * @param req
- * @return
- */
- @AutoLog(value = "类型菜单")
- @ApiOperation(value="类型菜单", notes="类型菜单")
- @GetMapping(value = "/cd")
- public Result> cd(HttpServletRequest req) {
- List