Merge remote-tracking branch 'origin/master'

zhc4dev
赵玉瑞 2 years ago
commit 41ceee56bb
  1. 9
      ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
  2. 32
      ant-design-vue-jeecg/src/views/process/ZyProcessList.vue
  3. 45
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessForm.vue
  4. 22
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java
  5. 6
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java
  6. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyProcessMapper.java
  7. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyProcessService.java
  8. 9
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyProcessServiceImpl.java

@ -233,6 +233,15 @@ export const JeecgListMixin = {
}, },
fuzhi: function (record) { fuzhi: function (record) {
record.id=""; record.id="";
var s=record.processCode.substring(10,record.processCode.length)
record.processCode=(parseInt(s,10)+1).toString()
while(record.processCode.length<6){
record.processCode="0"+record.processCode
}
record.processCode=record.styleId+record.processCode
// console.log(record.process_code)
this.$refs.modalForm.edit(record); this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "复制"; this.$refs.modalForm.title = "复制";
this.$refs.modalForm.disableSubmit = false; this.$refs.modalForm.disableSubmit = false;

@ -5,9 +5,9 @@
<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 :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="服装款式"> <a-form-item label="服装类型">
<j-dict-select-tag placeholder="请选择服装款式" dictCode="zy_cloths_style,style_names,id" <j-dict-select-tag placeholder="请选择服装款式" dictCode="zy_cloths_type,type_name,nums"
v-model="queryParam.styleId"></j-dict-select-tag> v-model="styleId"></j-dict-select-tag>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
@ -187,16 +187,26 @@ export default {
align: "center", align: "center",
dataIndex: 'processName' dataIndex: 'processName'
}, },
{
title: '企业',
align: "center",
dataIndex: 'enterpriseId_dictText'
},
{
title: '服装类型',
align: "center",
dataIndex: 'styleId_dictText'
},
// { // {
// title:'', // title:'',
// align:"center", // align:"center",
// dataIndex: 'processDescribe' // dataIndex: 'processDescribe'
// }, // },
{ // {
title: '品质要求', // title: '',
align: "center", // align: "center",
dataIndex: 'qualityRequire' // dataIndex: 'qualityRequire'
}, // },
{ {
title: '工序时间', title: '工序时间',
align: "center", align: "center",
@ -267,11 +277,7 @@ export default {
align: "center", align: "center",
dataIndex: 'totalMachine' dataIndex: 'totalMachine'
}, },
// {
// title: '',
// align: "center",
// dataIndex: 'enterpriseId_dictText'
// },
{ {
title: '创建时间', title: '创建时间',

@ -3,9 +3,28 @@
<j-form-container :disabled="formDisabled"> <j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row> <a-row>
<a-col :span="24">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<j-select-depart v-model="model.enterpriseId" placeholder="请输入企业名称" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeId">
<j-popup
v-model="model.typeName"
field="type_name"
org-fields="type_name,nums"
dest-fields="typeName,styleId"
code="cloths_type"
:multi="false"
@input="popupCallback"
/>
</a-form-model-item>
<a-input v-model="model.styleId" hidden/>
</a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="工序代码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processCode"> <a-form-model-item label="工序代码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processCode">
<a-input v-model="model.processCode" placeholder="请输入工序代码" ></a-input> <a-input v-model="model.processCode" placeholder="请输入工序代码" disabled></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -118,11 +137,7 @@
<!-- <a-input v-model="model.enterpriseId" placeholder="请输入企业名称" ></a-input>--> <!-- <a-input v-model="model.enterpriseId" placeholder="请输入企业名称" ></a-input>-->
<!-- </a-form-model-item>--> <!-- </a-form-model-item>-->
<!-- </a-col>--> <!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<j-select-depart v-model="model.enterpriseId" placeholder="请输入企业名称" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">--> <!-- <a-col :span="24">-->
<!-- <a-form-model-item label="工具名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId">--> <!-- <a-form-model-item label="工具名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId">-->
<!-- <j-dict-select-tag type="list" v-model="model.toolId" dictCode="zy_tool,name,id" placeholder="请选择工具名称" />--> <!-- <j-dict-select-tag type="list" v-model="model.toolId" dictCode="zy_tool,name,id" placeholder="请选择工具名称" />-->
@ -210,6 +225,7 @@
data () { data () {
return { return {
model:{ model:{
processCode:'',
processType:0, processType:0,
}, },
labelCol: { labelCol: {
@ -237,7 +253,8 @@
url: { url: {
add: "/base/zyProcess/add", add: "/base/zyProcess/add",
edit: "/base/zyProcess/edit", edit: "/base/zyProcess/edit",
queryById: "/base/zyProcess/queryById" queryById: "/base/zyProcess/queryById",
sort:"/base/zyProcess/sort"
} }
} }
}, },
@ -291,6 +308,20 @@
}) })
console.log(this.model) console.log(this.model)
}, },
popupCallback(value,row){
var n=6;
this.model = Object.assign(this.model, row);
getAction(this.url.sort,{id:this.model.styleId}).then((res)=>{
// console.log(res.result)
var num=parseInt(res.result,10)+1
num=num.toString()
while(num.length<n){
num="0"+num
}
this.model.processCode=this.model.styleId+num;
// console.log(this.model.processCode)
})
},
} }
} }
</script> </script>

@ -89,6 +89,12 @@ public class ZyProcessController extends JeecgController<ZyProcess, IZyProcessSe
@ApiOperation(value="zy_process-添加", notes="zy_process-添加") @ApiOperation(value="zy_process-添加", notes="zy_process-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyProcess zyProcess) { public Result<?> add(@RequestBody ZyProcess zyProcess) {
zyProcess.setCreateTime(null);
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("process_name",zyProcess.getProcessName());
int a=zyProcessService.count(queryWrapper);
if(a!=0)
return Result.error("添加失败,该工序名称已存在!!!");
zyProcessService.save(zyProcess); zyProcessService.save(zyProcess);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@ -103,6 +109,11 @@ public class ZyProcessController extends JeecgController<ZyProcess, IZyProcessSe
@ApiOperation(value="zy_process-编辑", notes="zy_process-编辑") @ApiOperation(value="zy_process-编辑", notes="zy_process-编辑")
@PutMapping(value = "/edit") @PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyProcess zyProcess) { public Result<?> edit(@RequestBody ZyProcess zyProcess) {
QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("process_name",zyProcess.getProcessName());
int a=zyProcessService.count(queryWrapper);
if(a!=0)
return Result.error("编辑失败,该工序名称已存在!!!");
zyProcessService.updateById(zyProcess); zyProcessService.updateById(zyProcess);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
@ -187,6 +198,15 @@ public class ZyProcessController extends JeecgController<ZyProcess, IZyProcessSe
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyProcess.class); return super.importExcel(request, response, ZyProcess.class);
} }
@AutoLog(value = "zy_process-顺序查询")
@ApiOperation(value="zy_process-顺序查询", notes="zy_process-顺序查询")
@GetMapping(value = "/sort")
public Result<?> sort(@RequestParam(name="id",required=true) String id) {
String sort=zyProcessService.sort(id);
if(sort==null){
return Result.ok(0);
}
return Result.OK(sort.substring(10,sort.length()));
}
} }

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

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.base.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.base.entity.ZyClothsModular; import org.jeecg.modules.demo.base.entity.ZyClothsModular;
import org.jeecg.modules.demo.base.entity.ZyProcess; import org.jeecg.modules.demo.base.entity.ZyProcess;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -24,4 +25,7 @@ public interface ZyProcessMapper extends BaseMapper<ZyProcess> {
public List<ZyProcess> selectByComponentId(@Param("component_id") String component_id); public List<ZyProcess> selectByComponentId(@Param("component_id") String component_id);
String getProcessNameById(String processId); String getProcessNameById(String processId);
@Select("select process_code from zy_process where style_id=#{id} order by process_code DESC limit 0,1")
String sort(String id);
} }

@ -19,4 +19,6 @@ public interface IZyProcessService extends IService<ZyProcess> {
ZyProcess selectZyprocess(String id); ZyProcess selectZyprocess(String id);
public List<ZyProcess> selectByComponentId(String component_id); public List<ZyProcess> selectByComponentId(String component_id);
String sort(String id);
} }

@ -34,6 +34,15 @@ public class ZyProcessServiceImpl extends ServiceImpl<ZyProcessMapper, ZyProcess
return zyProcessMapper.selectByComponentId(component_id); return zyProcessMapper.selectByComponentId(component_id);
} }
/*
* 只查最后一条数据的序号
* */
@Override
public String sort(String id) {
return zyProcessMapper.sort(id);
}
@Override @Override
public ZyProcess selectZyprocess(String id) { public ZyProcess selectZyprocess(String id) {
List<String> list=baseMapper.selectByIds(id); List<String> list=baseMapper.selectByIds(id);

Loading…
Cancel
Save