生产计划管理 问题修改 1.12

zhc4dev
zhc077 2 years ago
parent a84b85377a
commit da123bbd70
  1. 12
      ant-design-vue-jeecg/src/views/hanger/HangerList.vue
  2. 4
      ant-design-vue-jeecg/src/views/jeecg/SelectDemo.vue
  3. 128
      ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue
  4. 69
      ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue
  5. 20
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java
  6. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java
  7. 28
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationServiceImpl.java
  8. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProduct.java

@ -9,16 +9,16 @@
<a-input placeholder="请输入衣架编号" v-model="queryParam.hangerCode"></a-input> <a-input placeholder="请输入衣架编号" v-model="queryParam.hangerCode"></a-input>
</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">
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">--> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<!-- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>--> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>--> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<!-- <a @click="handleToggleSearch" style="margin-left: 8px">--> <!-- <a @click="handleToggleSearch" style="margin-left: 8px">-->
<!-- {{ toggleSearchStatus ? '收起' : '展开' }}--> <!-- {{ toggleSearchStatus ? '收起' : '展开' }}-->
<!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>--> <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
<!-- </a>--> <!-- </a>-->
<!-- </span>--> </span>
<!-- </a-col>--> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>

@ -110,7 +110,9 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="选择用户" prop="userIds"> <a-form-model-item label="选择用户" prop="userIds">
<j-select-user-by-dep v-model="formData.userIds" :multi="true"></j-select-user-by-dep> <j-select-user-by-dep v-model="formData.userIds" :multi="true"
value="id,realname">
</j-select-user-by-dep>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的用户(v-model):{{ formData.userIds }}</a-col> <a-col :span="12">选中的用户(v-model):{{ formData.userIds }}</a-col>

@ -1,9 +1,80 @@
<template> <template>
<a-card :bordered="false"> <a-card :bordered="false">
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<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-form-item label="工单编号">
<a-input placeholder="请输入工单编号" v-model="queryParam.productCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="车间名称">
<j-select-depart placeholder="请选择车间" v-model="queryParam.departId"/>
<!-- <j-dict-select-tag type="list" v-model="queryParam.workshopId"-->
<!-- dictCode="sys_depart,depart_name,id,org_category='2'"/>-->
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="车间负责人">
<j-select-multi-user
v-model="queryParam.responsiblePerson"
:multiple="false"
placeholder="请选择车间负责人"
/>
<!-- <j-select-user-by-dep v-model="queryParam.responsiblePerson" :multi="false"-->
<!-- :back-user="true"-->
<!-- >-->
<!-- </j-select-user-by-dep>-->
<!-- <j-select-user-by-dep placeholder="请输入车间负责人" v-model="queryParam.responsiblePerson"/>-->
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="班组名称">
<!-- <a-input placeholder="请输入班组名称" v-model="queryParam.teamId"></a-input>-->
<j-dict-select-tag type="list" v-model="queryParam.teamId" dict-code="groupx,group_name,id"
placeholder="请输入班组名称"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<!-- <a-input placeholder="请输入班组长" v-model="queryParam.teamLeader"></a-input>-->
<a-form-item label="班组长">
<j-select-multi-user
v-model="queryParam.teamLeader"
:multiple="false"
placeholder="请选择班组长"
/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="生产开始时间">
<!-- <a-date-picker valueFormat="YYYY-MM-DD" v-model="model.birthday"/>-->
<a-date-picker placeholder="请选生产开始时间" valueFormat="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.workTime" style="width: 100%"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="生产状态">
<j-dict-select-tag type="list" v-model="queryParam.status" dictCode="productplanStatus"
placeholder="请选择状态"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="是否加急">
<!-- <j-dict-select-tag type="radio" v-model="queryParam.speedUp" dictCode="sfjj" placeholder="请选择是否加急"/>-->
<j-dict-select-tag type="list" v-model="queryParam.speedUp" dictCode="sfjj"
placeholder="请选择是否加急"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload"
style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
@ -13,23 +84,6 @@
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" 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-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
@ -54,27 +108,6 @@
class="j-table-force-nowrap" class="j-table-force-nowrap"
@change="handleTableChange"> @change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
@ -127,11 +160,20 @@ export default {
align: "center", align: "center",
dataIndex: 'productCode' dataIndex: 'productCode'
}, },
// { {
// title: '', title: '产品编号',
// align: "center", align: "center",
// dataIndex: 'workshopId' dataIndex: 'productNo'
// }, }, {
title: '产品名称',
align: "center",
dataIndex: 'productName'
},
{
title: '生产企业',
align: "center",
dataIndex: 'productOrg'
},
{ {
title: '车间名称', title: '车间名称',
align: "center", align: "center",

@ -29,8 +29,11 @@
prop="responsiblePerson"> prop="responsiblePerson">
<!-- <j-select-multi-user placeholder="请选择车间负责人"--> <!-- <j-select-multi-user placeholder="请选择车间负责人"-->
<!-- v-model="model.responsiblePerson"></j-select-multi-user>--> <!-- v-model="model.responsiblePerson"></j-select-multi-user>-->
<j-select-multi-user placeholder="请选择车间负责人" v-model="model.responsiblePerson" <!-- <j-select-multi-user placeholder="请选择车间负责人" v-model="model.responsiblePerson"-->
:multiple="false"></j-select-multi-user> <!-- :multiple="false"></j-select-multi-user>-->
<j-dict-select-tag type="list" v-model="model.responsiblePerson"
placeholder="请选择车间负责人" :disabled="model.workshopId==null"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -58,7 +61,7 @@
</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="duration"> <a-form-model-item label="生产时长(天)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duration">
<a-input-number v-model="model.duration" placeholder="请输入生产时长" style="width: 100%"/> <a-input-number v-model="model.duration" placeholder="请输入生产时长" style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -112,7 +115,13 @@ export default {
return { return {
groupxVal: "groupx,group_name,id", groupxVal: "groupx,group_name,id",
groupxVal2: "sys_user,realname,id", groupxVal2: "sys_user,realname,id",
model: {}, model: {
workTime: new Date(),
status:0,
auditBy:66,
auditTimr: new Date(),
speedUp:0,
},
labelCol: { labelCol: {
xs: {span: 24}, xs: {span: 24},
sm: {span: 5}, sm: {span: 5},
@ -127,7 +136,7 @@ export default {
{required: true, message: "工单不能为空"}, {required: true, message: "工单不能为空"},
], ],
workshopId: [ workshopId: [
{required: true, message: "工单不能为空"}, {required: true, message: "车间不能为空"},
], ],
teamId: [ teamId: [
{required: true, message: "班组不能为空"}, {required: true, message: "班组不能为空"},
@ -141,6 +150,7 @@ export default {
], ],
}, },
url: { url: {
groupxList: "/groupx/list",
add: "/org.jeecg.modules.productplan/zyProductPlan/add", add: "/org.jeecg.modules.productplan/zyProductPlan/add",
edit: "/org.jeecg.modules.productplan/zyProductPlan/edit", edit: "/org.jeecg.modules.productplan/zyProductPlan/edit",
queryById: "/org.jeecg.modules.productplan/zyProductPlan/queryById" queryById: "/org.jeecg.modules.productplan/zyProductPlan/queryById"
@ -155,10 +165,28 @@ export default {
created() { created() {
//model //model
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
// console.log(this.getNowDate())
// this.getNowDate(); //
}, },
methods: { methods: {
departSelected() {
let that = this;
let param = {
"id": that.model.workshopId,
}
// alert(param.toString());
getAction(that.url.groupxList, param).then((res) => {
if (res.success) {
// console.log("----------" + JSON.stringify(res.result.records))
let phone = JSON.stringify(res.result.records[0].enterprisesNanager);
that.model = Object.assign(that.model, {'mobile': phone});
this.$forceUpdate();
}
});
},
getGroupxValChange() { getGroupxValChange() {
this.groupxVal = "groupx,group_name,id,depart_id='" + this.model.workshopId + "'"; this.groupxVal = "groupx,group_name,id,depart_id='" + this.model.workshopId + "'";
this.departSelected();
}, },
getEnterprisesManagerValChange() { getEnterprisesManagerValChange() {
this.groupxVal2 = "sys_user,realname,id,id=(select enterprises_manager from groupx where id='" + this.model.teamId + "')"; this.groupxVal2 = "sys_user,realname,id,id=(select enterprises_manager from groupx where id='" + this.model.teamId + "')";
@ -199,6 +227,37 @@ export default {
}) })
}, },
getNowDate() {
var date = new Date();
var sign2 = ":";
var year = date.getFullYear() //
var month = date.getMonth() + 1; //
var day = date.getDate(); //
var hour = date.getHours(); //
var minutes = date.getMinutes(); //
var seconds = date.getSeconds() //
var weekArr = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
var week = weekArr[date.getDay()];
// 0
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (day >= 0 && day <= 9) {
day = "0" + day;
}
if (hour >= 0 && hour <= 9) {
hour = "0" + hour;
}
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
} }
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
this.model.workTime = year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
},
},
} }
</script> </script>

@ -1,12 +1,14 @@
package org.jeecg.modules.productplan.controller; package org.jeecg.modules.productplan.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
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.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
@ -14,10 +16,15 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.productplan.entity.ZyProductPlan; import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo; import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.service.IZyProductService;
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.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.jws.Oneway;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
@ -36,6 +43,11 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
@Autowired @Autowired
private IZyProductPlanService zyProductPlanService; private IZyProductPlanService zyProductPlanService;
@Autowired
private IZyProductService iZyProductService;
@Autowired
private ISysDepartService iSysDepartService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -75,6 +87,14 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
@ApiOperation(value = "生产计划-添加", notes = "生产计划-添加") @ApiOperation(value = "生产计划-添加", notes = "生产计划-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyProductPlan zyProductPlan) { public Result<?> add(@RequestBody ZyProductPlan zyProductPlan) {
String productCode = zyProductPlan.getProductCode();
ZyProduct zyProduct = iZyProductService.getOne(new LambdaQueryWrapper<ZyProduct>().eq(ZyProduct::getWorkOrderId, productCode));
zyProductPlan.setProductNo(StringUtils.isNotBlank(zyProduct.getProductCode()) ? zyProduct.getProductCode() : "");
zyProductPlan.setProductName(StringUtils.isNotBlank(zyProduct.getProductName()) ? zyProduct.getProductName() : "");
if (StringUtils.isNotBlank(zyProduct.getEnterprisesId())) {
SysDepart sysDepart = iSysDepartService.getById(zyProduct.getEnterprisesId());
zyProductPlan.setProductOrg(StringUtils.isNotBlank(sysDepart.getDepartName()) ? sysDepart.getDepartName() : "");
}
zyProductPlanService.save(zyProductPlan); zyProductPlanService.save(zyProductPlan);
//TODO 更新work_order表work_order_status为“1” (不能为其新增生产计划) //TODO 更新work_order表work_order_status为“1” (不能为其新增生产计划)
return Result.OK("添加成功!"); return Result.OK("添加成功!");

@ -64,6 +64,15 @@ public class ZyProductPlan implements Serializable {
@Excel(name = "工单编号", width = 15) @Excel(name = "工单编号", width = 15)
@ApiModelProperty(value = "工单编号") @ApiModelProperty(value = "工单编号")
private String productCode; private String productCode;
//产品编码
private String productNo;
//产品名称
private String productName;
//生产企业
private String productOrg;
/** /**
* 车间id * 车间id
*/ */

@ -53,21 +53,11 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, Station> impl
if (maxStationNum.intValue() != entity.getStationNum()) { if (maxStationNum.intValue() != entity.getStationNum()) {
//先把下一编号减1 //先把下一编号减1
Station station1 = this.getOne(new LambdaQueryWrapper<Station>().eq(Station::getStationNum, entity.getStationNum() + 1)); Station station1 = this.getOne(new LambdaQueryWrapper<Station>().eq(Station::getStationNum, entity.getStationNum() + 1));
// station1.setStationNum(null);
this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, station1.getId()).update(); this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, station1.getId()).update();
// Station station = new Station();
// station.setId(id);
// station.setStationNum(null);
this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, id).update(); this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, id).update();
// station.setStationNum(entity.getStationNum() + 1);
// this.updateById(station);
this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() + 1).eq(Station::getId, id).update(); this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() + 1).eq(Station::getId, id).update();
this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() - 1).eq(Station::getId, station1.getId()).update(); this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum()).eq(Station::getId, station1.getId()).update();
// station1.setStationNum(entity.getStationNum() - 1);
// this.updateById(station1);
} }
} }
@ -81,19 +71,11 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, Station> impl
if (entity.getStationNum() > 1) { if (entity.getStationNum() > 1) {
//先把上一编号加1 //先把上一编号加1
Station station1 = this.getOne(new LambdaQueryWrapper<Station>().eq(Station::getStationNum, entity.getStationNum() - 1)); Station station1 = this.getOne(new LambdaQueryWrapper<Station>().eq(Station::getStationNum, entity.getStationNum() - 1));
station1.setStationNum(null); this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, station1.getId()).update();
this.updateById(station1); this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, id).update();
Station station = new Station();
station.setId(id);
station.setStationNum(null);
this.updateById(station);
station.setStationNum(entity.getStationNum() - 1); this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() - 1).eq(Station::getId, id).update();
this.updateById(station); this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum()).eq(Station::getId, station1.getId()).update();
station1.setStationNum(entity.getStationNum() + 1);
this.updateById(station1);
} }
} }
} }

@ -58,6 +58,10 @@ public class ZyProduct implements Serializable {
@Excel(name = "产品编号", width = 15) @Excel(name = "产品编号", width = 15)
@ApiModelProperty(value = "产品编号") @ApiModelProperty(value = "产品编号")
private String productCode; private String productCode;
@Excel(name = "产品编号", width = 50)
@ApiModelProperty(value = "产品名称")
private String productName;
/**工单*/ /**工单*/
@Excel(name = "工单", width = 15) @Excel(name = "工单", width = 15)
@ApiModelProperty(value = "工单") @ApiModelProperty(value = "工单")

Loading…
Cancel
Save