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

zhc4dev
赵玉瑞 2 years ago
parent 41ceee56bb
commit f40a4112c4
  1. 12
      ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
  2. 2
      ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue
  3. 35
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
  4. 10
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue
  5. 4
      ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleForm.vue
  6. 3
      ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyProcessList.vue
  7. 1
      ant-design-vue-jeecg/src/views/zystylemodular/modules/ZyStyleModularModal.vue
  8. 2
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java
  9. 11
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java
  10. 8
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java
  11. 6
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyClothsComponent.java
  12. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java
  13. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java
  14. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml
  15. 3
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsComponentService.java
  16. 39
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsComponentServiceImpl.java
  17. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessComponent.java
  18. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java

@ -145,12 +145,16 @@
align:"center",
dataIndex: 'partsName'
},
// {
// title:'',
// align:"center",
// dataIndex: 'componentType'
// },
{
title:'部件类型',
align:"center",
dataIndex: 'componentType'
title: '服装类型',
align: "center",
dataIndex: 'clothsTypeId_dictText'
},
// {
// title:'',
// align:"center",

@ -173,7 +173,7 @@ export default {
// dataIndex: 'description'
// },
{
title: '服类型',
title: '服类型',
align: "center",
dataIndex: 'clothsTypeId_dictText'
},

@ -8,21 +8,31 @@
<j-select-depart v-model="model.enterpriseId" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">-->
<!-- <a-input v-model="model.nums" placeholder="请输入编号" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" ></a-input>
<a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName">
<a-input v-model="model.partsName" placeholder="请输入部件名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName">
<a-input v-model="model.partsName" placeholder="请输入部件名称" ></a-input>
<a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择衣服类型" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="部件类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="componentType">
<a-input v-model="model.componentType" placeholder="请输入部件类型" ></a-input>
<a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">
<j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="部件类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="componentType">-->
<!-- <a-input v-model="model.componentType" placeholder="请输入部件类型" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>
@ -33,11 +43,7 @@
<j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">
<j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="制衣模块类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularType">-->
<!-- <j-dict-select-tag type="list" v-model="model.modularType" dictCode="zyModularType" placeholder="请选择制衣模块类型" />-->
@ -86,8 +92,11 @@
},
confirmLoading: false,
validatorRules: {
nums: [
{ required: true, message: '请输入编号!'},
// nums: [
// { required: true, message: '!'},
// ],
clothsTypeId: [
{ required: true, message: '请选择服装类型!'},
],
partsName: [
{ required: true, message: '请输入部件名称!'},

@ -13,6 +13,7 @@
<!-- <a-input v-model="model.nums" placeholder="请输入编号" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="模块名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularName">
<a-input v-model="model.modularName" placeholder="请输入模块名称" ></a-input>
@ -23,14 +24,15 @@
<!-- <j-dict-select-tag type="list" v-model="model.modularType" dictCode="zyModularType" placeholder="请选择制衣模块类型" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>
<a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择服装类型" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="衣服类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择衣服类型" />
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->

@ -34,8 +34,8 @@
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleNames">
<a-input v-model="model.styleNames" placeholder="请输入名称" ></a-input>
<a-form-model-item label="款式名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleNames">
<a-input v-model="model.styleNames" placeholder="请输入款式名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">

@ -3,6 +3,7 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row>
</a-row>
</a-form>
</div>
@ -160,7 +161,7 @@ export default {
},
//
loadParameter() {
if (this.loadRouteType == false) {
if (this.loadRouteType === false) {
this.styleId = this.$route.query.styleId;
console.log(this.styleId)
this.loadRouteType = true;

@ -19,7 +19,6 @@
name: 'ZyStyleModularModal',
components: {
ZyProcessList,
},
data () {
return {

@ -68,5 +68,5 @@ public class ZyStyleModular implements Serializable {
/**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号")
private Integer order;
private Integer serialnumber;
}

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.base.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -88,6 +89,16 @@ public class ZyClothsComponentController extends JeecgController<ZyClothsCompone
@ApiOperation(value = "zy_cloths_component-添加", notes = "zy_cloths_component-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsComponent zyClothsComponent) {
//编码规则:服装类型(10)+序号(8)
zyClothsComponent.setNums(zyClothsComponentService.generateNumber(zyClothsComponent));
//部件名称不能重复
LambdaQueryWrapper<ZyClothsComponent> queryWrapper = new LambdaQueryWrapper<>();
List<ZyClothsComponent> zyClothsComponentList = zyClothsComponentService.list(queryWrapper);
for (ZyClothsComponent zy : zyClothsComponentList) {
if (zyClothsComponent.getPartsName().equals(zy.getPartsName())){
return Result.error("添加失败!数据已存在");
}
}
zyClothsComponentService.save(zyClothsComponent);
return Result.OK("添加成功!");
}

@ -12,6 +12,7 @@ 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.ZyClothsComponent;
import org.jeecg.modules.demo.base.entity.ZyClothsModular;
import org.jeecg.modules.demo.base.entity.ZyClothsType;
import org.jeecg.modules.demo.base.service.IZyClothsModularService;
@ -105,6 +106,13 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
public Result<?> add(@RequestBody ZyClothsModular zyClothsModular) {
//nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8)
zyClothsModular.setNums(zyClothsModularService.generateNumber(zyClothsModular));
//模块名称不能重复
List<ZyClothsModular> zyClothsModularList = zyClothsModularService.list();
for (ZyClothsModular zy : zyClothsModularList) {
if (zyClothsModular.getModularName().equals(zy.getModularName())){
return Result.error("添加失败!模块名称已存在");
}
}
zyClothsModularService.save(zyClothsModular);
return Result.OK("添加成功!");
}

@ -52,6 +52,12 @@ public class ZyClothsComponent implements Serializable {
@Excel(name = "图片地址", width = 15)
@ApiModelProperty(value = "图片地址")
private java.lang.String pictureUrl;
/**服装类型id*/
@Excel(name = "服装类型id", width = 15, dictTable = "zy_cloths_type", dicText = "type_name", dicCode = "id")
@Dict(dictTable = "zy_cloths_type", dicText = "type_name", dicCode = "id")
@ApiModelProperty(value = "服装类型id")
private java.lang.String clothsTypeId;
/**模块*/
@Excel(name = "模块", width = 15, dictTable = "zy_cloths_modular", dicText = "modular_name", dicCode = "id")
@Dict(dictTable = "zy_cloths_modular", dicText = "modular_name", dicCode = "id")

@ -179,7 +179,7 @@ public class ZyProcess implements Serializable {
*/
@Excel(name = "类型名称", width = 15)
@ApiModelProperty(value = "类型名称")
@Dict(dictTable = "zy_cloths_type", dicText = "zy_cloths_type", dicCode = "nums")
@Dict(dictTable = "zy_cloths_type", dicText = "type_name", dicCode = "nums")
private java.lang.String styleId;
/**
* 工段代码

@ -22,4 +22,6 @@ public interface ZyClothsComponentMapper extends BaseMapper<ZyClothsComponent> {
public List<ZyClothsComponent> selectByModular(@Param("modular_id")String modular_id);
String getComponentNameById(String componentId);
List<String> selectNumsList2();
}

@ -29,4 +29,8 @@
from zy_cloths_component
where id = #{componentId}
</select>
<select id="selectNumsList2" resultType="java.lang.String">
select nums
from zy_cloths_component
</select>
</mapper>

@ -18,4 +18,7 @@ public interface IZyClothsComponentService extends IService<ZyClothsComponent> {
List<ZyProcessVo> selectList(String id);
public List<ZyClothsComponent> selectByModular(String modular_id);
/**编码规则:服装类型(10)+序号(8)*/
String generateNumber(ZyClothsComponent zyClothsComponent);
}

@ -10,8 +10,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.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
/**
* @Description: zy_cloths_component
@ -21,7 +26,7 @@ import java.util.List;
*/
@Service
public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentMapper, ZyClothsComponent> implements IZyClothsComponentService {
@Autowired
@Resource
private ZyClothsComponentMapper zyClothsComponentMapper;
@Override
@ -35,4 +40,36 @@ public class ZyClothsComponentServiceImpl extends ServiceImpl<ZyClothsComponentM
public List<ZyClothsComponent> selectByModular(String modular_id) {
return zyClothsComponentMapper.selectByModular(modular_id);
}
/**
* 编码规则服装类型10+序号8
*/
@Override
public String generateNumber(ZyClothsComponent zyClothsComponent) {
String nums = zyClothsComponent.getClothsTypeId();
String substring = nums.substring(nums.length() - 10);
String format = String.format("%08d", orderNumber());
return substring + format;
}
private Long orderNumber() {
List<String> listString = zyClothsComponentMapper.selectNumsList2();
//System.err.println(listString);
List<Long> listLong = new ArrayList<>();
for (String nums : listString) {
String REGEX = "[^0-9]";
String newNums = Pattern.compile(REGEX).matcher(nums).replaceAll("").trim();
if (!StringUtils.hasText(newNums)){
newNums = "0";
}
if (newNums.length() > 8) {
String substring = nums.substring(nums.length() - 8);
listLong.add(Long.valueOf(substring));
}else {
listLong.add(Long.valueOf(newNums));
}
}
System.out.println(listLong);
return Collections.max(listLong)+1;
}
}

@ -52,7 +52,7 @@ public class ZyProcessComponent implements Serializable {
/**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号")
private Integer order;
private Integer serialnumber;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

@ -65,5 +65,5 @@ public class ZyProcessModular implements Serializable {
/**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号")
private Integer order;
private Integer serialnumber;
}

Loading…
Cancel
Save