工单导入、登录用户只能看到自身的工单
This commit is contained in:
@@ -264,6 +264,22 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-freemarker</artifactId>
|
||||
</dependency>
|
||||
<!-- excel工具 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -70,6 +70,9 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||
String is_error = MapUtil.getStr(whereJson, "is_error");
|
||||
String product_area = MapUtil.getStr(whereJson, "product_area");
|
||||
String product_series = "";
|
||||
// 员工只能看到自己创建的工单
|
||||
String currentUserId = "";
|
||||
if (!SecurityUtils.getCurrentUsername().equals("admin")) currentUserId = SecurityUtils.getCurrentUserId();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
//map.put("order_status", order_status);
|
||||
@@ -77,6 +80,7 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
map.put("product_area", product_area);
|
||||
map.put("current_produce_person_id", currentUserId);
|
||||
if (StrUtil.isNotEmpty(order_status)) {
|
||||
order_status = order_status.replace("[\"", "").replace("\"]", "").replace("\"", "");
|
||||
}
|
||||
@@ -304,7 +308,7 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||
//按照列获取
|
||||
param.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
param.put("workorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||
param.put("macoperate_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
// param.put("macoperate_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
param.put("workorder_status", WorkerOrderEnum.CREATE.getCode());
|
||||
param.put("shift_type_scode", WorkerOrderEnum.DAYSHIFT.getCode()); // 默认白班
|
||||
String is_error = "0";
|
||||
@@ -377,12 +381,12 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||
}
|
||||
}
|
||||
if (j == 11) {
|
||||
SysUser jsonUser = userService.getOne(new QueryWrapper<SysUser>().eq("username", SecurityUtils.getCurrentUsername()));
|
||||
SysUser jsonUser = userService.getOne(new QueryWrapper<SysUser>().eq("username", col));
|
||||
if (ObjectUtil.isEmpty(jsonUser)) {
|
||||
is_error = "1";
|
||||
error_message = error_message + "生产人员编码不存在!";
|
||||
}else {
|
||||
param.put("jockey_id", jsonUser.getUserId());
|
||||
param.put("current_produce_person_id", jsonUser.getUserId());
|
||||
}
|
||||
}
|
||||
if (j == 12) {
|
||||
@@ -404,6 +408,7 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||
}
|
||||
param.put("is_error", is_error);
|
||||
param.put("error_info", error_message);
|
||||
param.put("create_type", WorkerOrderEnum.EXCELINTO.getCode());
|
||||
param.put("planproducestart_date", produce_date + "07:30:00");
|
||||
param.put("planproduceend_date", produce_date + "18:30:00");
|
||||
param.put("create_id", currentUserId);
|
||||
@@ -431,13 +436,12 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||
//获取每列
|
||||
JSONObject param = new JSONObject();
|
||||
//按照列获取
|
||||
param.put("produceorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
param.put("produceorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||
param.put("producedeviceorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||
param.put("order_status", "00");
|
||||
param.put("order_type_scode", "01");
|
||||
param.put("produce_date", produce_date);
|
||||
param.put("shift_type_scode", "02");
|
||||
param.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
param.put("workorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||
// param.put("producedeviceorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||
param.put("workorder_status", WorkerOrderEnum.CREATE.getCode());
|
||||
// param.put("produce_date", produce_date);
|
||||
param.put("shift_type_scode", WorkerOrderEnum.NIGHTSHIFT.getCode()); // 夜班
|
||||
//循环每一行
|
||||
col:
|
||||
for (int j = 0; j < list.size(); j++) {
|
||||
@@ -514,12 +518,12 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||
}
|
||||
}
|
||||
if (j == 11) {
|
||||
SysUser jsonUser = userService.getOne(new QueryWrapper<SysUser>().eq("username", SecurityUtils.getCurrentUsername()));
|
||||
SysUser jsonUser = userService.getOne(new QueryWrapper<SysUser>().eq("username", col));
|
||||
if (ObjectUtil.isEmpty(jsonUser)) {
|
||||
is_error = "1";
|
||||
error_message = error_message + "生产人员编码不存在!";
|
||||
}else {
|
||||
param.put("jockey_id", jsonUser.getUserId());
|
||||
param.put("current_produce_person_id", jsonUser.getUserId());
|
||||
}
|
||||
}
|
||||
if (j == 12) {
|
||||
@@ -541,6 +545,7 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||
}
|
||||
param.put("is_error", is_error);
|
||||
param.put("error_info", error_message);
|
||||
param.put("create_type", WorkerOrderEnum.EXCELINTO.getCode());
|
||||
param.put("planproducestart_date", produce_date + "18:30:00");
|
||||
DateTime dateTime = DateUtil.offsetDay(DateUtil.parse(produce_date), 1);
|
||||
param.put("planproduceend_date", DateUtil.format(dateTime,"yyyy-MM-dd") + " 07:30:00");
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
输入.workprocedure_ids TYPEAS f_string
|
||||
输入.workprocedure_id TYPEAS f_string
|
||||
输入.unFinish TYPEAS s_string
|
||||
输入.current_produce_person_id TYPEAS s_string
|
||||
输入.device_ids TYPEAS f_string
|
||||
|
||||
|
||||
@@ -75,6 +76,9 @@
|
||||
OPTION 输入.unFinish <> ""
|
||||
ShiftOrder.workorder_status <> '5'
|
||||
ENDOPTION
|
||||
OPTION 输入.current_produce_person_id <> ""
|
||||
ShiftOrder.current_produce_person_id = 输入.current_produce_person_id
|
||||
ENDOPTION
|
||||
OPTION 输入.order_status <> ""
|
||||
find_in_set(ShiftOrder.workorder_status, 输入.order_status)
|
||||
ENDOPTION
|
||||
|
||||
@@ -364,7 +364,7 @@
|
||||
<el-table-column prop="product_area" label="生产区域" />
|
||||
<el-table-column prop="plan_qty" label="计划数量" />
|
||||
<el-table-column prop="real_qty" label="实际数量" />
|
||||
<el-table-column prop="person_name" label="操作员" />
|
||||
<el-table-column prop="person_name" label="生产人员" />
|
||||
<el-table-column prop="person_real_qty" label="人员实际数量" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="dq_real_qty" label="电气实际数量" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" width="120" show-overflow-tooltip />
|
||||
@@ -390,7 +390,7 @@
|
||||
{{ dict.label.IS_OR_NOT[scope.row.is_needmove] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_type" label="创建类型">
|
||||
<el-table-column prop="create_type" label="创建类型" show-overflow-tooltip >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.WORKORDER_CREATE_TYPE[scope.row.create_type] }}
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user