瀏覽代碼

5. 工厂生产管理

liujiankang 5 年之前
父節點
當前提交
88950a1f88

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/PtsEmployee.java

@@ -32,6 +32,7 @@ public class PtsEmployee implements Serializable{
     private Date employeeUpdateTime; //修改时间
     private Date employeeUpdateTime; //修改时间
 
 
     private String employeeLine;  //拉线
     private String employeeLine;  //拉线
+    private Integer isJoinProcess;//是否已加入当日其他工序 1是 2 否
 
 
     public Integer getEmployeeId() {
     public Integer getEmployeeId() {
         return employeeId;
         return employeeId;
@@ -136,4 +137,12 @@ public class PtsEmployee implements Serializable{
     public void setEmployeeLine(String employeeLine) {
     public void setEmployeeLine(String employeeLine) {
         this.employeeLine = employeeLine;
         this.employeeLine = employeeLine;
     }
     }
+
+    public Integer getIsJoinProcess() {
+        return isJoinProcess;
+    }
+
+    public void setIsJoinProcess(Integer isJoinProcess) {
+        this.isJoinProcess = isJoinProcess;
+    }
 }
 }

+ 28 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/PtsEmployeeServiceImpl.java

@@ -3,13 +3,19 @@ package com.iamberry.rst.service.pts;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.faq.FAQDetails;
 import com.iamberry.rst.core.faq.FAQDetails;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.ProductionPlan;
 import com.iamberry.rst.core.pts.PtsEmployee;
 import com.iamberry.rst.core.pts.PtsEmployee;
 import com.iamberry.rst.faces.pts.PtsEmployeeService;
 import com.iamberry.rst.faces.pts.PtsEmployeeService;
+import com.iamberry.rst.service.pts.mapper.ProductionPlanningMapper;
 import com.iamberry.rst.service.pts.mapper.PtsEmployeeMapper;
 import com.iamberry.rst.service.pts.mapper.PtsEmployeeMapper;
 import com.iamberry.rst.util.PageUtil;
 import com.iamberry.rst.util.PageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -21,6 +27,8 @@ public class PtsEmployeeServiceImpl implements PtsEmployeeService {
 
 
     @Autowired
     @Autowired
     private PtsEmployeeMapper ptsEmployeeMapper;
     private PtsEmployeeMapper ptsEmployeeMapper;
+    @Autowired
+    private ProductionPlanningMapper productionPlanningMapper;
 
 
     /**
     /**
      * 获取员工信息
      * 获取员工信息
@@ -51,6 +59,26 @@ public class PtsEmployeeServiceImpl implements PtsEmployeeService {
     public PagedResult<PtsEmployee> getEmployeeList(int pageNO, int pageSize,PtsEmployee employee, boolean isTotalNum) {
     public PagedResult<PtsEmployee> getEmployeeList(int pageNO, int pageSize,PtsEmployee employee, boolean isTotalNum) {
         PageHelper.startPage(pageNO, pageSize, isTotalNum);
         PageHelper.startPage(pageNO, pageSize, isTotalNum);
         List<PtsEmployee> list = ptsEmployeeMapper.getPtsEmployeeList(employee);
         List<PtsEmployee> list = ptsEmployeeMapper.getPtsEmployeeList(employee);
+        //判断是否已经参加其他工作计划
+        if(list != null && list.size() > 0){
+            boolean is = false;
+            ProductionPlan plan = new ProductionPlan();
+            SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
+            try {
+                plan.setPlanDate(sd.parse(sd.format(new Date())));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            for(PtsEmployee e : list){
+                    plan.setEmployeeId(e.getEmployeeId());
+                    if(productionPlanningMapper.getPlanRepeat(plan) > 0){
+                        e.setIsJoinProcess(1);
+                    }else{
+                        e.setIsJoinProcess(2);
+                    }
+            }
+
+        }
         return PageUtil.getPage(list);
         return PageUtil.getPage(list);
     }
     }
 
 

+ 3 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/productionPlanningMapper.xml

@@ -68,6 +68,9 @@
             <if test="planProcessId != null and planProcessId != ''">
             <if test="planProcessId != null and planProcessId != ''">
                 AND plan_process_id = #{planProcessId}
                 AND plan_process_id = #{planProcessId}
             </if>
             </if>
+            <if test="employeeId != null and employeeId != ''">
+                AND pe.pe_employee_id = #{employeeId}
+            </if>
         </where>
         </where>
         group by plan_id
         group by plan_id
     </select>
     </select>

+ 25 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/ProductionPlanController.java

@@ -314,4 +314,29 @@ public class ProductionPlanController {
         }
         }
         return msg;
         return msg;
     }
     }
+    /**
+     * 完善生产计划
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/get_process")
+    public ResponseJson get_process(HttpServletRequest request,Integer planProcessId) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(planProcessId == null ){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        ProductionProcess productionProcess = productionPlanService.getProductionProcess(planProcessId);
+        if(productionProcess != null){
+            msg.addResponseKeyValue("productionProcess",productionProcess);
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }else{
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+        }
+        return msg;
+    }
 }
 }

+ 7 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/employee_list.ftl

@@ -95,11 +95,15 @@
                             <td>${(employee.employeeCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
                             <td>${(employee.employeeCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
                             <td>
                             <td>
                                 <a style="text-decoration:none" href="javascript:void(0);" title="编辑" onclick="admin_update_employee(${employee.employeeId!});">
                                 <a style="text-decoration:none" href="javascript:void(0);" title="编辑" onclick="admin_update_employee(${employee.employeeId!});">
-                                    <i class="Hui-iconfont">&#xe6df;</i>
+                                    编辑
                                 </a>
                                 </a>
-                                <a style="text-decoration:none" href="javascript:;" title="查看作用工序"
+                                <#--<a style="text-decoration:none" href="javascript:;" title="查看作用工序"
                                    onclick="edit_process('${path}/admin/equipment/_update_process?deviceId=0');">
                                    onclick="edit_process('${path}/admin/equipment/_update_process?deviceId=0');">
-                                    <i class="Hui-iconfont">&#xe70c;</i>
+                                    查看作用工序
+                                </a>-->
+                                <a style="text-decoration:none" href="javascript:;" title="查看工作效率"
+                                onclick="admin_edit('查看工作效率','${path}/admin/productionPlan/select_productionPlan_statistical?employeeId='+${employee.employeeId!},300,1000);">
+                                查看工作效率
                                 </a>
                                 </a>
                             </td>
                             </td>
                         </tr>
                         </tr>

+ 29 - 4
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/add_productionPlan.ftl

@@ -68,14 +68,15 @@
         <div class="row cl">
         <div class="row cl">
         <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工序选择:</label>
         <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工序选择:</label>
         <div class="formControls col-xs-9 col-sm-9" style="margin: 10px 0px;padding-left: 0;">
         <div class="formControls col-xs-9 col-sm-9" style="margin: 10px 0px;padding-left: 0;">
-            <select class="my-select" id="planProcessId" name="planProcessId" class="chosen" style="width: 80%;">
+            <select class="my-select" id="planProcessId" name="planProcessId" class="chosen" onchange="getProcess();" style="width: 80%;">
                 <option value="">请选择工序</option>
                 <option value="">请选择工序</option>
                     <#if (listProductionProcess?size > 0)>
                     <#if (listProductionProcess?size > 0)>
                         <#list listProductionProcess as info>
                         <#list listProductionProcess as info>
                                 <option  value="${info.processId!""}">${info.processName!""}</option>
                                 <option  value="${info.processId!""}">${info.processName!""}</option>
                         </#list>
                         </#list>
                     </#if>
                     </#if>
-            </select>
+            </select><br>
+            <span id="ProcessSpanOne" style="display: none; color: #6d6d72;">已选择工序:<span id="ProcessSpan"></span></span>
         </div>
         </div>
         </div>
         </div>
         <div class="row cl">
         <div class="row cl">
@@ -229,9 +230,10 @@
                 async: false,
                 async: false,
                 success: function(data){
                 success: function(data){
                     if (data.returnCode == 200) {
                     if (data.returnCode == 200) {
-                        layer.msg("添加成功!", {icon: 1, time: 1000},function () {
+                        /*layer.msg("添加成功!", {icon: 1, time: 1000},function () {
                             layer_close();
                             layer_close();
-                        });
+                        });*/
+                        layer.msg("添加成功!", {icon: 1, time: 2000});
                     } else if(data.returnCode == 501){
                     } else if(data.returnCode == 501){
                         var names = "";
                         var names = "";
                         var employeeList = data.returnMsg.employeeList;
                         var employeeList = data.returnMsg.employeeList;
@@ -254,6 +256,29 @@
         }
         }
     }
     }
 
 
+    /*查询工序计划*/
+    function getProcess(){
+        var planProcessId = $("#planProcessId").val();
+            if (planProcessId != null) {
+                $.ajax({
+                    type: "POST",
+                    url: "${path}/admin/productionPlan/get_process",
+                    async: false,
+                    data: {planProcessId: planProcessId},
+                    success: function (data) {
+                        if (data.returnCode == 200) {
+                            var productionProcess = data.returnMsg.productionProcess;
+                            var strings = productionProcess.processName + ",标准工时为:每" +productionProcess.processUnit+"每人" + (60/productionProcess.processWorkinghours)+"分钟";
+                            $("#ProcessSpan").html(strings);
+                            $("#ProcessSpanOne").show();
+                        }
+                    },
+                    error: function () {
+                        console.log("查询工序失败!");
+                    }
+                });
+            }
+    }
 </script>
 </script>
 </body>
 </body>
 </html>
 </html>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/employee_list.ftl

@@ -80,7 +80,7 @@
                 <#if page.dataList?? &&  (page.dataList?size > 0) >
                 <#if page.dataList?? &&  (page.dataList?size > 0) >
                     <#list page.dataList as employee>
                     <#list page.dataList as employee>
                         <tr class="text-c">
                         <tr class="text-c">
-                            <td><input type="checkbox" class="employee_id"   name="employee_Id" value="${employee.employeeId!}" ></td>
+                            <td><input type="checkbox" class="employee_id" <#if employee.isJoinProcess == 1>disabled="true"</#if>  name="employee_Id" value="${employee.employeeId!}" ></td>
                             <td>${employee.employeeNo!}</td>
                             <td>${employee.employeeNo!}</td>
                             <td>${employee.employeeName!}</td>
                             <td>${employee.employeeName!}</td>
                             <td>${employee.employeeTel!}</td>
                             <td>${employee.employeeTel!}</td>

+ 4 - 4
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/perfect_productionPlan.ftl

@@ -7,7 +7,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
     <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
     <meta http-equiv="Cache-Control" content="no-siteapp" />
     <meta http-equiv="Cache-Control" content="no-siteapp" />
 <#include "/base/add_base.ftl">
 <#include "/base/add_base.ftl">
-    <title>添加生产计划 - H-ui.filter v2.4</title>
+    <title>完善工作计划 - H-ui.filter v2.4</title>
     <style>
     <style>
         .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
         .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
         .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
         .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
@@ -245,10 +245,10 @@
                 async: false,
                 async: false,
                 success: function(data){
                 success: function(data){
                     if (data.returnCode == 200) {
                     if (data.returnCode == 200) {
-                        layer.msg("完善成功!", {icon: 1, time: 1000},function () {
+                        l/*ayer.msg("完善成功!", {icon: 1, time: 1000},function () {
                             layer_close();
                             layer_close();
-                        });
-
+                        });*/
+                        layer.msg("完善成功!", {icon: 1, time: 2000});
                     } else {
                     } else {
                         layer.msg("完善失败!", {icon: 5, time: 2000});
                         layer.msg("完善失败!", {icon: 5, time: 2000});
                     }
                     }

+ 16 - 7
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/productionPlan_List.ftl

@@ -19,12 +19,12 @@
 	<body>
 	<body>
     <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
     <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
         <span class="c-gray en">/</span> PST管理
         <span class="c-gray en">/</span> PST管理
-        <span class="c-gray en">/</span> 生产计划列表
+        <span class="c-gray en">/</span> 工作计划列表
         <a class="btn radius r" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
         <a class="btn radius r" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
     </nav>
     </nav>
 		<div class="text-c" style="margin-top: 20px;">
 		<div class="text-c" style="margin-top: 20px;">
 			<form action="${path}/admin/productionPlan/select_productionPlan_list" method="post">
 			<form action="${path}/admin/productionPlan/select_productionPlan_list" method="post">
-                <button type="button" class="my-btn-search" onclick="add_employee('添加生产计划','${path}/admin/productionPlan/to_addProductionPlan','970','750');" style="cursor:pointer; margin-right: 50px;">添加生产计划</button>
+                <button type="button" class="my-btn-search" onclick="add_employee('${path}/admin/productionPlan/to_addProductionPlan');" style="cursor:pointer; margin-right: 50px;">添加工作计划</button>
                 <input class="my-input" style="width: 12%;" type="text" value="<#if planDate??>${planDate?string("yyyy-MM-dd")!''}</#if>" name="plan_Date" id="plan_Date" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="工作计划日期" readonly="readonly"/>
                 <input class="my-input" style="width: 12%;" type="text" value="<#if planDate??>${planDate?string("yyyy-MM-dd")!''}</#if>" name="plan_Date" id="plan_Date" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="工作计划日期" readonly="readonly"/>
                 <select class="my-select" id="planProcessId" name="planProcessId"  style="width: 12%;">
                 <select class="my-select" id="planProcessId" name="planProcessId"  style="width: 12%;">
                     <option value="">请选择工序</option>
                     <option value="">请选择工序</option>
@@ -45,6 +45,8 @@
 					<th width="100">拉线</th>
 					<th width="100">拉线</th>
 					<th width="100">工序</th>
 					<th width="100">工序</th>
 					<th width="100">员工数量</th>
 					<th width="100">员工数量</th>
+					<th width="100">工作时长</th>
+					<th width="100">工作成果</th>
 					<th width="100">更新时间</th>
 					<th width="100">更新时间</th>
 					<th width="100">操作</th>
 					<th width="100">操作</th>
 				</tr>
 				</tr>
@@ -57,17 +59,21 @@
 							<td class="text-c" width="100">${list.planStay!''}</td>
 							<td class="text-c" width="100">${list.planStay!''}</td>
 							<td class="text-c" width="100">${list.processName!''}</td>
 							<td class="text-c" width="100">${list.processName!''}</td>
 							<td class="text-c" width="100">${list.employeesNum!''}</td>
 							<td class="text-c" width="100">${list.employeesNum!''}</td>
+							<td class="text-c" width="100">${list.planWorkHours!''}</td>
+							<td class="text-c" width="100">${list.planResults!''}</td>
 							<td class="text-c" width="100">${(list.planUpdateTime?string("yyyy-MM-dd HH:mm:ss"))!''!''}</td>
 							<td class="text-c" width="100">${(list.planUpdateTime?string("yyyy-MM-dd HH:mm:ss"))!''!''}</td>
 							<!-- 遍历操作 -->
 							<!-- 遍历操作 -->
 							<td class="td-manage text-c">
 							<td class="td-manage text-c">
-                                <a onclick="add_employee('编辑','${path}/admin/productionPlan/to_update_productionPlan?planId='+${list.planId!''},'970','750');" title="编辑" href="javascript:;"  class="ml-5" style="text-decoration:none">编辑</a>
+                                <a onclick="add_employee('${path}/admin/productionPlan/to_update_productionPlan?planId='+${list.planId!''});" title="编辑" href="javascript:;"  class="ml-5" style="text-decoration:none">编辑</a>
                                 <a onclick="delProductionPlan(${list.planId!''});" title="删除生产计划" href="javascript:;"  class="ml-5" style="text-decoration:none">删除</a>
                                 <a onclick="delProductionPlan(${list.planId!''});" title="删除生产计划" href="javascript:;"  class="ml-5" style="text-decoration:none">删除</a>
-                                <a onclick="add_employee('完善生产计划','${path}/admin/productionPlan/to_perfect_productionPlan?planId='+${list.planId!''},'970','750');" title="完善工作计划" href="javascript:;"  class="ml-5" style="text-decoration:none">完善工作计划</a>
-                            </td>
+                                <#if !list.planWorkHours??>
+                                    <a onclick="add_employee('${path}/admin/productionPlan/to_perfect_productionPlan?planId='+${list.planId!''});" title="完善工作计划" href="javascript:;"  class="ml-5" style="text-decoration:none">完善工作计划</a>
+                                </#if>
+                                </td>
 						</tr>
 						</tr>
 					</#list>
 					</#list>
                 <#else>
                 <#else>
-                <tr><td id="noMachineTr" colspan="11" class="td-manage text-c" >暂时没有生产计划,请添加!</td></tr>
+                <tr><td id="noMachineTr" colspan="11" class="td-manage text-c" >暂时没有工作计划,请添加!</td></tr>
                 </#if>
                 </#if>
 				</tbody>
 				</tbody>
 			</table>
 			</table>
@@ -86,8 +92,11 @@
 
 
 
 
 
 
-            function add_employee(title,url,w,h){
+            /*function add_employee(title,url,w,h){
                 layer_show(title,url,w,h);
                 layer_show(title,url,w,h);
+            }*/
+            function add_employee(url) {
+                window.location.href= url;
             }
             }
 
 
             /*删除计划*/
             /*删除计划*/

+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/productionPlan_statistical.ftl

@@ -19,7 +19,7 @@
 	<body>
 	<body>
     <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
     <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
         <span class="c-gray en">/</span> PST管理
         <span class="c-gray en">/</span> PST管理
-        <span class="c-gray en">/</span> 生产计划统计列表
+        <span class="c-gray en">/</span> 工作计划统计列表
         <a class="btn radius r" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
         <a class="btn radius r" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
     </nav>
     </nav>
 		<div class="text-c" style="margin-top: 20px;">
 		<div class="text-c" style="margin-top: 20px;">
@@ -45,7 +45,7 @@
 					<th width="100">总人数</th>
 					<th width="100">总人数</th>
 					<th width="100">总工时</th>
 					<th width="100">总工时</th>
 					<th width="100">完成总工作量</th>
 					<th width="100">完成总工作量</th>
-					<th width="100">实际效率<br>(实际完成数量/时间/人数)</th>
+					<th width="150">实际效率(实际完成数量/时间/人数)</th>
 					<th width="100">标准效率</th>
 					<th width="100">标准效率</th>
 					<th width="100">实际效率比</th>
 					<th width="100">实际效率比</th>
 				</tr>
 				</tr>

+ 1 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/update_productionPlan.ftl

@@ -70,6 +70,7 @@
                             </#list>
                             </#list>
                         </#if>
                         </#if>
                     </select>
                     </select>
+                    <span style="display: none;">已选择工序:<span></span></span>
                 </div>
                 </div>
             </div>
             </div>
         <div class="row cl">
         <div class="row cl">