生产计划排位图 1.12

zhc4dev
zhc077 2 years ago
parent cafc1d4fd2
commit d6ee9fd584
  1. 106
      ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue
  2. 10
      ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue
  3. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java
  4. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java
  5. 31
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/PaiWeiTuVo.java
  6. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanService.java
  7. 92
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyProductPlanServiceImpl.java

@ -81,19 +81,8 @@
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<!-- <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>-->
<a-divider type="vertical"/>
<a @click="getPaiWeiTu(record)">生产计划排位图</a>
</span>
</a-table>
@ -109,6 +98,8 @@ import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyProductPlanModal from './modules/ZyProductPlanModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ZyProductPlanList',
@ -164,11 +155,11 @@ export default {
{
title: '组长',
align: "center",
dataIndex: 'teamLeader'
dataIndex: 'teamLeader_dictText'
},
{
title: '生产开始时间',
width:150,
width: 150,
align: "center",
dataIndex: 'workTime',
// customRender: function (text) {
@ -205,7 +196,7 @@ export default {
},
{
title: '审核时间',
width:150,
width: 150,
align: "center",
dataIndex: 'auditTimr',
// customRender: function (text) {
@ -223,6 +214,7 @@ export default {
],
url: {
list: "/org.jeecg.modules.productplan/zyProductPlan/list",
paiweitu: "/org.jeecg.modules.productplan/zyProductPlan/paiweitu",
delete: "/org.jeecg.modules.productplan/zyProductPlan/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyProductPlan/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.productplan/zyProductPlan/exportXls",
@ -234,7 +226,7 @@ export default {
}
},
created() {
this.getSuperFieldList();
// this.getSuperFieldList();
},
computed: {
// importExcelUrl: function(){
@ -242,23 +234,71 @@ export default {
// },
},
methods: {
initDictConfig() {
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'productCode', text: '工单编号', dictCode: ''})
fieldList.push({type: 'string', value: 'workshopId', text: '车间id', dictCode: ''})
fieldList.push({type: 'string', value: 'responsiblePerson', text: '车间负责人', dictCode: ''})
fieldList.push({type: 'string', value: 'teamId', text: '班组', dictCode: ''})
fieldList.push({type: 'string', value: 'teamLeader', text: '组长', dictCode: ''})
fieldList.push({type: 'date', value: 'workTime', text: '生产开始时间'})
fieldList.push({type: 'int', value: 'duration', text: '生产时长', dictCode: ''})
fieldList.push({type: 'int', value: 'status', text: '状态', dictCode: ''})
fieldList.push({type: 'int', value: 'speedUp', text: '是否加急', dictCode: ''})
fieldList.push({type: 'string', value: 'auditBy', text: '审核人', dictCode: ''})
fieldList.push({type: 'date', value: 'auditTimr', text: '审核时间'})
this.superFieldList = fieldList
getPaiWeiTu(record) {
// alert(JSON.stringify(record));
getAction(this.url.paiweitu, record).then((res) => {
if (res.success) {
// this.dataSource = res.result.records || res.result;
console.log("the paiweitu----------"+JSON.stringify(res.result))
} else {
this.$message.warning(res.message)
}
}).finally(() => {
// this.dataSource.forEach(item => {
// item['stationName'] = this.stationName;
// item['stationNum'] = this.stationNum;
// })
this.loading = false
})
},
// loadData(arg) {
// if (!this.url.list) {
// this.$message.error("url.list!")
// return
// }
// // 1
// if (arg === 1) {
// this.ipagination.current = 1;
// }
// this.loadParameter();
// var params = this.getQueryParams();//
// this.loading = true;
// console.log("----------------the params:", params);
// getAction(this.url.list, params).then((res) => {
// if (res.success) {
// this.dataSource = res.result.records || res.result;
// if (res.result.total) {
// this.ipagination.total = res.result.total;
// } else {
// this.ipagination.total = 0;
// }
// } else {
// this.$message.warning(res.message)
// }
// }).finally(() => {
// // this.dataSource.forEach(item => {
// // item['stationName'] = this.stationName;
// // item['stationNum'] = this.stationNum;
// // })
// this.loading = false
// })
// },
// getQueryParams() {
// //
// let sqp = {}
// if (this.superQueryParams) {
// sqp['superQueryParams'] = encodeURI(this.superQueryParams)
// sqp['superQueryMatchType'] = this.superQueryMatchType
// }
// var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
// param.field = this.getQueryField();
// param.pageNo = this.ipagination.current;
// param.pageSize = this.ipagination.pageSize;
// param.planId = this.planId;
// return filterObj(param);
// },
}
}
</script>

@ -53,7 +53,8 @@
<a-col :span="24">
<a-form-model-item label="生产开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workTime">
<!-- <j-date placeholder="请选择生产开始时间" v-model="model.workTime" style="width: 100%"/>-->
<a-date-picker placeholder="请选择生产开始时间" showTime valueFormat='YYYY-MM-DD HH:mm:ss' v-model="model.workTime" style="width: 100%"/>
<a-date-picker placeholder="请选择生产开始时间" showTime valueFormat='YYYY-MM-DD HH:mm:ss'
v-model="model.workTime" style="width: 100%"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -110,7 +111,7 @@ export default {
data() {
return {
groupxVal: "groupx,group_name,id",
groupxVal2: "groupx,enterprises_manager,id",
groupxVal2: "sys_user,realname,id",
model: {},
labelCol: {
xs: {span: 24},
@ -157,13 +158,10 @@ export default {
},
methods: {
getGroupxValChange() {
// alert("" + this.model.workshopId);
// this.basicInfoCode = "py_basic_info,chart_head,id, major_id='" + this.queryParam.majorId + "'";
this.groupxVal = "groupx,group_name,id,depart_id='" + this.model.workshopId + "'";
// this.groupxVal2 = "groupx,enterprises_manager,enterprises_manager,depart_id='" + this.model.workshopId + "'";
},
getEnterprisesManagerValChange() {
this.groupxVal2 = "groupx,enterprises_manager,enterprises_manager,id='" + this.model.teamId + "'";
this.groupxVal2 = "sys_user,realname,id,id=(select enterprises_manager from groupx where id='" + this.model.teamId + "')";
},
add() {
this.edit(this.modelDefault);

@ -12,6 +12,7 @@ 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.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -57,6 +58,13 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
return Result.OK(pageList);
}
@ApiOperation(value = "生产计划-排位图", notes = "生产计划-排位图")
@GetMapping(value = "/paiweitu")
public Result<?> getPaiweitu(ZyProductPlan zyProductPlan, HttpServletRequest request) {
PaiWeiTuVo paiweitu = zyProductPlanService.paiweitu(zyProductPlan);
return Result.OK(paiweitu);
}
/**
* 添加
*

@ -89,6 +89,7 @@ public class ZyProductPlan implements Serializable {
*/
@Excel(name = "组长", width = 15)
@ApiModelProperty(value = "组长")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
private String teamLeader;
/**
* 生产开始时间

@ -0,0 +1,31 @@
package org.jeecg.modules.productplan.entity.vo;
import lombok.Data;
import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import java.util.List;
@Data
public class PaiWeiTuVo {
// 订单总件数
private Integer goodsNum;
// 生产人数
private Integer memberNum;
// 客户名称
private String user;
// 制单号
private String makerId;
// 款式号
private String style;
// 班组
private String teamName;
// 标准工时(分)
private Integer duration;
private List<ZyPlanProcess> list;
}

@ -2,6 +2,9 @@ package org.jeecg.modules.productplan.service;
import org.jeecg.modules.productplan.entity.ZyProductPlan;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import java.util.List;
/**
* @Description: 生产计划
@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IZyProductPlanService extends IService<ZyProductPlan> {
PaiWeiTuVo paiweitu(ZyProductPlan zyProductPlan);
}

@ -1,10 +1,33 @@
package org.jeecg.modules.productplan.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import org.jeecg.modules.productplan.mapper.ZyProductPlanMapper;
import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.team.entity.Groupx;
import org.jeecg.modules.team.service.IGroupxService;
import org.jeecg.modules.workorder.entity.WorkOrder;
import org.jeecg.modules.workorder.service.IWorkOrderService;
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @Description: 生产计划
@ -15,4 +38,73 @@ import org.springframework.stereotype.Service;
@Service
public class ZyProductPlanServiceImpl extends ServiceImpl<ZyProductPlanMapper, ZyProductPlan> implements IZyProductPlanService {
@Autowired
private IZyProductPlanService iZyProductPlanService;
@Autowired
private IZyPlanProcessService iZyPlanProcessService;
// 订单基本信息
@Autowired
private IZyOrdersService iZyOrdersService;
// 工单信息
@Autowired
private IWorkOrderService iWorkOrderService;
//商品订单信息
@Autowired
private IOrderGoodsService iOrderGoodsService;
@Autowired
private ISysUserService iSysUserService;
@Autowired
private IZyClothsStyleService iZyClothsStyleService;
@Autowired
private IGroupxService iGroupxService;
@Override
public PaiWeiTuVo paiweitu(ZyProductPlan plan) {
ZyProductPlan productPlan = iZyProductPlanService.getById(plan.getId());
if (ObjectUtils.isEmpty(productPlan)) throw new JeecgBootException(plan.getId() + "生产计划不存在");
// 工单信息
WorkOrder workOrder = iWorkOrderService.getOne(new LambdaQueryWrapper<WorkOrder>().eq(WorkOrder::getProductCode, productPlan.getProductCode()));
if (ObjectUtils.isEmpty(workOrder))
throw new JeecgBootException(productPlan.getProductCode() + "工单信息不存在");
String ordersId = workOrder.getOrdersId();
OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrdersId, ordersId));
if (ObjectUtils.isEmpty(orderGoods)) throw new JeecgBootException(ordersId + "订单商品信息不存在");
ZyOrders zyOrders = iZyOrdersService.getOne(new LambdaQueryWrapper<ZyOrders>().eq(ZyOrders::getId, ordersId));
if (ObjectUtils.isEmpty(zyOrders)) throw new JeecgBootException(ordersId + "订单信息不存在");
PaiWeiTuVo vo = new PaiWeiTuVo();
ZyClothsStyle zyClothsStyle = iZyClothsStyleService.getById(orderGoods.getStyleId());
vo.setStyle(StringUtils.isNotBlank(zyClothsStyle.getStyleNames()) ? zyClothsStyle.getStyleNames() : "");
vo.setGoodsNum(orderGoods.getGoodsNum());
// SysUser sysUser = iSysUserService.getById(zyOrders.getUserId());
// vo.setUser(StringUtils.isNotBlank(sysUser.getRealname()) ? sysUser.getRealname() : "");
vo.setUser(zyOrders.getUserId());
AtomicInteger memberNum = new AtomicInteger(0);
List<ZyPlanProcess> planProcessList = iZyPlanProcessService
.list(new LambdaQueryWrapper<ZyPlanProcess>()
.eq(ZyPlanProcess::getPlanId, plan.getId()));
if (!ObjectUtils.isEmpty(planProcessList)) {
planProcessList.forEach(e -> {
if (StringUtils.isNotBlank(e.getUserIds())) {
List<String> userList = Arrays.asList(e.getUserIds().split(","));
memberNum.addAndGet(userList.size());
}
});
vo.setList(planProcessList);
}
vo.setMemberNum(memberNum.intValue());
Groupx groupx = iGroupxService.getById(productPlan.getTeamId());
vo.setTeamName(StringUtils.isNotBlank(groupx.getGroupName()) ? groupx.getGroupName() : "");
vo.setDuration(productPlan.getDuration());
return vo;
}
}

Loading…
Cancel
Save