2022-12-07 赵玉瑞 修改产品管理部分问题

zhc4dev
赵玉瑞 2 years ago
parent 25f8a3e7de
commit f8adb529b2
  1. 10
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularCompentForm.vue
  2. 2
      ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue
  3. 2
      ant-design-vue-jeecg/src/views/zystylefabric/ZyStyleFabricList.vue
  4. 4
      ant-design-vue-jeecg/src/views/zystylemodular/ZyStyleModularList.vue
  5. 2
      ant-design-vue-jeecg/src/views/zystylemodule/ZyStyleModuleList.vue
  6. 57
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  7. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
  8. 5
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsTypeMapper.xml
  9. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
  10. 10
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java
  11. 8
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsTypeServiceImpl.java
  12. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsstyle/service/impl/ZyClothsStyleServiceImpl.java

@ -23,6 +23,7 @@
org-fields="nums,parts_name" org-fields="nums,parts_name"
dest-fields="nums,partsName" dest-fields="nums,partsName"
code="parts_name" code="parts_name"
@input="popupCallback"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -53,8 +54,7 @@
export default { export default {
name: 'ZyClothsModularCompentForm', name: 'ZyClothsModularCompentForm',
components: { components: {},
},
props: { props: {
// //
disabled: { disabled: {
@ -77,8 +77,7 @@
sm: {span: 16}, sm: {span: 16},
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {},
},
url: { url: {
add: "/base/zyClothsModularCompent/add", add: "/base/zyClothsModularCompent/add",
edit: "/base/zyClothsModularCompent/edit", edit: "/base/zyClothsModularCompent/edit",
@ -133,6 +132,9 @@
}) })
}, },
popupCallback(value, row) {
this.model = Object.assign(this.model, row);
},
} }
} }
</script> </script>

@ -56,7 +56,7 @@
<a-icon type="down"/> <a-icon type="down"/>
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<a-button type="primary" @click="fanHui()">返回</a-button> <a-button type="primary" style="left: 80%" @click="fanHui()">返回</a-button>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->

@ -48,7 +48,7 @@
<a-icon type="down"/> <a-icon type="down"/>
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<a-button type="primary" @click="fanHui()">返回</a-button> <a-button type="primary" style="left: 80%" @click="fanHui()">返回</a-button>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->

@ -5,11 +5,13 @@
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col> <a-col>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a-button type="primary">{{biaoTi}}</a-button>-->
<a-button type="primary">{{biaoTi}}</a-button> <a-button type="primary">{{biaoTi}}</a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<br/>
<!-- 查询区域-END --> <!-- 查询区域-END -->
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
@ -34,7 +36,7 @@
<a-icon type="down"/> <a-icon type="down"/>
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<a-button type="primary" @click="fanHui()">返回</a-button> <a-button type="primary" style="left: 80%" @click="fanHui()">返回</a-button>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->

@ -57,7 +57,7 @@
<a-icon type="down"/> <a-icon type="down"/>
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<a-button type="primary" @click="fanHui()">返回</a-button> <a-button type="primary" style="left: 80%" @click="fanHui()">返回</a-button>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>

@ -1,42 +1,29 @@
package org.jeecg.modules.demo.base.controller; package org.jeecg.modules.demo.base.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
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.ZyClothsType;
import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecg.common.aspect.annotation.AutoLog;
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.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.base.entity.ZyClothsType;
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper;
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.StringUtils; 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.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api; import javax.annotation.Resource;
import io.swagger.annotations.ApiOperation; import javax.servlet.http.HttpServletRequest;
import org.jeecg.common.aspect.annotation.AutoLog; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
/** /**
* @Description: zy_cloths_type * @Description: zy_cloths_type
@ -51,6 +38,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClothsTypeService> { public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClothsTypeService> {
@Autowired @Autowired
private IZyClothsTypeService zyClothsTypeService; private IZyClothsTypeService zyClothsTypeService;
@Resource
private ZyClothsTypeMapper zyClothsTypeMapper;
/** /**
* 分页列表查询 * 分页列表查询
@ -84,15 +73,25 @@ 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,非空,同类型下不重复 //type_name,类型名称,varchar,50,非空,同类型下不重复
String typeName = zyClothsType.getTypeName(); String typeName = zyClothsType.getTypeName();
if (!StringUtils.hasText(typeName)) { if (!StringUtils.hasText(typeName)) {
return Result.error("类型名称 不能为空"); return Result.error("类型名称 不能为空");
} }
//类型名称输入时没有最大长度限制,提交时才提示。前端校验、后台校验
if (typeName.length() > 10) { if (typeName.length() > 10) {
return Result.error("类型名称长度不能超过10"); return Result.error("类型名称长度不能超过10");
} }
//类型名称 同类型下不重复
if (!StringUtils.isEmpty(zyClothsType.getTypeId())) {
String typeId = zyClothsType.getTypeId();
List<String> zyClothsTypeList = zyClothsTypeMapper.listByTypeId(typeId);
zyClothsTypeList.add(zyClothsType.getTypeName());
HashSet<String> set = new HashSet<>(zyClothsTypeList);
if (set.size() != zyClothsTypeList.size()){
return Result.error("同类型下 类型名称不能重复");
}
}
//生成编号 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);

@ -15,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface ZyClothsTypeMapper extends BaseMapper<ZyClothsType> { public interface ZyClothsTypeMapper extends BaseMapper<ZyClothsType> {
List<String> selectNumsList(); List<String> selectNumsList();
List<String> listByTypeId(String typeId);
} }

@ -6,4 +6,9 @@
SELECT nums SELECT nums
FROM zy_cloths_type FROM zy_cloths_type
</select> </select>
<select id="listByTypeId" resultType="java.lang.String">
SELECT type_name
FROM zy_cloths_type
WHERE type_id = #{typeId}
</select>
</mapper> </mapper>

@ -54,7 +54,7 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentM
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums); ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums(); String nums1 = zyClothsType.getNums();
//String substring = nums.substring(nums.length() - 10); //String substring = nums.substring(nums.length() - 10);
String format = String.format("%06d", orderNumber()); String format = String.format("%08d", orderNumber());
return nums1 + format; return nums1 + format;
} }

@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
@ -43,7 +44,7 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums); ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums(); String nums1 = zyClothsType.getNums();
// String substring = nums.substring(nums.length() - 10); // String substring = nums.substring(nums.length() - 10);
String format = String.format("%06d", orderNumber()); String format = String.format("%08d", orderNumber());
return nums1 + format; return nums1 + format;
} }
@ -57,9 +58,12 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
if (newNums.length() > 8) { if (newNums.length() > 8) {
String substring = nums.substring(nums.length() - 8); String substring = nums.substring(nums.length() - 8);
listLong.add(Long.valueOf(substring)); listLong.add(Long.valueOf(substring));
}else {
listLong.add(Long.valueOf(newNums));
} }
if (StringUtils.isEmpty(newNums)) {
newNums = "0";
}
listLong.add(Long.valueOf(newNums));
} }
System.out.println(listLong); System.out.println(listLong);
return Collections.max(listLong) + 1; return Collections.max(listLong) + 1;

@ -36,20 +36,20 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC
String format = String.format("%06d", orderNumber()); String format = String.format("%06d", orderNumber());
//生成编码 //生成编码
String result = nums + format; String result = nums + format;
System.err.println(result); //System.err.println(result);
return nums + format; return nums + format;
} }
private Long orderNumber() { private Long orderNumber() {
List<String> listString = zyClothsTypeMapper.selectNumsList(); List<String> listString = zyClothsTypeMapper.selectNumsList();
System.out.println(listString); //System.out.println(listString);
List<Long> listLong = new ArrayList<>(); List<Long> listLong = new ArrayList<>();
for (String nums : listString) { for (String nums : listString) {
System.err.println(nums); //System.err.println(nums);
String REGEX = "[^0-9]"; String REGEX = "[^0-9]";
//只要数字 //只要数字
String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim(); String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
System.err.println(newNums); //System.err.println(newNums);
if (!StringUtils.hasText(newNums)){ if (!StringUtils.hasText(newNums)){
newNums = "0"; newNums = "0";
} }

@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
@ -34,6 +35,7 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
@Resource @Resource
ZyClothsTypeMapper zyClothsTypeMapper; ZyClothsTypeMapper zyClothsTypeMapper;
/** /**
* 生成编号 类型编号10位+顺序号8位 * 生成编号 类型编号10位+顺序号8位
* *
@ -48,7 +50,7 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
//截取后十位 //截取后十位
//String substring = nums.substring(nums.length() - 10); //String substring = nums.substring(nums.length() - 10);
//再来一个顺序号 //再来一个顺序号
String format = String.format("%06d", orderNumber()); String format = String.format("%08d", orderNumber());
//生成编码 //生成编码
return nums1 + format; return nums1 + format;
} }
@ -60,9 +62,11 @@ public class ZyClothsStyleServiceImpl extends ServiceImpl<ZyClothsStyleMapper, Z
if (nums.length() > 8) { if (nums.length() > 8) {
String substring = nums.substring(nums.length() - 8); String substring = nums.substring(nums.length() - 8);
list.add(Long.valueOf(substring)); list.add(Long.valueOf(substring));
}else {
list.add(Long.valueOf(nums));
} }
if (StringUtils.isEmpty(nums)) {
nums = "0";
}
list.add(Long.valueOf(nums));
} }
return Collections.max(list) + 1; return Collections.max(list) + 1;
} }

Loading…
Cancel
Save