2022-12-21 修改产品管理部分问题

zhc4dev
赵玉瑞 2 years ago
parent 2d8ee916ba
commit 0034478570
  1. 1
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java
  2. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/controller/ZyClothsStyleController.java
  3. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java
  4. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModel.java
  5. 57
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/impl/ZyStyleModelServiceImpl.java
  6. 113
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/controller/ZyStyleModuleController.java
  7. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/mapper/ZyStyleModuleMapper.java
  8. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/IZyStyleModuleService.java
  9. 50
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodule/service/impl/ZyStyleModuleServiceImpl.java

@ -47,7 +47,6 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
* */
@Override
public String sort() {
return zyClothsTypeMapper.sort();
}

@ -128,7 +128,7 @@ public class ZyClothsStyleController extends JeecgController<ZyClothsStyle, IZyC
@ApiOperation(value = "服装款式详情", notes = "根据服装款式id进行查询")
@GetMapping(value = "/detail")
public Result<?> detail(@RequestParam(name = "id", required = true) String id) {
System.out.println("controller层接受到的id: styleId: "+id);
System.out.println("服装款式详情 /detail controller层接受到的id: styleId: "+id);
AllClothStyle allClothStyle = zyClothsStyleService.queryDetail(id);
return Result.OK(allClothStyle);
}

@ -95,7 +95,7 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
}else {
zyClothsStyle.setEnterpriseId("null");
}
System.out.println("zyClothsStyle 服装款式详情"+zyClothsStyle);
//System.out.println("zyClothsStyle 服装款式详情"+zyClothsStyle);
List<ZyClothsStyle> zyClothsStyles = new ArrayList<>();
zyClothsStyles.add(zyClothsStyle);
return zyClothsStyles;

@ -44,28 +44,36 @@ public class ZyStyleModel implements Serializable {
/**是否默认尺码*/
@Excel(name = "是否默认尺码", width = 15)
@ApiModelProperty(value = "是否默认尺码")
//dictCode: 'isdefault',
private java.lang.Integer isdefault;
/**是否默认尺码*/
@TableField(exist = false)
private String isDefaultSize;
/**型号编码*/
@Excel(name = "型号编码", width = 15)
@ApiModelProperty(value = "型号编码")
//dictCode: 'modenumber'
private java.lang.String modelNumber;
/**码数*/
@Excel(name = "码数", width = 15)
@ApiModelProperty(value = "码数")
//dictCode: 'size'
private java.lang.Integer size;
/**型*/
@Excel(name = "型", width = 15)
@ApiModelProperty(value = "型")
//dictCode: 'hsize'
private java.lang.String anumbers;
/**号*/
@Excel(name = "号", width = 15)
@ApiModelProperty(value = "号")
//dictCode: 'xsize'
private java.lang.String bnumbers;
/**领大*/
@Excel(name = "领大", width = 15)
@ApiModelProperty(value = "领大")

@ -37,6 +37,7 @@ public class ZyStyleModelServiceImpl extends ServiceImpl<ZyStyleModelMapper, ZyS
} else {
zy.setStyleId(null);
}
//是否默认尺码
Integer isDefault = zy.getIsdefault();
if (isDefault == 0) {
zy.setIsDefaultSize("否");
@ -45,7 +46,63 @@ public class ZyStyleModelServiceImpl extends ServiceImpl<ZyStyleModelMapper, ZyS
} else {
zy.setIsDefaultSize(null);
}
//码数
zy.setSize(zy.getSize()+36);
//型
zy.setAnumbers(aHandleNumber(zy.getAnumbers()));
//号
zy.setBnumbers(bHandleNumber(zy.getBnumbers()));
}
return zyStyleModels;
}
public String aHandleNumber(String num){
if (StringUtils.isEmpty(num)){
return "null";
}
switch (num) {
case "1":
return "80A";
case "2":
return "84A";
case "3":
return "88A";
case "4":
return "92A";
case "5":
return "96A";
case "6":
return "100A";
case "7":
return "104A";
case "8":
return "108A";
case "9":
return "112A";
}
return num;
}
public String bHandleNumber(String num){
if (StringUtils.isEmpty(num)){
return "null";
}
switch (num) {
case "1":
return "160";
case "2":
return "165";
case "3":
return "170";
case "4":
return "175";
case "5":
return "180";
case "6":
return "185";
}
return num;
}
}

@ -25,9 +25,11 @@ import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService;
import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper;
import org.jeecg.modules.zystylemodule.entity.NewStyleModule;
import org.jeecg.modules.zystylemodule.entity.ZyStyleModule;
import org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper;
import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService;
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.servlet.ModelAndView;
import io.swagger.annotations.Api;
@ -54,7 +56,8 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
@Resource
private ZyStyleFabricMapper zyStyleFabricMapper;
@Resource
private ZyStyleModuleMapper zyStyleModuleMapper;
/**
* 分页列表查询
@ -72,64 +75,40 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
System.err.println("ZyStyleModule 款式模块表 传来的 " + id);
//List<NewStyleModule> listNewStyleModules = new ArrayList<>();
//QueryWrapper<ZyStyleModule> queryWrapper = new QueryWrapper<>();
List<ZyStyleModule> zyStyleModules = zyStyleModuleMapper.getListByStyleId(id);
List<NewStyleModule> newStyleModuleList = zyStyleModuleService.changeList(zyStyleModules);
List<NewStyleModule> listNewStyleModules = new ArrayList<>();
QueryWrapper<ZyStyleModule> queryWrapper = new QueryWrapper<>();
System.err.println("ZyStyleModule 款式模块表 传来的 "+id);
if (id != null) {
queryWrapper.eq("style_id", id);
}
if (zyStyleModule2.getStyleId() != null || zyStyleModule2.getModularId() != null || zyStyleModule2.getTypeId() != null) {
if (zyStyleModule2.getStyleId() != null) {
queryWrapper.eq("style_id", zyStyleModule2.getStyleId());
}
if (zyStyleModule2.getModularId() != null) {
queryWrapper.eq("modular_id", zyStyleModule2.getModularId());
}
if (zyStyleModule2.getTypeId() != null) {
queryWrapper.eq("type_id", zyStyleModule2.getTypeId());
}
}
List<ZyStyleModule> list = zyStyleModuleService.list(queryWrapper);
for (ZyStyleModule zyStyleModule : list) {
NewStyleModule newSeMo = new NewStyleModule();
//编辑回显
newSeMo.setId(zyStyleModule.getId());
newSeMo.setTypeId(zyStyleModule.getTypeId());
newSeMo.setStyleId(zyStyleModule.getStyleId());
newSeMo.setModularId(zyStyleModule.getModularId());
//款式编号和名称
String styleId = zyStyleModule.getStyleId();
ZyClothsStyle styleById = zyClothsStyleService.getById(styleId);
newSeMo.setStyleNums(styleById.getNums());
newSeMo.setStyleNames(styleById.getStyleNames());
//模块编号和名称
String modularId = zyStyleModule.getModularId();
ZyClothsModular modularById = zyClothsModularService.getById(modularId);
newSeMo.setModularNums(modularById.getNums());
newSeMo.setModularName(modularById.getModularName());
newSeMo.setCreateTime(zyStyleModule.getCreateTime());
//服装类型 服装类型的id 不知道什么情况 传的是zy_cloths_style中的type_id
//String styleId1 = zyStyleModule.getStyleId();
String typeName = zyStyleFabricMapper.getTypeName(zyStyleModule.getStyleId());
//System.out.println(typeId);
//String typeNameByTypeId = zyClothsStyleMapper.getTypeNameByTypeId(typeId);
//System.err.println(typeNameByTypeId);
if (typeName != null){
newSeMo.setTypeName(typeName);
} else {
newSeMo.setTypeName("typeName为空");
}
listNewStyleModules.add(newSeMo);
}
IPage<NewStyleModule> pageList = new Page<>(pageNo, pageSize, listNewStyleModules.size());
pageList.setRecords(listNewStyleModules);
//System.out.println(pageList.getRecords());
IPage<NewStyleModule> pageList = new Page<>(pageNo, pageSize, newStyleModuleList.size());
pageList.setRecords(newStyleModuleList);
return Result.OK(pageList);
}
// if (id != null) {
// queryWrapper.eq("style_id", id);
// }
// if (zyStyleModule2.getStyleId() != null || zyStyleModule2.getModularId() != null || zyStyleModule2.getTypeId() != null) {
// if (zyStyleModule2.getStyleId() != null) {
// queryWrapper.eq("style_id", zyStyleModule2.getStyleId());
// }
// if (zyStyleModule2.getModularId() != null) {
// queryWrapper.eq("modular_id", zyStyleModule2.getModularId());
// }
// if (zyStyleModule2.getTypeId() != null) {
// queryWrapper.eq("type_id", zyStyleModule2.getTypeId());
// }
// }
// List<ZyStyleModule> list = zyStyleModuleService.list(queryWrapper);
// for (ZyStyleModule zyStyleModule : list) {
// listNewStyleModules.add(newSeMo);
// }
/**
* 分页列表查询
*
@ -166,15 +145,15 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
@PostMapping(value = "/add")
public Result<Object> add(@RequestBody ZyStyleModule zyStyleModule) {
String[] split = zyStyleModule.getModularId().split(",");
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("type_id",zyStyleModule.getTypeId());
queryWrapper.eq("style_id",zyStyleModule.getStyleId());
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("type_id", zyStyleModule.getTypeId());
queryWrapper.eq("style_id", zyStyleModule.getStyleId());
for (String s : split) {
zyStyleModule.setModularId(s);
zyStyleModule.setId(null);
queryWrapper.eq("modular_id",zyStyleModule.getModularId());
int a=zyStyleModuleService.count(queryWrapper);
if(a>=1)
queryWrapper.eq("modular_id", zyStyleModule.getModularId());
int a = zyStyleModuleService.count(queryWrapper);
if (a >= 1)
return Result.error("存在以添加过的数据!!!");
zyStyleModuleService.save(zyStyleModule);
}
@ -193,12 +172,12 @@ public class ZyStyleModuleController extends JeecgController<ZyStyleModule, IZyS
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_module:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<Object> edit(@RequestBody ZyStyleModule zyStyleModule) {
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("type_id",zyStyleModule.getTypeId());
queryWrapper.eq("style_id",zyStyleModule.getStyleId());
queryWrapper.eq("modular_id",zyStyleModule.getModularId());
int a=zyStyleModuleService.count(queryWrapper);
if(a>=1)
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("type_id", zyStyleModule.getTypeId());
queryWrapper.eq("style_id", zyStyleModule.getStyleId());
queryWrapper.eq("modular_id", zyStyleModule.getModularId());
int a = zyStyleModuleService.count(queryWrapper);
if (a >= 1)
return Result.error("修改失败,数据已存在!!!");
zyStyleModuleService.updateById(zyStyleModule);
return Result.OK("编辑成功!");

@ -5,6 +5,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.zystylemodule.entity.ZyStyleModule;
/**
@ -17,4 +18,7 @@ public interface ZyStyleModuleMapper extends BaseMapper<ZyStyleModule> {
/**根据服装款式的id style_id 查询所有*/
List<ZyStyleModule> handWritingList(String id);
@Select("SELECT * FROM zy_style_module WHERE style_id = #{id}")
List<ZyStyleModule> getListByStyleId(String id);
}

@ -16,4 +16,11 @@ import java.util.List;
public interface IZyStyleModuleService extends IService<ZyStyleModule> {
List<NewStyleModule> detail(String id);
/**
* @param zyStyleModules 原始数据List<ZyStyleModule>
* @return 新List类型NewStyleModule
*/
List<NewStyleModule> changeList(List<ZyStyleModule> zyStyleModules);
}

@ -14,11 +14,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* @Description: 款式模块表
@ -42,46 +44,40 @@ public class ZyStyleModuleServiceImpl extends ServiceImpl<ZyStyleModuleMapper, Z
@Override
public List<NewStyleModule> detail(String id) {
List<ZyStyleModule> list = zyStyleModuleMapper.handWritingList(id);
return changeList(list);
}
@Override
public List<NewStyleModule> changeList(List<ZyStyleModule> zyStyleModules) {
List<NewStyleModule> newStyleModuleList = new ArrayList<>();
for (ZyStyleModule zyStyleModule : list) {
for (ZyStyleModule zy : zyStyleModules) {
NewStyleModule newSeMo = new NewStyleModule();
//编辑回显
newSeMo.setId(zyStyleModule.getId());
newSeMo.setTypeId(zyStyleModule.getTypeId());
newSeMo.setStyleId(zyStyleModule.getStyleId());
newSeMo.setModularId(zyStyleModule.getModularId());
newSeMo.setId(zy.getId());
newSeMo.setTypeId(zy.getTypeId());
newSeMo.setStyleId(zy.getStyleId());
newSeMo.setModularId(zy.getModularId());
//款式编号和名称
String styleId = zyStyleModule.getStyleId();
ZyClothsStyle styleById = zyClothsStyleService.getById(styleId);
newSeMo.setStyleNums(styleById.getNums());
newSeMo.setStyleNames(styleById.getStyleNames());
ZyClothsStyle styleById = zyClothsStyleService.getById(zy.getStyleId());
if (!ObjectUtils.isEmpty(styleById)){
newSeMo.setStyleNums(styleById.getNums());
newSeMo.setStyleNames(styleById.getStyleNames());
}
//模块编号和名称
String modularId = zyStyleModule.getModularId();
ZyClothsModular modularById = zyClothsModularService.getById(modularId);
if(StringUtils.isEmpty(modularById)){
newSeMo.setModularNums("null");
newSeMo.setModularName("null");
}else {
ZyClothsModular modularById = zyClothsModularService.getById(zy.getModularId());
if (!Objects.isNull(modularById)){
newSeMo.setModularNums(modularById.getNums());
newSeMo.setModularName(modularById.getModularName());
}
newSeMo.setCreateTime(zyStyleModule.getCreateTime());
newSeMo.setCreateTime(zy.getCreateTime());
//服装类型 服装类型的id 不知道什么情况 传的是zy_cloths_style中的type_id
//String styleId1 = zyStyleModule.getStyleId();
String typeName = zyStyleFabricMapper.getTypeName(zyStyleModule.getStyleId());
//System.out.println(typeId);
//String typeNameByTypeId = zyClothsStyleMapper.getTypeNameByTypeId(typeId);
//System.err.println(typeNameByTypeId);
if (typeName != null){
String typeName = zyStyleFabricMapper.getTypeName(zy.getStyleId());
if (StringUtils.hasText(typeName)) {
newSeMo.setTypeName(typeName);
} else {
newSeMo.setTypeName("typeName为空");
}
newStyleModuleList.add(newSeMo);
}
return newStyleModuleList;
}
}

Loading…
Cancel
Save