2022-11-23 修改

zhc4dev
赵玉瑞 2 years ago
parent d4d120a96a
commit f65dfbcd4f
  1. 47
      ant-design-vue-jeecg/src/views/process/ZyProcessComponentList.vue
  2. 6
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessComponentForm.vue
  3. 23
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessComponentFormDetail.vue
  4. 47
      ant-design-vue-jeecg/src/views/zyProcessModular/ZyProcessModularList.vue
  5. 9
      ant-design-vue-jeecg/src/views/zyProcessModular/modules/ZyProcessModularForm.vue
  6. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java
  7. 8
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyProcessMapper.java
  8. 32
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml
  9. 5
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyProcessMapper.xml
  10. 378
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/controller/ZyProcessComponentController.java
  11. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java

@ -2,7 +2,7 @@
<!-- <a-card :bordered="false">--> <!-- <a-card :bordered="false">-->
<a-modal <a-modal
width="70%" width="70%"
title="评分项管理" title="部件工序管理"
:visible="visible" :visible="visible"
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
@ok="handleOk" @ok="handleOk"
@ -20,12 +20,12 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd1(componentId1)" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd1(componentId1)" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('zy_process_component')">导出</a-button> <!-- <a-button type="primary" icon="download" @click="handleExportXls('zy_process_component')">导出</a-button>-->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<a-button type="primary" icon="import">导入</a-button> <!-- <a-button type="primary" icon="import">导入</a-button>-->
</a-upload> <!-- </a-upload>-->
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@ -79,19 +79,24 @@
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-dropdown> <a @click="handleDetail(record.id)">详情</a>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> <a-divider type="vertical"/>
<a-menu slot="overlay"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a-menu-item> <a>删除</a>
<a @click="handleDetail(record.id)">详情</a> </a-popconfirm>
</a-menu-item> <!-- <a-dropdown>-->
<a-menu-item> <!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <!-- <a-menu slot="overlay">-->
<a>删除</a> <!-- <a-menu-item>-->
</a-popconfirm> <!-- <a @click="handleDetail(record.id)">详情</a>-->
</a-menu-item> <!-- </a-menu-item>-->
</a-menu> <!-- <a-menu-item>-->
</a-dropdown> <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </a-dropdown>-->
</span> </span>
</a-table> </a-table>
@ -219,7 +224,9 @@
this.superFieldList = fieldList this.superFieldList = fieldList
}, },
handleDetail(id){ handleDetail(id){
this.$refs.ZyProcessComponentFormDetail.showModal(id) //id = this.model.id;
console.log("this。model.id +++++"+id);
this.$refs.ZyProcessComponentFormDetail.showModal(id);
} }
} }
} }

@ -5,12 +5,12 @@
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="部件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="componentId"> <a-form-model-item label="部件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="componentId">
<j-dict-select-tag type="list" v-model="model.componentId" dictCode="zy_cloths_component,parts_name,id" placeholder="请选择部件" /> <j-dict-select-tag type="list" v-model="model.componentId" dictCode="zy_cloths_component,parts_name,id" placeholder="请选择部件" disabled/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="工" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processId"> <a-form-model-item label="工" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processId">
<j-dict-select-tag type="list" v-model="model.processId" dictCode="zy_process,process_name,id" placeholder="请选择工" /> <j-dict-select-tag type="list" v-model="model.processId" dictCode="zy_process,process_name,id" placeholder="请选择工" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">

@ -3,7 +3,7 @@
title="标准作业指导书" title="标准作业指导书"
:visible="visible" :visible="visible"
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
:width='1400' :width='1000'
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
style="display:flex;" style="display:flex;"
@ -14,13 +14,17 @@
<td>{{model.componentId}}</td> <td>{{model.componentId}}</td>
</tr> </tr>
<tr> <tr>
<td style="text-align: center">:</td> <td style="text-align: center">:</td>
<td>{{model.processId}}</td> <td>{{model.processId}}</td>
</tr> </tr>
<tr> <tr>
<td style="text-align: center">是否瓶颈工序:</td> <td style="text-align: center">是否瓶颈工序:</td>
<td>{{model.bottleneck}}</td> <td>{{model.bottleneck}}</td>
</tr> </tr>
<tr>
<td style="text-align: center">创建时间:</td>
<td>{{model.createTime}}</td>
</tr>
</table> </table>
</a-modal> </a-modal>
@ -57,20 +61,25 @@
this.model = res.result this.model = res.result
// this.img = "http://10.100.200.112/jeecg-boot/sys/common/static/"+this.data.image; // this.img = "http://10.100.200.112/jeecg-boot/sys/common/static/"+this.data.image;
// this.mp4 = "http://10.100.200.112/jeecg-boot/sys/common/static/"+this.data.vedio; // this.mp4 = "http://10.100.200.112/jeecg-boot/sys/common/static/"+this.data.vedio;
console.log('this.model') console.log('this.model++'+id);
console.log(this.model) console.log(this.model);
} }
) )
}, },
handleOk() { handleOk(e) {
this.ModalText = 'The modal will be closed after two seconds'; this.ModalText = 'The modal will be closed after two seconds';
this.confirmLoading = true; this.confirmLoading = true;
setTimeout(() => { setTimeout(() => {
this.visible = false; this.visible = false;
this.confirmLoading = false; this.confirmLoading = false;
}, 1); }, 2000);
},
close () {
this.$emit('close');
this.visible = false;
}, },
handleCancel() { handleCancel(e) {
//this.close()
this.visible = false; this.visible = false;
}, },
} }

@ -20,12 +20,12 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd1(modularId1)" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd1(modularId1)" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('模块工序表')">导出</a-button> <!-- <a-button type="primary" icon="download" @click="handleExportXls('模块工序表')">导出</a-button>-->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<a-button type="primary" icon="import">导入</a-button> <!-- <a-button type="primary" icon="import">导入</a-button>-->
</a-upload> <!-- </a-upload>-->
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@ -79,19 +79,24 @@
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-dropdown> <a @click="handleDetail(record)">详情</a>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> <a-divider type="vertical"/>
<a-menu slot="overlay"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a-menu-item> <a>删除</a>
<a @click="handleDetail(record)">详情</a> </a-popconfirm>
</a-menu-item> <!-- <a-dropdown>-->
<a-menu-item> <!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <!-- <a-menu slot="overlay">-->
<a>删除</a> <!-- <a-menu-item>-->
</a-popconfirm> <!-- <a @click="handleDetail(record)">详情</a>-->
</a-menu-item> <!-- </a-menu-item>-->
</a-menu> <!-- <a-menu-item>-->
</a-dropdown> <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </a-dropdown>-->
</span> </span>
</a-table> </a-table>
@ -133,14 +138,14 @@ export default {
} }
}, },
{ {
title:'模块ID', title:'模块名称',
align:"center", align:"center",
dataIndex: 'modularId_dictText' dataIndex: 'modularId_dictText'
}, },
{ {
title:'工序ID', title:'工序名称',
align:"center", align:"center",
dataIndex: 'processId' dataIndex: 'processId_dictText'
}, },
{ {
title:'创建时间', title:'创建时间',

@ -14,9 +14,14 @@
dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块名称" disabled/> dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块名称" disabled/>
</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="processId">-->
<!-- <a-input v-model="model.processId" placeholder="请输入工序名称" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="工序ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processId"> <a-form-model-item label="工序名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processId">
<a-input v-model="model.processId" placeholder="请输入工序ID" ></a-input> <j-dict-select-tag type="list" v-model="model.processId" dictCode="zy_process,process_name,id" placeholder="请选择工序名称" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>

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

@ -12,14 +12,16 @@ import org.jeecg.modules.demo.pro.entity.ZyProcessAction;
/** /**
* @Description: zy_process * @Description: zy_process
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2021-11-03 * @Date: 2021-11-03
* @Version: V1.0 * @Version: V1.0
*/ */
public interface ZyProcessMapper extends BaseMapper<ZyProcess> { public interface ZyProcessMapper extends BaseMapper<ZyProcess> {
List<String> selectByIds(@Param("id") String id); List<String> selectByIds(@Param("id") String id);
ZyClothActionVo selectListZyClothActionVo(@Param("id") String id); ZyClothActionVo selectListZyClothActionVo(@Param("id") String id);
public List<ZyProcess> selectByComponentId(@Param("component_id")String component_id); public List<ZyProcess> selectByComponentId(@Param("component_id") String component_id);
String getProcessNameById(String processId);
} }

@ -1,24 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper"> <mapper namespace="org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper">
<select id="selectlistid" resultType="String" > <select id="selectlistid" resultType="String">
select process_id from zy_process_component select process_id from zy_process_component
<where> <where>
<if test="id!=null and id!=''"> <if test="id!=null and id!=''">
and component_id=#{id} and component_id=#{id}
</if> </if>
</where> </where>
</select> </select>
<select id="selectProcessVo" resultType="org.jeecg.modules.demo.base.entity.vo.ZyProcessVo"> <select id="selectProcessVo" resultType="org.jeecg.modules.demo.base.entity.vo.ZyProcessVo">
select process_code,process_name,process_describe,process_time,price,grade,total_manual_tmu totalManualTmu,total_machine_tmu totalMachineTmu select process_code,process_name,process_describe,process_time,price,grade,total_manual_tmu
totalManualTmu,total_machine_tmu totalMachineTmu
from zy_process from zy_process
where id in where id in
<foreach collection="list" open="(" close=")" separator="," index="id" item="id"> <foreach collection="list" open="(" close=")" separator="," index="id" item="id">
#{id} #{id}
</foreach> </foreach>
</select> </select>
<select id="selectByModular" resultType="org.jeecg.modules.demo.base.entity.ZyClothsComponent"> <select id="selectByModular" resultType="org.jeecg.modules.demo.base.entity.ZyClothsComponent">
SELECT * from zy_cloths_component SELECT *
where modular_id = #{modular_id} from zy_cloths_component
where modular_id = #{modular_id}
</select>
<select id="getComponentNameById" resultType="string">
select parts_name
from zy_cloths_component
where id = #{componentId}
</select> </select>
</mapper> </mapper>

@ -15,4 +15,9 @@
SELECT * from zy_process SELECT * from zy_process
where component_id = #{component_id} where component_id = #{component_id}
</select> </select>
<select id="getProcessNameById" resultType="java.lang.String">
SELECT process_name
from zy_process
where id = #{processId}
</select>
</mapper> </mapper>

@ -1,223 +1,235 @@
package org.jeecg.modules.demo.pro.controller; package org.jeecg.modules.demo.pro.controller;
import java.util.ArrayList; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.Arrays; import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Map; import io.swagger.annotations.Api;
import java.util.stream.Collectors; import io.swagger.annotations.ApiOperation;
import java.io.IOException; import lombok.extern.slf4j.Slf4j;
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.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; 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.ZyClothsComponent;
import org.jeecg.modules.demo.base.entity.ZyProcess; import org.jeecg.modules.demo.base.entity.ZyProcess;
import org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper;
import org.jeecg.modules.demo.base.mapper.ZyProcessMapper;
import org.jeecg.modules.demo.base.service.IZyClothsComponentService; import org.jeecg.modules.demo.base.service.IZyClothsComponentService;
import org.jeecg.modules.demo.base.service.IZyProcessService; import org.jeecg.modules.demo.base.service.IZyProcessService;
import org.jeecg.modules.demo.pro.entity.NewZyProcessComponent; import org.jeecg.modules.demo.pro.entity.NewZyProcessComponent;
import org.jeecg.modules.demo.pro.entity.ZyProcessComponent; import org.jeecg.modules.demo.pro.entity.ZyProcessComponent;
import org.jeecg.modules.demo.pro.mapper.ZyProcessComponentMapper;
import org.jeecg.modules.demo.pro.service.IZyProcessComponentService; import org.jeecg.modules.demo.pro.service.IZyProcessComponentService;
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.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.beans.factory.annotation.Autowired;
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 io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/** import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @Description: zy_process_component * @Description: zy_process_component
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2021-11-11 * @Date: 2021-11-11
* @Version: V1.0 * @Version: V1.0
*/ */
@Api(tags="zy_process_component") @Api(tags = "zy_process_component")
@RestController @RestController
@RequestMapping("/pro/zyProcessComponent") @RequestMapping("/pro/zyProcessComponent")
@Slf4j @Slf4j
public class ZyProcessComponentController extends JeecgController<ZyProcessComponent, IZyProcessComponentService> { public class ZyProcessComponentController extends JeecgController<ZyProcessComponent, IZyProcessComponentService> {
@Autowired @Autowired
private IZyProcessComponentService zyProcessComponentService; private IZyProcessComponentService zyProcessComponentService;
@Autowired @Autowired
private IZyProcessService zyProcessService; private IZyProcessService zyProcessService;
@Autowired @Autowired
private IZyClothsComponentService zyClothsComponentService; private IZyClothsComponentService zyClothsComponentService;
@Resource
private ZyClothsComponentMapper zyClothsComponentMapper;
@Resource
private ZyProcessMapper zyProcessMapper;
/**
* 分页列表查询
*
* @param zyProcessComponent
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "zy_process_component-分页列表查询")
@ApiOperation(value = "zy_process_component-分页列表查询", notes = "zy_process_component-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyProcessComponent zyProcessComponent,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyProcessComponent> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessComponent, req.getParameterMap());
Page<ZyProcessComponent> page = new Page<ZyProcessComponent>(pageNo, pageSize);
IPage<ZyProcessComponent> pageList = zyProcessComponentService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
*
*/
@AutoLog(value = "zy_process_component-查询所有")
@ApiOperation(value = "zy_process_component-查询所有", notes = "zy_process_component-查询所有")
@GetMapping(value = "/findAll")
public Result<?> findAll() {
List<ZyProcessComponent> list = zyProcessComponentService.list();
List<NewZyProcessComponent> list1 = new ArrayList<>();
for (ZyProcessComponent zy : list) {
NewZyProcessComponent newZy = new NewZyProcessComponent();
String processId = zy.getProcessId();
String componentId = zy.getComponentId();
ZyProcess byId = zyProcessService.getById(processId);
ZyClothsComponent byId1 = zyClothsComponentService.getById(componentId);
newZy.setProcessCode(byId.getProcessCode());
newZy.setProcessName(byId.getProcessName());
newZy.setProcessDescribe(byId.getProcessDescribe());
newZy.setMkExplain(byId.getMkExplain());
newZy.setQualityRequire(byId.getQualityRequire());
newZy.setProcessTime(byId.getProcessTime());
newZy.setPrice(byId.getPrice());
newZy.setGrade(byId.getGrade());
newZy.setNeedlePitch(byId.getNeedlePitch());
newZy.setManualTime(byId.getManualTime());
newZy.setMachineSpeed(byId.getMachineSpeed());
newZy.setMachineWide(byId.getMachineWide());
newZy.setMachineTime(byId.getMachineTime());
newZy.setMachineFloat(byId.getMachineFloat());
newZy.setBundleWide(byId.getBundleWide());
newZy.setBundleTime(byId.getBundleTime());
newZy.setEnterpriseId(byId.getEnterpriseId());
newZy.setStyleId(byId.getStyleId());
newZy.setWorksectionCode(byId.getWorksectionCode());
newZy.setTotalManualTmu(byId.getTotalManualTmu());
newZy.setTotalMachineTmu(byId.getTotalMachineTmu());
newZy.setTotalMaunal(byId.getTotalMaunal());
newZy.setTotalMachine(byId.getTotalMachine());
newZy.setNums(byId1.getNums());
newZy.setPartsName(byId1.getPartsName());
newZy.setDescription(byId1.getDescription());
list1.add(newZy);
}
return Result.OK(list1);
}
/** /**
* 分页列表查询 * 添加
* *
* @param zyProcessComponent * @param zyProcessComponent
* @param pageNo * @return
* @param pageSize */
* @param req @AutoLog(value = "zy_process_component-添加")
* @return @ApiOperation(value = "zy_process_component-添加", notes = "zy_process_component-添加")
*/ @PostMapping(value = "/add")
@AutoLog(value = "zy_process_component-分页列表查询") public Result<?> add(@RequestBody ZyProcessComponent zyProcessComponent) {
@ApiOperation(value="zy_process_component-分页列表查询", notes="zy_process_component-分页列表查询") zyProcessComponentService.save(zyProcessComponent);
@GetMapping(value = "/list") return Result.OK("添加成功!");
public Result<?> queryPageList(ZyProcessComponent zyProcessComponent, }
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyProcessComponent> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessComponent, req.getParameterMap());
Page<ZyProcessComponent> page = new Page<ZyProcessComponent>(pageNo, pageSize);
IPage<ZyProcessComponent> pageList = zyProcessComponentService.page(page, queryWrapper);
return Result.OK(pageList);
}
/** /**
* * 编辑
*/ *
@AutoLog(value = "zy_process_component-查询所有") * @param zyProcessComponent
@ApiOperation(value="zy_process_component-查询所有", notes="zy_process_component-查询所有") * @return
@GetMapping(value = "/findAll") */
public Result<?> findAll() { @AutoLog(value = "zy_process_component-编辑")
List<ZyProcessComponent> list = zyProcessComponentService.list(); @ApiOperation(value = "zy_process_component-编辑", notes = "zy_process_component-编辑")
List<NewZyProcessComponent> list1 = new ArrayList<>(); @PutMapping(value = "/edit")
for (ZyProcessComponent zy : list){ public Result<?> edit(@RequestBody ZyProcessComponent zyProcessComponent) {
NewZyProcessComponent newZy = new NewZyProcessComponent(); zyProcessComponentService.updateById(zyProcessComponent);
String processId = zy.getProcessId(); return Result.OK("编辑成功!");
String componentId = zy.getComponentId(); }
ZyProcess byId = zyProcessService.getById(processId);
ZyClothsComponent byId1 = zyClothsComponentService.getById(componentId);
newZy.setProcessCode(byId.getProcessCode());
newZy.setProcessName(byId.getProcessName());
newZy.setProcessDescribe(byId.getProcessDescribe());
newZy.setMkExplain(byId.getMkExplain());
newZy.setQualityRequire(byId.getQualityRequire());
newZy.setProcessTime(byId.getProcessTime());
newZy.setPrice(byId.getPrice());
newZy.setGrade(byId.getGrade());
newZy.setNeedlePitch(byId.getNeedlePitch());
newZy.setManualTime(byId.getManualTime());
newZy.setMachineSpeed(byId.getMachineSpeed());
newZy.setMachineWide(byId.getMachineWide());
newZy.setMachineTime(byId.getMachineTime());
newZy.setMachineFloat(byId.getMachineFloat());
newZy.setBundleWide(byId.getBundleWide());
newZy.setBundleTime(byId.getBundleTime());
newZy.setEnterpriseId(byId.getEnterpriseId());
newZy.setStyleId(byId.getStyleId());
newZy.setWorksectionCode(byId.getWorksectionCode());
newZy.setTotalManualTmu(byId.getTotalManualTmu());
newZy.setTotalMachineTmu(byId.getTotalMachineTmu());
newZy.setTotalMaunal(byId.getTotalMaunal());
newZy.setTotalMachine(byId.getTotalMachine());
newZy.setNums(byId1.getNums());
newZy.setPartsName(byId1.getPartsName());
newZy.setDescription(byId1.getDescription());
list1.add(newZy);
}
return Result.OK(list1);
}
/**
* 添加
*
* @param zyProcessComponent
* @return
*/
@AutoLog(value = "zy_process_component-添加")
@ApiOperation(value="zy_process_component-添加", notes="zy_process_component-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyProcessComponent zyProcessComponent) {
zyProcessComponentService.save(zyProcessComponent);
return Result.OK("添加成功!");
}
/** /**
* 编辑 * 通过id删除
* *
* @param zyProcessComponent * @param id
* @return * @return
*/ */
@AutoLog(value = "zy_process_component-编辑") @AutoLog(value = "zy_process_component-通过id删除")
@ApiOperation(value="zy_process_component-编辑", notes="zy_process_component-编辑") @ApiOperation(value = "zy_process_component-通过id删除", notes = "zy_process_component-通过id删除")
@PutMapping(value = "/edit") @DeleteMapping(value = "/delete")
public Result<?> edit(@RequestBody ZyProcessComponent zyProcessComponent) { public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
zyProcessComponentService.updateById(zyProcessComponent); zyProcessComponentService.removeById(id);
return Result.OK("编辑成功!"); return Result.OK("删除成功!");
} }
/** /**
* 通过id删除 * 批量删除
* *
* @param id * @param ids
* @return * @return
*/ */
@AutoLog(value = "zy_process_component-通过id删除") @AutoLog(value = "zy_process_component-批量删除")
@ApiOperation(value="zy_process_component-通过id删除", notes="zy_process_component-通过id删除") @ApiOperation(value = "zy_process_component-批量删除", notes = "zy_process_component-批量删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/deleteBatch")
public Result<?> delete(@RequestParam(name="id",required=true) String id) { public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
zyProcessComponentService.removeById(id); this.zyProcessComponentService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("删除成功!"); return Result.OK("批量删除成功!");
} }
/** /**
* 批量删除 * 通过id查询
* *
* @param ids * @param id
* @return * @return
*/ */
@AutoLog(value = "zy_process_component-批量删除") @AutoLog(value = "zy_process_component-通过id查询")
@ApiOperation(value="zy_process_component-批量删除", notes="zy_process_component-批量删除") @ApiOperation(value = "zy_process_component-通过id查询", notes = "zy_process_component-通过id查询")
@DeleteMapping(value = "/deleteBatch") @GetMapping(value = "/queryById")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
this.zyProcessComponentService.removeByIds(Arrays.asList(ids.split(","))); ZyProcessComponent zyProcessComponent = zyProcessComponentService.getById(id);
return Result.OK("批量删除成功!");
}
/** if (zyProcessComponent == null) {
* 通过id查询 return Result.error("未找到对应数据");
* }
* @param id //部件名称
* @return String componentId = zyProcessComponent.getComponentId();
*/ String componentNameById = zyClothsComponentMapper.getComponentNameById(componentId);
@AutoLog(value = "zy_process_component-通过id查询") zyProcessComponent.setComponentId(componentNameById);
@ApiOperation(value="zy_process_component-通过id查询", notes="zy_process_component-通过id查询") //工序名称
@GetMapping(value = "/queryById") String processId = zyProcessComponent.getProcessId();
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { String processNameById = zyProcessMapper.getProcessNameById(processId);
ZyProcessComponent zyProcessComponent = zyProcessComponentService.getById(id); zyProcessComponent.setProcessId(processNameById);
if(zyProcessComponent==null) { //瓶颈工序
return Result.error("未找到对应数据"); String bottleneck = zyProcessComponent.getBottleneck();
} if (bottleneck.equals("1")) {
return Result.OK(zyProcessComponent); zyProcessComponent.setBottleneck("是");
} } else if (bottleneck.equals("2")) {
zyProcessComponent.setBottleneck("否");
} else {
zyProcessComponent.setBottleneck("可能为空或出错了");
}
return Result.OK(zyProcessComponent);
}
/** /**
* 导出excel * 导出excel
* *
* @param request * @param request
* @param zyProcessComponent * @param zyProcessComponent
*/ */
@RequestMapping(value = "/exportXls") @RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyProcessComponent zyProcessComponent) { public ModelAndView exportXls(HttpServletRequest request, ZyProcessComponent zyProcessComponent) {
return super.exportXls(request, zyProcessComponent, ZyProcessComponent.class, "zy_process_component"); return super.exportXls(request, zyProcessComponent, ZyProcessComponent.class, "zy_process_component");
} }
/** /**
* 通过excel导入数据 * 通过excel导入数据
* *
* @param request * @param request
* @param response * @param response
* @return * @return
*/ */
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyProcessComponent.class); return super.importExcel(request, response, ZyProcessComponent.class);

@ -60,5 +60,6 @@ public class ZyProcessModular implements Serializable {
/**工序ID*/ /**工序ID*/
@Excel(name = "工序ID", width = 15) @Excel(name = "工序ID", width = 15)
@ApiModelProperty(value = "工序ID") @ApiModelProperty(value = "工序ID")
@Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id")
private java.lang.String processId; private java.lang.String processId;
} }

Loading…
Cancel
Save