Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
klck
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
位宇华
klck
Commits
0a8c0671
Commit
0a8c0671
authored
Aug 09, 2023
by
lvzhuangzhuang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
973c5455
166b09a1
Changes
43
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
2116 additions
and
1747 deletions
+2116
-1747
pom.xml
pom.xml
+9
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesController.java
...va/com/ruoyi/system/controller/ActSuppliesController.java
+17
-8
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesConvertController.java
...ruoyi/system/controller/ActSuppliesConvertController.java
+4
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesDetailsController.java
...ruoyi/system/controller/ActSuppliesDetailsController.java
+19
-8
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesHistorydataController.java
...i/system/controller/ActSuppliesHistorydataController.java
+19
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesRoleController.java
...om/ruoyi/system/controller/ActSuppliesRoleController.java
+53
-21
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesTemplateController.java
...uoyi/system/controller/ActSuppliesTemplateController.java
+35
-6
ruoyi-supplies/src/main/java/com/ruoyi/system/domain/ActSuppliesHTRImport.java
...in/java/com/ruoyi/system/domain/ActSuppliesHTRImport.java
+15
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesDetailsMapper.java
...ava/com/ruoyi/system/mapper/ActSuppliesDetailsMapper.java
+5
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesHistorydataMapper.java
...com/ruoyi/system/mapper/ActSuppliesHistorydataMapper.java
+9
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesMapper.java
.../main/java/com/ruoyi/system/mapper/ActSuppliesMapper.java
+5
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesRoleDetailMapper.java
.../com/ruoyi/system/mapper/ActSuppliesRoleDetailMapper.java
+2
-0
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesRoleMapper.java
...n/java/com/ruoyi/system/mapper/ActSuppliesRoleMapper.java
+18
-2
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesTemplateMapper.java
...va/com/ruoyi/system/mapper/ActSuppliesTemplateMapper.java
+13
-2
ruoyi-supplies/src/main/java/com/ruoyi/system/service/ActSuppliesTemplateService.java
.../com/ruoyi/system/service/ActSuppliesTemplateService.java
+25
-3
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesDetailsService.java
.../com/ruoyi/system/service/IActSuppliesDetailsService.java
+7
-5
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesHistorydataService.java
.../ruoyi/system/service/IActSuppliesHistorydataService.java
+3
-1
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesRoleService.java
...ava/com/ruoyi/system/service/IActSuppliesRoleService.java
+8
-4
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesService.java
...in/java/com/ruoyi/system/service/IActSuppliesService.java
+4
-3
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesDetailsServiceImpl.java
...yi/system/service/impl/ActSuppliesDetailsServiceImpl.java
+19
-29
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
...ystem/service/impl/ActSuppliesHistorydataServiceImpl.java
+61
-4
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesRoleServiceImpl.java
...ruoyi/system/service/impl/ActSuppliesRoleServiceImpl.java
+159
-6
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesServiceImpl.java
...com/ruoyi/system/service/impl/ActSuppliesServiceImpl.java
+23
-33
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesTemplateServiceImpl.java
...i/system/service/impl/ActSuppliesTemplateServiceImpl.java
+57
-21
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesDetailsMapper.xml
...main/resources/mapper/system/ActSuppliesDetailsMapper.xml
+12
-0
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesHistorydataMapper.xml
.../resources/mapper/system/ActSuppliesHistorydataMapper.xml
+38
-2
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesMapper.xml
...es/src/main/resources/mapper/system/ActSuppliesMapper.xml
+14
-0
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesRoleDetailMapper.xml
...n/resources/mapper/system/ActSuppliesRoleDetailMapper.xml
+12
-24
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesRoleMapper.xml
...rc/main/resources/mapper/system/ActSuppliesRoleMapper.xml
+38
-0
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesTemplateMapper.xml
...ain/resources/mapper/system/ActSuppliesTemplateMapper.xml
+51
-5
ruoyi-ui/public/exportExcel.js
ruoyi-ui/public/exportExcel.js
+7
-5
ruoyi-ui/src/api/ActSuppliesDetails/ActSuppliesDetails.js
ruoyi-ui/src/api/ActSuppliesDetails/ActSuppliesDetails.js
+8
-9
ruoyi-ui/src/api/Actsupplies/Actsupplies.js
ruoyi-ui/src/api/Actsupplies/Actsupplies.js
+17
-4
ruoyi-ui/src/api/ruoyi-myLuckyexcel/myluckyexcel.js
ruoyi-ui/src/api/ruoyi-myLuckyexcel/myluckyexcel.js
+25
-0
ruoyi-ui/src/api/system/historydata.js
ruoyi-ui/src/api/system/historydata.js
+10
-1
ruoyi-ui/src/api/system/suppliesrole.js
ruoyi-ui/src/api/system/suppliesrole.js
+25
-9
ruoyi-ui/src/views/system/ActSuppliesDetails/ActSuppliesDetails/index.vue
...ws/system/ActSuppliesDetails/ActSuppliesDetails/index.vue
+426
-426
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/index.vue
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/index.vue
+3
-3
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/indexone.vue
...-ui/src/views/system/Actsupplies/Actsupplies/indexone.vue
+4
-4
ruoyi-ui/src/views/system/supplies/index.vue
ruoyi-ui/src/views/system/supplies/index.vue
+443
-918
ruoyi-ui/src/views/system/supplies/index_template.vue
ruoyi-ui/src/views/system/supplies/index_template.vue
+139
-18
ruoyi-ui/src/views/system/suppliesrole/index.vue
ruoyi-ui/src/views/system/suppliesrole/index.vue
+178
-62
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
+77
-98
No files found.
pom.xml
View file @
0a8c0671
...
...
@@ -4,6 +4,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.ruoyi
</groupId>
<artifactId>
ruoyi
</artifactId>
<version>
3.4.0
</version>
...
...
@@ -121,6 +122,14 @@
<version>
${swagger.version}
</version>
</dependency>
<!-- lombok的依赖项-->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.26
</version>
<scope>
provided
</scope>
</dependency>
<!--io常用工具类 -->
<dependency>
<groupId>
commons-io
</groupId>
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesController.java
View file @
0a8c0671
...
...
@@ -10,6 +10,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.system.domain.ActSupplies
;
import
com.ruoyi.system.service.IActSuppliesService
;
import
com.ruoyi.system.web.ServiceCode
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -164,20 +165,24 @@ public class ActSuppliesController extends BaseController
* 启用物料总分类管理
*/
@PreAuthorize
(
"@ss.hasPermi('Actsupplies:Actsupplies:enable')"
)
@
GetMapping
(
"/enable/{id}
"
)
public
AjaxResult
setEnable
(
@PathVariable
(
"id"
)
Long
id
)
@
PutMapping
(
"/{id}/enable
"
)
public
AjaxResult
setEnable
(
@PathVariable
(
"id"
)
Long
id
,
@RequestParam
(
"status"
)
Integer
status
)
{
actSuppliesService
.
setEnable
(
id
);
return
AjaxResult
.
success
();
actSuppliesService
.
setEnable
(
id
,
status
);
if
(
status
<
0
){
return
AjaxResult
.
error
(
ServiceCode
.
ERR_CODE
+
""
,
"启用失败"
);
}
else
{
return
AjaxResult
.
success
(
ServiceCode
.
OK
+
""
,
"启用成功"
);
}
}
/**
* 禁用物料总分类管理
*/
@PreAuthorize
(
"@ss.hasPermi('Actsupplies:Actsupplies:Disable')"
)
@
GetMapping
(
"/disable/{id}
"
)
public
AjaxResult
setDisable
(
@PathVariable
(
"id"
)
Long
id
)
@
PutMapping
(
"/{id}/disable
"
)
public
AjaxResult
setDisable
(
@PathVariable
(
"id"
)
Long
id
,
@RequestParam
(
"status"
)
Integer
status
)
{
if
(
actSuppliesService
.
find
(
id
).
size
()>
0
||
actSuppliesService
.
findId
(
id
).
size
()>
0
){
...
...
@@ -186,9 +191,13 @@ public class ActSuppliesController extends BaseController
}
actSuppliesService
.
setDisable
(
id
);
return
AjaxResult
.
success
(
"200"
,
"修改成功"
);
actSuppliesService
.
setDisable
(
id
,
status
);
if
(
status
>
1
){
return
AjaxResult
.
error
(
ServiceCode
.
ERR_CODE
+
""
,
"禁用失败"
);
}
return
AjaxResult
.
success
(
"200"
,
"禁用成功"
);
}
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesConvertController.java
View file @
0a8c0671
...
...
@@ -86,7 +86,9 @@ public class ActSuppliesConvertController extends BaseController{
}
/**
* 物料转换
* */
@PreAuthorize
(
"@ss.hasPermi('ActSuppliesConvert:ActSuppliesConvert:converSupplies')"
)
@PostMapping
(
"/converSupplies"
)
public
TableDataInfo
convertSupplies
(
@RequestBody
String
[]
names
){
...
...
@@ -113,4 +115,5 @@ public class ActSuppliesConvertController extends BaseController{
}
}
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesDetailsController.java
View file @
0a8c0671
...
...
@@ -12,6 +12,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import
com.ruoyi.system.domain.ActSupplies
;
import
com.ruoyi.system.domain.ActSuppliesDetails
;
import
com.ruoyi.system.service.IActSuppliesDetailsService
;
import
com.ruoyi.system.web.ServiceCode
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -133,24 +134,34 @@ public class ActSuppliesDetailsController extends BaseController
* 启用物料细分类管理
*/
@PreAuthorize
(
"@ss.hasPermi('ActSuppliesDetails:ActSuppliesDetails:enable')"
)
@GetMapping
(
"/
enable/{id}
"
)
public
AjaxResult
setEnable
(
@PathVariable
(
"id"
)
Long
id
)
@GetMapping
(
"/
{id}/enable
"
)
public
AjaxResult
setEnable
(
@PathVariable
(
"id"
)
Long
id
,
@RequestParam
(
"status"
)
Integer
status
)
{
actSuppliesDetailsService
.
setEnable
(
id
);
return
AjaxResult
.
success
();
actSuppliesDetailsService
.
setEnable
(
id
,
status
);
if
(
status
<
0
){
return
AjaxResult
.
error
(
ServiceCode
.
ERR_CODE
+
""
,
"启用失败"
);
}
else
{
return
AjaxResult
.
success
(
ServiceCode
.
OK
+
""
,
"启用成功"
);
}
}
/**
* 禁用物料细分类管理
*/
@PreAuthorize
(
"@ss.hasPermi('ActSuppliesDetails:ActSuppliesDetails:Disable')"
)
@GetMapping
(
"/
disable/{id}
"
)
public
AjaxResult
setDisable
(
@PathVariable
(
"id"
)
Long
id
)
@GetMapping
(
"/
{id}/disable
"
)
public
AjaxResult
setDisable
(
@PathVariable
(
"id"
)
Long
id
,
@RequestParam
(
"status"
)
Integer
status
)
{
actSuppliesDetailsService
.
setDisable
(
id
);
return
AjaxResult
.
success
();
actSuppliesDetailsService
.
setDisable
(
id
,
status
);
if
(
status
>
1
){
return
AjaxResult
.
error
(
ServiceCode
.
ERR_CODE
+
""
,
"禁用失败"
);
}
return
AjaxResult
.
success
(
ServiceCode
.
OK
+
""
,
"启动成功"
);
}
}
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesHistorydataController.java
View file @
0a8c0671
package
com.ruoyi.system.controller
;
import
java.util.List
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -74,7 +75,7 @@ public class ActSuppliesHistorydataController extends BaseController
@PreAuthorize
(
"@ss.hasPermi('system:historydata:add')"
)
@Log
(
title
=
" 历史数据"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
ActSuppliesHistorydata
actSuppliesHistorydata
)
public
AjaxResult
add
(
@RequestBody
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
return
toAjax
(
actSuppliesHistorydataService
.
insertActSuppliesHistorydata
(
actSuppliesHistorydata
));
}
...
...
@@ -100,4 +101,21 @@ public class ActSuppliesHistorydataController extends BaseController
{
return
toAjax
(
actSuppliesHistorydataService
.
deleteActSuppliesHistorydataByIds
(
ids
));
}
/**
* 添加 历史数据
*/
@PreAuthorize
(
"@ss.hasPermi('system:historydata:addInsert')"
)
@Log
(
title
=
" 历史数据"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
"/addInsert"
)
public
AjaxResult
addInsert
(
@RequestBody
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
actSuppliesHistorydataService
.
addInsertActSuppliesHistorydata
(
actSuppliesHistorydata
);
return
toAjax
(
1
);
}
}
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesRoleController.java
View file @
0a8c0671
package
com.ruoyi.system.controller
;
import
java.lang.reflect.Array
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -9,6 +10,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.system.domain.ActSuppliesRoleDetail
;
import
com.ruoyi.system.domain.ActSuppliesTemplate
;
import
com.ruoyi.system.web.ServiceCode
;
import
org.springframework.beans.propertyeditors.CustomDateEditor
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.access.prepost.PreAuthorize
;
...
...
@@ -64,12 +66,6 @@ public class ActSuppliesRoleController extends BaseController
return
getDataTable
(
list
);
}
@InitBinder
public
void
initBinder
(
WebDataBinder
binder
,
WebRequest
request
)
{
//转换日期 注意这里的转化要和传进来的字符串的格式一直 如2015-9-9 就应该为yyyy-MM-dd
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
binder
.
registerCustomEditor
(
Date
.
class
,
new
CustomDateEditor
(
dateFormat
,
true
));
// CustomDateEditor为自定义日期编辑器
}
/**
* 查询规则详情列表
*/
...
...
@@ -162,43 +158,79 @@ public class ActSuppliesRoleController extends BaseController
@PreAuthorize
(
"@ss.hasPermi('system:suppliesrole:remove')"
)
@Log
(
title
=
"导入规则"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Integer
[]
ids
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
if
(
actSuppliesRoleService
.
findall
(
ids
).
size
()>
0
){
return
AjaxResult
.
error
(
"该规则下存在关联规则,请先删除关联规则!!!"
,
"操作失败"
);
}
// if (actSuppliesRoleService.findall(ids).size()>0){
// return AjaxResult.error("该规则下存在关联规则,请先删除关联规则!!!","操作失败");
// }
return
toAjax
(
actSuppliesRoleService
.
deleteActSuppliesRoleByIds
(
ids
));
}
/**
* 启用物料总分类管理
*/
@PreAuthorize
(
"@ss.hasPermi('system:suppliesrole:enable')"
)
@
GetMapping
(
"/enable/{id}
"
)
public
AjaxResult
setEnable
(
@PathVariable
(
"id"
)
Long
id
)
@
PutMapping
(
"/{id}/enable
"
)
public
AjaxResult
setEnable
(
@PathVariable
(
"id"
)
Long
id
,
@RequestParam
(
"status"
)
Integer
status
)
{
actSuppliesRoleService
.
setEnable
(
id
);
return
AjaxResult
.
success
();
actSuppliesRoleService
.
setEnable
(
id
,
status
);
if
(
status
<
0
){
return
AjaxResult
.
error
(
ServiceCode
.
ERR_CODE
+
""
,
"启用失败"
);
}
else
{
return
AjaxResult
.
success
(
ServiceCode
.
OK
+
""
,
"启用成功"
);
}
}
/**
* 禁用物料总分类管理
*/
@PreAuthorize
(
"@ss.hasPermi('system:suppliesrole:Disable')"
)
@
GetMapping
(
"/disable/{id}
"
)
public
AjaxResult
setDisable
(
@PathVariable
(
"id"
)
Long
id
)
@
PutMapping
(
"/{id}/disable
"
)
public
AjaxResult
setDisable
(
@PathVariable
(
"id"
)
Long
id
,
@RequestParam
(
"status"
)
Integer
status
)
{
if
(
actSuppliesRoleService
.
find
(
Math
.
toIntExact
(
id
)).
size
()>
0
){
return
AjaxResult
.
success
(
"该规则下存在关联规则,请先删除关联规则!!!"
,
"操作失败"
);
return
AjaxResult
.
error
(
"该规则下存在关联规则,请先删除关联规则!!!"
,
"操作失败"
);
}
actSuppliesRoleService
.
setDisable
(
id
,
status
);
if
(
status
>
1
){
return
AjaxResult
.
error
(
ServiceCode
.
ERR_CODE
+
""
,
"禁用失败"
);
}
return
AjaxResult
.
success
(
ServiceCode
.
OK
+
""
,
"禁用成功"
);
}
actSuppliesRoleService
.
setDisable
(
id
);
return
AjaxResult
.
success
(
"200"
,
"修改成功"
);
/**
* 发布Excel模板
*/
@PreAuthorize
(
"@ss.hasPermi('system:suppliesrole:releaseRS')"
)
@Log
(
title
=
"Excel模板"
,
businessType
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/releaseRS/{ids}/{tempids}"
)
public
AjaxResult
releaseRS
(
@PathVariable
(
"ids"
)
Long
[]
ids
,
@PathVariable
(
"tempids"
)
Long
[]
tempids
)
{
List
<
String
>
longs
=
actSuppliesRoleService
.
releaseRS
(
ids
,
tempids
);
String
s
=
longs
.
toString
();
if
(
longs
.
size
()>
0
){
return
AjaxResult
.
success
(
"312"
,
s
);
}
else
{
return
AjaxResult
.
success
(
200
);
}
}
/**
* 下架Excel模板
*/
@PreAuthorize
(
"@ss.hasPermi('system:suppliesrole:offShelfRS')"
)
@Log
(
title
=
"Excel模板"
,
businessType
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/offShelfRS/{ids}"
)
public
AjaxResult
offShelfRS
(
@PathVariable
(
"ids"
)
Long
[]
ids
)
{
return
toAjax
(
actSuppliesRoleService
.
offShelfRS
(
ids
));
}
}
ruoyi-supplies/src/main/java/com/ruoyi/system/controller/ActSuppliesTemplateController.java
View file @
0a8c0671
...
...
@@ -3,9 +3,12 @@ package com.ruoyi.system.controller;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.system.domain.ActSuppliesRole
;
import
com.ruoyi.system.domain.ActSuppliesTemplate
;
import
com.ruoyi.system.service.ActSuppliesTemplateService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -41,6 +44,31 @@ public class ActSuppliesTemplateController extends BaseController {
}
/**
* 查询导入规则列表
*/
@PreAuthorize
(
"@ss.hasPermi('SuppliesTemplate:SuppliesTemplate:lists')"
)
@GetMapping
(
"/lists/{id}"
)
public
TableDataInfo
lists
(
@PathVariable
(
"id"
)
Integer
id
)
{
startPage
();
List
<
ActSuppliesRole
>
list
=
actSuppliesTemplateService
.
selectActSuppliesRoleList
(
id
);
return
getDataTable
(
list
);
}
/**
* 修改导入规则
*/
@PreAuthorize
(
"@ss.hasPermi('SuppliesTemplate:SuppliesTemplate:edit')"
)
@Log
(
title
=
"导入规则"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
(
"/edit/{id}"
)
public
AjaxResult
edit
(
@RequestBody
ActSuppliesRole
actSuppliesRole
)
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
return
toAjax
(
actSuppliesTemplateService
.
updateActSuppliesRole
(
actSuppliesRole
));
}
/**
* 导出Excel模板列表
*/
...
...
@@ -136,13 +164,14 @@ public class ActSuppliesTemplateController extends BaseController {
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
List
<
String
>
list
=
actSuppliesTemplateService
.
deleteSuppliesTemplateByIds
(
ids
);
if
(
list
.
size
()>
0
){
return
AjaxResult
.
success
(
"312"
,
list
.
toArray
());
}
// if (actSuppliesTemplateService.findall(ids).size()>0){
// return AjaxResult.error("该模板下存在关联规则,请先删除关联规则!!!","操作失败");
// }
return
toAjax
(
1
);
return
toAjax
(
actSuppliesTemplateService
.
deleteSuppliesTemplateByIds
(
ids
));
}
/**
...
...
@@ -168,7 +197,7 @@ public class ActSuppliesTemplateController extends BaseController {
@GetMapping
(
"/enable/{id}"
)
public
AjaxResult
setEnable
(
@PathVariable
(
"id"
)
Long
id
)
{
System
.
out
.
println
(
"开始处理【启用物料总分类管理】的请求,参数:{}"
+
id
);
actSuppliesTemplateService
.
setEnable
(
id
);
return
AjaxResult
.
success
();
}
...
...
@@ -183,7 +212,7 @@ public class ActSuppliesTemplateController extends BaseController {
// if(actSuppliesTemplateService.find(id).size()>0){
// return AjaxResult.success("该物料下存在关联物料,请先删除关联物料!!!","操作失败");
// }
System
.
out
.
println
(
"开始处理【禁用物料总分类管理】的请求,参数:{}"
+
id
);
actSuppliesTemplateService
.
setDisable
(
id
);
return
AjaxResult
.
success
();
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/domain/ActSuppliesHTRImport.java
0 → 100644
View file @
0a8c0671
package
com.ruoyi.system.domain
;
public
class
ActSuppliesHTRImport
{
private
Long
uuid
;
private
Long
roleId
;
private
Long
tempId
;
private
String
HistoryContentImport
;
private
Long
identCode
;
}
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesDetailsMapper.java
View file @
0a8c0671
...
...
@@ -5,6 +5,7 @@ import com.ruoyi.system.domain.ActSuppliesDetails;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
/**
* 物料细分类管理Mapper接口
...
...
@@ -70,5 +71,9 @@ public interface ActSuppliesDetailsMapper
*/
public
int
countByDetailsName
(
String
detailsName
);
int
updateActSuppliesDetails
(
Map
<
String
,
Object
>
paramMap
);
int
setEnable
(
Map
<
String
,
Object
>
paramMap
);
int
setDisable
(
Map
<
String
,
Object
>
paramMap
);
List
<
ActSupplies
>
saveSid
();
}
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesHistorydataMapper.java
View file @
0a8c0671
...
...
@@ -58,4 +58,13 @@ public interface ActSuppliesHistorydataMapper
* @return 结果
*/
public
int
deleteActSuppliesHistorydataByIds
(
Long
[]
ids
);
Long
[]
selectActSuppliesRole
(
Long
templateId
);
Long
selectActSuppliesHistorydatauuid
(
String
exportUuid
);
void
insertActSuppliesHistorydatas
(
ActSuppliesHistorydata
actSuppliesHistorydata1
);
void
updateActSuppliesHistorydatas
(
ActSuppliesHistorydata
actSuppliesHistorydata
);
}
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesMapper.java
View file @
0a8c0671
...
...
@@ -2,9 +2,11 @@ package com.ruoyi.system.mapper;
import
com.ruoyi.system.domain.ActSupplies
;
import
com.ruoyi.system.domain.ActSuppliesRole
;
import
io.lettuce.core.dynamic.annotation.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
/**
* 物料总分类管理Mapper接口
...
...
@@ -83,7 +85,9 @@ public interface ActSuppliesMapper
*/
public
int
countBySuppliesName
(
String
suppliesName
);
int
updateActSupplies
(
Map
<
String
,
Object
>
paramMap
);
int
setEnable
(
Map
<
String
,
Object
>
paramMap
);
int
setDisable
(
Map
<
String
,
Object
>
paramMap
);
List
<
ActSupplies
>
selectActSuppliesListOne
(
ActSupplies
actSupplies
);
}
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesRoleDetailMapper.java
View file @
0a8c0671
...
...
@@ -66,5 +66,7 @@ public interface ActSuppliesRoleDetailMapper
List
<
ActSuppliesRole
>
saveSid
();
void
updateRoleDetailStatus
(
ActSuppliesRoleDetail
actSuppliesRoleDetail
);
// List<ActOperation> saveOperation();
}
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesRoleMapper.java
View file @
0a8c0671
package
com.ruoyi.system.mapper
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.system.domain.ActSuppliesRole
;
import
com.ruoyi.system.domain.ActSuppliesRoleDetail
;
import
com.ruoyi.system.domain.ActSuppliesTemplate
;
...
...
@@ -81,16 +83,30 @@ public interface ActSuppliesRoleMapper
* @param ids 需要删除的数据ID
* @return 结果
*/
public
int
deleteActSuppliesRoleByIds
(
Integer
[]
ids
);
public
int
deleteActSuppliesRoleByIds
(
Long
[]
ids
);
List
<
ActSuppliesTemplate
>
saveSid
();
int
updateActSuppliesRole
(
Map
<
String
,
Object
>
paramMap
);
int
setEnable
(
Map
<
String
,
Object
>
paramMap
);
int
setDisable
(
Map
<
String
,
Object
>
paramMap
);
List
<
Integer
>
findall
(
Integer
[]
ids
);
List
<
Integer
>
find
(
Integer
id
);
public
int
countByRoleName
(
ActSuppliesRole
actSuppliesRole
);
Integer
saveTemp
(
Long
tempids
);
void
updateRelease
(
ActSuppliesRole
actSuppliesRole
);
String
saveRoleName
(
Long
id
);
int
saveHistory
(
Long
id
);
void
updateReleaseoff
(
Long
id
);
void
updateReleaseoffone
(
Long
id
);
void
saveStatus
(
Integer
[]
ids
);
}
ruoyi-supplies/src/main/java/com/ruoyi/system/mapper/ActSuppliesTemplateMapper.java
View file @
0a8c0671
package
com.ruoyi.system.mapper
;
import
com.ruoyi.system.domain.ActSuppliesRole
;
import
com.ruoyi.system.domain.ActSuppliesTemplate
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -27,13 +28,15 @@ public interface ActSuppliesTemplateMapper
int
updateSuppliesTemplate
(
ActSuppliesTemplate
sysSupplies
);
int
deleteSuppliesTemplateById
(
Long
ids
);
int
deleteSuppliesTemplateByIds
(
Long
[]
ids
);
int
updateSuppliesTemplateByIds
(
Long
[]
ids
);
List
<
ActSuppliesTemplate
>
saveTemplate
(
Long
id
);
L
ist
<
Integer
>
findall
(
Long
[]
ids
);
L
ong
findall
(
Long
ids
);
List
<
Integer
>
find
(
Long
id
);
...
...
@@ -41,5 +44,13 @@ public interface ActSuppliesTemplateMapper
List
<
ActSuppliesTemplate
>
saveTemplateStatus
(
Long
[]
ids
);
void
updateRelease
(
ActSuppliesTemplate
actSuppliesTemplate
);
ActSuppliesRole
selectActSuppliesRoleById
(
Integer
id
);
List
<
ActSuppliesRole
>
selectActSuppliesRoleList
(
Integer
id
);
int
updateActSuppliesRole
(
ActSuppliesRole
actSuppliesRole
);
int
selectHistory
(
Long
id
);
}
\ No newline at end of file
ruoyi-supplies/src/main/java/com/ruoyi/system/service/ActSuppliesTemplateService.java
View file @
0a8c0671
package
com.ruoyi.system.service
;
import
com.ruoyi.system.domain.ActSuppliesRole
;
import
com.ruoyi.system.domain.ActSuppliesTemplate
;
import
java.util.List
;
...
...
@@ -22,12 +23,10 @@ public interface ActSuppliesTemplateService
int
updateSuppliesTemplate
(
ActSuppliesTemplate
sysSupplies
);
int
deleteSuppliesTemplateByIds
(
Long
[]
ids
);
List
<
String
>
deleteSuppliesTemplateByIds
(
Long
[]
ids
);
List
<
ActSuppliesTemplate
>
saveTemplate
(
Long
id
);
List
<
Integer
>
findall
(
Long
[]
ids
);
List
<
Integer
>
find
(
Long
id
);
/**
* 启用物料细分类管理
...
...
@@ -52,4 +51,27 @@ public interface ActSuppliesTemplateService
int
offShelfStatus
(
Long
[]
ids
);
String
copyTemplate
(
Long
id
);
/**
* 查询导入规则
*
* @param id 导入规则ID
* @return 导入规则
*/
public
ActSuppliesRole
selectActSuppliesRoleById
(
Integer
id
);
/**
* 查询导入规则列表
*
* @param id 导入规则
* @return 导入规则集合
*/
public
List
<
ActSuppliesRole
>
selectActSuppliesRoleList
(
Integer
id
);
/**
* 修改导入规则
*
* @param actSuppliesRole 导入规则
* @return 结果
*/
public
int
updateActSuppliesRole
(
ActSuppliesRole
actSuppliesRole
);
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesDetailsService.java
View file @
0a8c0671
...
...
@@ -3,6 +3,7 @@ package com.ruoyi.system.service;
import
com.ruoyi.system.domain.ActSupplies
;
import
com.ruoyi.system.domain.ActSuppliesDetails
;
import
io.lettuce.core.dynamic.annotation.Param
;
import
java.util.List
;
...
...
@@ -65,18 +66,19 @@ public interface IActSuppliesDetailsService
List
<
ActSupplies
>
saveSid
();
/**
* 启用物料
总
分类管理
* 启用物料
细
分类管理
*
* @param id 尝试启用物料
总
分类管理的id
* @param id 尝试启用物料
细
分类管理的id
* @return
*/
void
setEnable
(
Long
id
);
int
setEnable
(
@Param
(
"id"
)
Long
id
,
@Param
(
"status"
)
Integer
status
);
/**
* 禁用
*
* @param id 尝试禁用物料
总
分类管理的id
* @param id 尝试禁用物料
细
分类管理的id
*/
void
setDisable
(
Long
id
);
int
setDisable
(
@Param
(
"id"
)
Long
id
,
@Param
(
"status"
)
Integer
status
);
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesHistorydataService.java
View file @
0a8c0671
...
...
@@ -33,7 +33,7 @@ public interface IActSuppliesHistorydataService
* @param actSuppliesHistorydata 历史数据
* @return 结果
*/
public
int
insertActSuppliesHistorydata
(
ActSuppliesHistorydata
actSuppliesHistorydata
);
public
int
insertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
);
/**
* 修改 历史数据
...
...
@@ -58,4 +58,6 @@ public interface IActSuppliesHistorydataService
* @return 结果
*/
public
int
deleteActSuppliesHistorydataById
(
Long
id
);
int
addInsertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
);
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesRoleService.java
View file @
0a8c0671
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
com.ruoyi.system.domain.ActSuppliesRole
;
import
com.ruoyi.system.domain.ActSuppliesRoleDetail
;
import
com.ruoyi.system.domain.ActSuppliesTemplate
;
import
org.springframework.stereotype.Repository
;
import
io.lettuce.core.dynamic.annotation.Param
;
/**
* 导入规则Service接口
...
...
@@ -71,7 +71,7 @@ public interface IActSuppliesRoleService
* @param ids 需要删除的导入规则ID
* @return 结果
*/
public
int
deleteActSuppliesRoleByIds
(
Integer
[]
ids
);
public
int
deleteActSuppliesRoleByIds
(
Long
[]
ids
);
/**
* 删除导入规则信息
...
...
@@ -88,16 +88,20 @@ public interface IActSuppliesRoleService
* @param id 尝试启用物料细分类管理的id
* @return
*/
void
setEnable
(
Long
id
);
int
setEnable
(
@Param
(
"id"
)
Long
id
,
@Param
(
"status"
)
Integer
status
);
/**
* 禁用
*
* @param id 尝试禁用物料细分类管理的id
*/
void
setDisable
(
Long
id
);
int
setDisable
(
@Param
(
"id"
)
Long
id
,
@Param
(
"status"
)
Integer
status
);
List
<
Integer
>
findall
(
Integer
[]
ids
);
List
<
Integer
>
find
(
Integer
id
);
List
<
String
>
releaseRS
(
Long
[]
ids
,
Long
[]
tempids
);
int
offShelfRS
(
Long
[]
ids
);
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/IActSuppliesService.java
View file @
0a8c0671
package
com.ruoyi.system.service
;
import
com.ruoyi.system.domain.ActSupplies
;
import
io.lettuce.core.dynamic.annotation.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
...
...
@@ -64,21 +65,21 @@ public interface IActSuppliesService
List
<
ActSupplies
>
options
();
/**
* 启用物料细分类管理
*
* @param id 尝试启用物料细分类管理的id
* @return
*/
void
setEnable
(
Long
id
);
int
setEnable
(
@Param
(
"id"
)
Long
id
,
@Param
(
"status"
)
Integer
status
);
/**
* 禁用
*
* @param id 尝试禁用物料细分类管理的id
*/
void
setDisable
(
Long
id
);
int
setDisable
(
@Param
(
"id"
)
Long
id
,
@Param
(
"status"
)
Integer
status
);
List
<
Integer
>
findall
(
Long
[]
ids
);
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesDetailsServiceImpl.java
View file @
0a8c0671
...
...
@@ -10,7 +10,9 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 物料细分类管理Service业务层处理
...
...
@@ -122,44 +124,32 @@ public class ActSuppliesDetailsServiceImpl implements IActSuppliesDetailsService
return
actSuppliesDetailsMapper
.
saveSid
();
}
@Override
public
void
setEnable
(
Long
id
)
{
updateStatusById
(
id
,
0
);
public
int
setEnable
(
Long
id
,
Integer
status
)
{
updateStatusById
(
id
,
status
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"status"
,
status
);
return
actSuppliesDetailsMapper
.
setEnable
(
paramMap
);
}
@Override
public
void
setDisable
(
Long
id
)
{
updateStatusById
(
id
,
1
);
public
int
setDisable
(
Long
id
,
Integer
status
)
{
updateStatusById
(
id
,
status
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"status"
,
status
);
return
actSuppliesDetailsMapper
.
setDisable
(
paramMap
);
}
private
void
updateStatusById
(
Long
id
,
Integer
status
){
String
[]
statusText
={
"禁用"
,
"启用"
};
private
int
updateStatusById
(
Long
id
,
Integer
status
){
//判断查询结果是否为空
ActSuppliesDetails
queryResult
=
actSuppliesDetailsMapper
.
selectActSuppliesDetailsById
(
id
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"status"
,
status
);
if
(
queryResult
==
null
)
{
String
message
=
statusText
[
status
]
+
"物料细分类管理失败,尝试访问的数据不存在"
;
System
.
out
.
println
(
message
);
throw
new
RuntimeException
(
message
);
}
return
actSuppliesDetailsMapper
.
updateActSuppliesDetails
(
paramMap
);
//判断以上查询结果中的status是否与参数status相同
if
(
queryResult
.
getStatus
().
equals
(
status
)){
String
message
=
statusText
[
status
]
+
"物料细分类管理失败,当前物料细分类管理已经处理"
+
statusText
[
status
]
+
"状态!"
;
System
.
out
.
println
(
message
);
throw
new
RuntimeException
(
message
);
}
ActSuppliesDetails
actSuppliesDetails
=
new
ActSuppliesDetails
();
actSuppliesDetails
.
setId
(
id
);
actSuppliesDetails
.
setStatus
(
status
);
int
rows
=
actSuppliesDetailsMapper
.
updateActSuppliesDetails
(
actSuppliesDetails
);
if
(
rows
!=
1
)
{
String
message
=
statusText
[
status
]
+
"物料细分类管理失败,服务器忙请再次重试"
;
System
.
out
.
println
(
message
);
throw
new
RuntimeException
(
message
);
}
}
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesHistorydataServiceImpl.java
View file @
0a8c0671
package
com.ruoyi.system.service.impl
;
import
java.util.List
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.system.mapper.ActSuppliesHistorydataMapper
;
...
...
@@ -51,10 +54,15 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
* @return 结果
*/
@Override
public
int
insertActSuppliesHistorydata
(
ActSuppliesHistorydata
actSuppliesHistorydata
)
public
int
insertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
actSuppliesHistorydata
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
actSuppliesHistorydataMapper
.
insertActSuppliesHistorydata
(
actSuppliesHistorydata
);
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++){
Long
status
=
actSuppliesHistorydata
.
get
(
i
).
getStatus
();
}
return
actSuppliesHistorydataMapper
.
insertActSuppliesHistorydata
(
actSuppliesHistorydata
.
get
(
0
));
}
/**
...
...
@@ -92,4 +100,53 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
{
return
actSuppliesHistorydataMapper
.
deleteActSuppliesHistorydataById
(
id
);
}
@Override
public
int
addInsertActSuppliesHistorydata
(
List
<
ActSuppliesHistorydata
>
actSuppliesHistorydata
)
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
ActSuppliesHistorydata
actSuppliesHistorydata1
=
new
ActSuppliesHistorydata
();
Long
s
=
actSuppliesHistorydataMapper
.
selectActSuppliesHistorydatauuid
(
actSuppliesHistorydata
.
get
(
0
).
getImportUuid
());
if
(
s
>
0
){
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++)
{
actSuppliesHistorydata
.
get
(
i
).
setCreateBy
(
user
.
getUserName
());
actSuppliesHistorydata
.
get
(
i
).
setCreateTime
(
DateUtils
.
getNowDate
());
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydatas
(
actSuppliesHistorydata
.
get
(
i
));
}
}
else
{
Long
[]
longs
=
actSuppliesHistorydataMapper
.
selectActSuppliesRole
(
actSuppliesHistorydata
.
get
(
0
).
getTemplateId
());
for
(
int
i
=
0
;
i
<
longs
.
length
;
i
++){
actSuppliesHistorydata1
.
setImportUuid
(
actSuppliesHistorydata
.
get
(
0
).
getImportUuid
());
actSuppliesHistorydata1
.
setTemplateId
(
actSuppliesHistorydata
.
get
(
0
).
getTemplateId
());
actSuppliesHistorydata1
.
setRoleId
(
longs
[
i
]);
actSuppliesHistorydata1
.
setStatus
(
1L
);
actSuppliesHistorydata1
.
setIdentifyingCode
(
0L
);
actSuppliesHistorydataMapper
.
insertActSuppliesHistorydata
(
actSuppliesHistorydata1
);
}
actSuppliesHistorydata1
.
setImportUuid
(
actSuppliesHistorydata
.
get
(
0
).
getImportUuid
());
actSuppliesHistorydata1
.
setTemplateId
(
actSuppliesHistorydata
.
get
(
0
).
getTemplateId
());
actSuppliesHistorydata1
.
setStatus
(
1L
);
actSuppliesHistorydata1
.
setIdentifyingCode
(
1L
);
actSuppliesHistorydataMapper
.
insertActSuppliesHistorydata
(
actSuppliesHistorydata1
);
for
(
int
i
=
0
;
i
<
actSuppliesHistorydata
.
size
();
i
++){
actSuppliesHistorydata
.
get
(
i
).
setCreateBy
(
user
.
getUserName
());
actSuppliesHistorydata
.
get
(
i
).
setCreateTime
(
DateUtils
.
getNowDate
());
actSuppliesHistorydataMapper
.
updateActSuppliesHistorydatas
(
actSuppliesHistorydata
.
get
(
i
));
}
}
return
0
;
}
}
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesRoleServiceImpl.java
View file @
0a8c0671
package
com.ruoyi.system.service.impl
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.system.domain.*
;
import
com.ruoyi.system.ex.ServiceException
;
import
com.ruoyi.system.mapper.ActSuppliesRoleDetailMapper
;
import
com.ruoyi.system.web.ServiceCode
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -27,6 +30,9 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
@Autowired
private
ActSuppliesRoleMapper
actSuppliesRoleMapper
;
@Autowired
private
ActSuppliesRoleDetailMapper
actSuppliesRoleDetailMapper
;
/**
* 查询导入规则
*
...
...
@@ -149,9 +155,52 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
* @return 结果
*/
@Override
public
int
deleteActSuppliesRoleByIds
(
Integer
[]
ids
)
public
int
deleteActSuppliesRoleByIds
(
Long
[]
ids
)
{
return
actSuppliesRoleMapper
.
deleteActSuppliesRoleByIds
(
ids
);
ActSuppliesRole
actSuppliesRole
=
new
ActSuppliesRole
();
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
ActSuppliesRoleDetail
actSuppliesRoleDetail
=
new
ActSuppliesRoleDetail
();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++){
int
i1
=
actSuppliesRoleMapper
.
saveHistory
(
ids
[
0
]);
if
(
i1
>
0
){
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
2
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
2
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
else
{
ActSuppliesRole
actSuppliesRole1
=
actSuppliesRoleMapper
.
selectActSuppliesRoleById
(
ids
[
i
].
intValue
());
if
(
actSuppliesRole1
.
getStatus
()
==
0
){
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
1
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
1
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
else
{
actSuppliesRoleMapper
.
deleteActSuppliesRoleById
(
ids
[
i
].
intValue
());
actSuppliesRoleDetailMapper
.
deleteActSuppliesRoleDetailById
(
ids
[
i
].
intValue
());
}
}
}
return
1
;
}
/**
...
...
@@ -172,13 +221,21 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
}
@Override
public
void
setEnable
(
Long
id
)
{
updateStatusById
(
id
,
0
);
public
int
setEnable
(
Long
id
,
Integer
status
)
{
updateStatusById
(
id
,
status
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"status"
,
status
);
return
actSuppliesRoleMapper
.
setEnable
(
paramMap
);
}
@Override
public
void
setDisable
(
Long
id
)
{
updateStatusById
(
id
,
1
);
public
int
setDisable
(
Long
id
,
Integer
status
)
{
updateStatusById
(
id
,
status
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"status"
,
status
);
return
actSuppliesRoleMapper
.
setDisable
(
paramMap
);
}
@Override
...
...
@@ -191,6 +248,102 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
return
actSuppliesRoleMapper
.
find
(
id
);
}
/**
* 发布规则
*
* @param ids,tempids 导入规则ID
* @return 结果
*/
@Override
public
List
<
String
>
releaseRS
(
Long
[]
ids
,
Long
[]
tempids
)
{
List
<
String
>
releER
=
new
ArrayList
<>();
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
ActSuppliesRole
actSuppliesRole
=
new
ActSuppliesRole
();
ActSuppliesRoleDetail
actSuppliesRoleDetail
=
new
ActSuppliesRoleDetail
();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++){
//查询所属模板是否发布
Integer
integer
=
actSuppliesRoleMapper
.
saveTemp
(
tempids
[
i
]);
if
(
integer
!=
null
&&
integer
>
0
){
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
0
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
0
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
else
{
String
name
=
actSuppliesRoleMapper
.
saveRoleName
(
ids
[
i
]);
releER
.
add
(
name
);
}
}
return
releER
;
}
/**
* 下架规则
*
* @param ids 导入规则ID
* @return 结果
*/
@Override
public
int
offShelfRS
(
Long
[]
ids
)
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
ActSuppliesRole
actSuppliesRole
=
new
ActSuppliesRole
();
ActSuppliesRoleDetail
actSuppliesRoleDetail
=
new
ActSuppliesRoleDetail
();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++){
//查询历史数据是否引用
int
count
=
actSuppliesRoleMapper
.
saveHistory
(
ids
[
i
]);
if
(
count
>
0
){
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
2
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
2
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
else
{
actSuppliesRole
.
setId
(
ids
[
i
]);
actSuppliesRole
.
setStatus
(
1
);
actSuppliesRole
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleMapper
.
updateRelease
(
actSuppliesRole
);
actSuppliesRoleDetail
.
setRoleId
(
ids
[
i
].
intValue
());
actSuppliesRoleDetail
.
setStatus
(
1
);
actSuppliesRoleDetail
.
setUpdateBy
(
user
.
getUserName
());
actSuppliesRoleDetail
.
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesRoleDetailMapper
.
updateRoleDetailStatus
(
actSuppliesRoleDetail
);
}
}
return
1
;
}
private
void
updateStatusById
(
Long
id
,
Integer
status
){
String
[]
statusText
={
"禁用"
,
"启用"
};
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesServiceImpl.java
View file @
0a8c0671
...
...
@@ -11,7 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
javax.sql.rowset.serial.SerialException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
static
jdk
.
nashorn
.
internal
.
runtime
.
regexp
.
joni
.
Config
.
log
;
...
...
@@ -126,19 +128,29 @@ public class ActSuppliesServiceImpl implements IActSuppliesService
return
actSuppliesMapper
.
options
();
}
@Override
public
List
<
Integer
>
findall
(
Long
[]
ids
)
{
return
actSuppliesMapper
.
findall
(
ids
);
public
int
setEnable
(
Long
id
,
Integer
status
)
{
updateStatusById
(
id
,
status
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"status"
,
status
);
return
actSuppliesMapper
.
setEnable
(
paramMap
);
}
@Override
public
void
setEnable
(
Long
id
)
{
updateStatusById
(
id
,
0
);
public
int
setDisable
(
Long
id
,
Integer
status
)
{
updateStatusById
(
id
,
status
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"status"
,
status
);
return
actSuppliesMapper
.
setDisable
(
paramMap
);
}
@Override
public
void
setDisable
(
Long
id
)
{
updateStatusById
(
id
,
1
);
public
List
<
Integer
>
findall
(
Long
[]
ids
)
{
return
actSuppliesMapper
.
findall
(
ids
);
}
@Override
...
...
@@ -162,35 +174,13 @@ public class ActSuppliesServiceImpl implements IActSuppliesService
return
actSuppliesMapper
.
selectActSuppliesListOne
(
actSupplies
);
}
private
void
updateStatusById
(
Long
id
,
Integer
status
){
String
[]
statusText
={
"禁用"
,
"启用"
};
private
int
updateStatusById
(
Long
id
,
Integer
status
){
//判断查询结果是否为空
ActSupplies
queryResult
=
actSuppliesMapper
.
selectActSuppliesById
(
id
);
if
(
queryResult
==
null
)
{
String
message
=
statusText
[
status
]
+
"物料总分类管理失败,尝试访问的数据不存在"
;
System
.
out
.
println
(
message
);
throw
new
RuntimeException
(
message
);
}
//判断以上查询结果中的status是否与参数status相同
if
(
queryResult
.
getStatus
().
equals
(
status
)){
String
message
=
statusText
[
status
]
+
"物料总分类管理失败,当前物料总分类管理已经处理"
+
statusText
[
status
]
+
"状态!"
;
System
.
out
.
println
(
message
);
throw
new
RuntimeException
(
message
);
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
id
);
paramMap
.
put
(
"status"
,
status
);
ActSupplies
actSupplies
=
new
ActSupplies
();
actSupplies
.
setId
(
id
);
actSupplies
.
setStatus
(
status
);
int
rows
=
actSuppliesMapper
.
updateActSupplies
(
actSupplies
);
if
(
rows
!=
1
)
{
String
message
=
statusText
[
status
]
+
"物料总分类管理失败,服务器忙请再次重试"
;
System
.
out
.
println
(
message
);
throw
new
RuntimeException
(
message
);
}
return
actSuppliesMapper
.
updateActSupplies
(
paramMap
);
}
}
...
...
ruoyi-supplies/src/main/java/com/ruoyi/system/service/impl/ActSuppliesTemplateServiceImpl.java
View file @
0a8c0671
package
com.ruoyi.system.service.impl
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.system.domain.ActSuppliesRole
;
import
com.ruoyi.system.domain.ActSuppliesTemplate
;
import
com.ruoyi.system.mapper.ActSuppliesRoleMapper
;
import
com.ruoyi.system.mapper.ActSuppliesTemplateMapper
;
import
com.ruoyi.system.service.ActSuppliesTemplateService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
@@ -24,6 +28,9 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic
@Autowired
private
ActSuppliesTemplateMapper
actSuppliesTemplateMapper
;
@Autowired
private
ActSuppliesRoleMapper
actSuppliesRoleMapper
;
@Override
public
List
<
ActSuppliesTemplate
>
selectSuppliesTemplateList
(
ActSuppliesTemplate
sysSupplies
)
{
...
...
@@ -55,39 +62,69 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic
sysSupplies
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
actSuppliesTemplateMapper
.
updateSuppliesTemplate
(
sysSupplies
);
}
/**
* 查询导入规则
*
* @param id 导入规则
* @return 导入规则
*/
@Override
public
ActSuppliesRole
selectActSuppliesRoleById
(
Integer
id
)
{
return
actSuppliesTemplateMapper
.
selectActSuppliesRoleById
(
id
);
}
@Override
public
int
deleteSuppliesTemplateByIds
(
Long
[]
ids
)
{
public
List
<
ActSuppliesRole
>
selectActSuppliesRoleList
(
Integer
id
)
{
return
actSuppliesTemplateMapper
.
selectActSuppliesRoleList
(
id
);
}
List
<
ActSuppliesTemplate
>
actSuppliesTemplate
=
actSuppliesTemplateMapper
.
saveTemplateStatus
(
ids
);
@Override
public
int
updateActSuppliesRole
(
ActSuppliesRole
actSuppliesRole
)
{
List
<
Long
>
idsd
=
new
LinkedList
<>();
List
<
Long
>
idsu
=
new
LinkedList
<>();
actSuppliesRole
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
actSuppliesTemplateMapper
.
updateActSuppliesRole
(
actSuppliesRole
);
}
for
(
int
i
=
0
;
i
<
actSuppliesTemplate
.
size
();
i
++)
{
@Override
public
List
<
String
>
deleteSuppliesTemplateByIds
(
Long
[]
ids
)
{
if
(
actSuppliesTemplate
.
get
(
i
).
getStatus
()==
1
)
{
List
<
ActSuppliesTemplate
>
actSuppliesTemplate
=
actSuppliesTemplateMapper
.
saveTemplateStatus
(
ids
);
List
<
String
>
releER
=
new
ArrayList
<>();
idsd
.
add
(
actSuppliesTemplate
.
get
(
i
).
getId
());
for
(
int
i
=
0
;
i
<
actSuppliesTemplate
.
size
();
i
++)
{
}
else
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
if
(
actSuppliesTemplate
.
get
(
i
).
getStatus
()==
0
)
{
int
count
=
actSuppliesTemplateMapper
.
selectHistory
(
actSuppliesTemplate
.
get
(
i
).
getId
());
if
(
count
>
0
){
idsu
.
add
(
actSuppliesTemplate
.
get
(
i
).
getId
());
actSuppliesTemplate
.
get
(
i
).
setStatus
(
2
);
actSuppliesTemplate
.
get
(
i
).
setUpdateBy
(
user
.
getUserName
());
actSuppliesTemplate
.
get
(
i
).
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesTemplateMapper
.
updateRelease
(
actSuppliesTemplate
.
get
(
i
));
}
else
{
idsd
.
add
(
actSuppliesTemplate
.
get
(
i
).
getId
());
}
actSuppliesTemplate
.
get
(
i
).
setStatus
(
1
);
actSuppliesTemplate
.
get
(
i
).
setUpdateBy
(
user
.
getUserName
());
actSuppliesTemplate
.
get
(
i
).
setUpdateTime
(
DateUtils
.
getNowDate
());
actSuppliesTemplateMapper
.
updateRelease
(
actSuppliesTemplate
.
get
(
i
));
}
}
else
if
(
actSuppliesTemplate
.
get
(
i
).
getStatus
()==
1
)
{
Long
findall
=
actSuppliesTemplateMapper
.
findall
(
actSuppliesTemplate
.
get
(
i
).
getId
());
if
(
findall
>
0
){
releER
.
add
(
actSuppliesTemplate
.
get
(
i
).
getTemplateName
());
}
actSuppliesTemplateMapper
.
deleteSuppliesTemplateById
(
actSuppliesTemplate
.
get
(
i
).
getId
());
if
(
idsd
.
size
()>
0
){
actSuppliesTemplateMapper
.
deleteSuppliesTemplateByIds
(
idsd
.
toArray
(
idsd
.
toArray
(
new
Long
[
0
])));
}
else
if
(
idsu
.
size
()>
0
){
actSuppliesTemplateMapper
.
updateSuppliesTemplateByIds
(
idsu
.
toArray
(
idsu
.
toArray
(
new
Long
[
0
])));
}
}
return
1
;
return
releER
;
}
...
...
@@ -96,10 +133,6 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic
return
actSuppliesTemplateMapper
.
saveTemplate
(
id
);
}
@Override
public
List
<
Integer
>
findall
(
Long
[]
ids
)
{
return
actSuppliesTemplateMapper
.
findall
(
ids
);
}
@Override
public
List
<
Integer
>
find
(
Long
id
)
{
...
...
@@ -121,6 +154,7 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic
return
actSuppliesTemplateMapper
.
findName
();
}
@Override
public
int
releaseStatus
(
Long
[]
ids
)
{
...
...
@@ -185,6 +219,8 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic
}
private
void
updateStatusById
(
Long
id
,
Integer
status
){
String
[]
statusText
={
"禁用"
,
"启用"
};
...
...
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesDetailsMapper.xml
View file @
0a8c0671
...
...
@@ -55,6 +55,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select a.id,a.pid,b.supplies_name fname,a.supplies_name,a.status from act_supplies a LEFT JOIN act_supplies b on a.pid =b.id where a.status = 0
</select>
<update
id=
"setEnable"
parameterType=
"java.util.Map"
>
UPDATE act_supplies_details
SET status = 0
WHERE id = #{id}
</update>
<update
id=
"setDisable"
parameterType=
"java.util.Map"
>
UPDATE act_supplies_details
SET status = 1
WHERE id = #{id}
</update>
<select
id=
"selectActSuppliesDetailsList"
parameterType=
"ActSuppliesDetails"
resultMap=
"OneActSuppliesDetailsResult"
>
select a.id, a.sid,b.supplies_name,a.details_name,a.sysclassify,a.status from act_supplies_details a left join act_supplies b on a.sid = b.id
<where>
...
...
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesHistorydataMapper.xml
View file @
0a8c0671
...
...
@@ -83,7 +83,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
</trim>
where id = #{id}
<where>
<if
test=
"importUuid != null"
>
and import_uuid = #{importUuid}
</if>
<if
test=
"templateId != null"
>
and template_id = #{templateId},
</if>
<if
test=
"identifyingCode != null"
>
and identifying_code = #{identifyingCode},
</if>
<if
test=
"roleId != null and identifyingCode!=1"
>
and role_id = #{roleId},
</if>
</where>
</update>
<delete
id=
"deleteActSuppliesHistorydataById"
parameterType=
"Long"
>
...
...
@@ -96,4 +101,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select
id=
"selectActSuppliesHistorydatauuid"
parameterType=
"String"
resultType=
"Long"
>
select count(*) from act_supplies_historydata where import_uuid = #{importUuid}
</select>
<select
id=
"selectActSuppliesRole"
parameterType=
"Long"
resultType=
"Long"
>
select id from act_supplies_role where temp_id = #{templateId}
</select>
<update
id=
"updateActSuppliesHistorydatas"
parameterType=
"ActSuppliesHistorydata"
>
update act_supplies_historydata
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"historyName != null"
>
history_name = #{historyName},
</if>
<if
test=
"historyContent != null"
>
history_content = #{historyContent},
</if>
<if
test=
"identifyingCode != null"
>
identifying_code = #{identifyingCode},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
</trim>
<where>
import_uuid = #{importUuid}
<if
test=
"templateId != null "
>
and template_id = #{templateId}
</if>
<if
test=
"roleId != null and identifyingCode == 0"
>
and role_id = #{roleId}
</if>
<if
test=
"identifyingCode != null "
>
and identifying_code = #{identifyingCode}
</if>
</where>
</update>
</mapper>
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesMapper.xml
View file @
0a8c0671
...
...
@@ -25,6 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"countBySuppliesName"
resultType=
"int"
>
select count(*) from act_supplies where supplies_name=#{suppliesName}
</select>
<select
id=
"selectActSuppliesList"
parameterType=
"ActSupplies"
resultMap=
"ActSuppliesResult"
>
select a.id,a.pid,b.supplies_name fname,a.supplies_name,a.status from act_supplies a , act_supplies b
<where>
...
...
@@ -96,6 +98,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<update
id=
"setEnable"
parameterType=
"java.util.Map"
>
UPDATE act_supplies
SET status = 0
WHERE id = #{id}
</update>
<update
id=
"setDisable"
parameterType=
"java.util.Map"
>
UPDATE act_supplies
SET status = 1
WHERE id = #{id}
</update>
<select
id=
"findall"
parameterType=
"String"
resultType=
"Integer"
>
...
...
@@ -127,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <delete id="deleteActSuppliesById" parameterType="Long">-->
<!-- delete from act_supplies where id = #{id}-->
<!-- </delete>-->
...
...
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesRoleDetailMapper.xml
View file @
0a8c0671
...
...
@@ -47,7 +47,7 @@
</sql>
<select
id=
"saveSid"
parameterType=
"com.ruoyi.system.domain.ActSuppliesRole"
resultMap=
"ActSuppliesRoleResult"
>
select id, temp_id, role_name from act_supplies_role where status =
0
select id, temp_id, role_name from act_supplies_role where status =
1
</select>
<!-- <select id="saveOperation" parameterType="ActOperation" resultMap="ActOperationResult">-->
...
...
@@ -77,17 +77,9 @@
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"roleId != null"
>
role_id,
</if>
<if
test=
"detailName != null"
>
detail_name,
</if>
<!-- <if test="detailMH != null">detail_m_h,</if>-->
<!-- <if test="detailML != null">detail_m_l,</if>-->
<!-- <if test="detailYH != null">detail_y_h,</if>-->
<!-- <if test="detailYL != null">detail_y_l,</if>-->
<if
test=
"detailYS != null"
>
detail_y_s,
</if>
<if
test=
"detailContent != null"
>
detail_content,
</if>
<if
test=
"convertStatus != null"
>
convert_status,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -97,17 +89,9 @@
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"roleId != null"
>
#{roleId},
</if>
<if
test=
"detailName != null"
>
#{detailName},
</if>
<!-- <if test="detailMH != null">#{detailMH},</if>-->
<!-- <if test="detailML != null">#{detailML},</if>-->
<!-- <if test="detailYH != null">#{detailYH},</if>-->
<!-- <if test="detailYL != null">#{detailYL},</if>-->
<if
test=
"detailYS != null"
>
#{detailYS},
</if>
<if
test=
"detailContent != null"
>
#{detailContent},
</if>
<if
test=
"convertStatus != null"
>
#{convertStatus},
</if>
<if
test=
"status != null"
>
#{status},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
...
...
@@ -123,13 +107,7 @@
<if
test=
"detailName != null"
>
detail_name = #{detailName},
</if>
<if
test=
"detailContent != null"
>
detail_content = #{detailContent},
</if>
<if
test=
"convertStatus != null"
>
convert_status = #{convertStatus},
</if>
<!-- <if test="detailMH != null">detail_m_h = #{detailMH},</if>-->
<!-- <if test="detailML != null">detail_m_l = #{detailML},</if>-->
<!-- <if test="detailYH != null">detail_y_h = #{detailYH},</if>-->
<!-- <if test="detailYL != null">detail_y_l = #{detailYL},</if>-->
<if
test=
"detailYS != null"
>
detail_y_s = #{detailYS},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
...
...
@@ -139,8 +117,18 @@
where id = #{id}
</update>
<update
id=
"updateRoleDetailStatus"
parameterType=
"ActSuppliesRoleDetail"
>
update act_supplies_role_detail
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</trim>
where role_id = #{roleId}
</update>
<delete
id=
"deleteActSuppliesRoleDetailById"
parameterType=
"Integer"
>
delete from act_supplies_role_detail where id = #{id}
delete from act_supplies_role_detail where
role_
id = #{id}
</delete>
<delete
id=
"deleteActSuppliesRoleDetailByIds"
parameterType=
"String"
>
...
...
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesRoleMapper.xml
View file @
0a8c0671
...
...
@@ -74,14 +74,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, temp_id, role_name, status, create_by, create_time, update_by, update_time from act_supplies_role
</sql>
<update
id=
"setEnable"
parameterType=
"java.util.Map"
>
UPDATE act_supplies_role
SET status = 0
WHERE id = #{id}
</update>
<update
id=
"setDisable"
parameterType=
"java.util.Map"
>
UPDATE act_supplies_role
SET status = 1
WHERE id = #{id}
</update>
<sql
id=
"selectActSuppliesRoleDetailVo"
>
select id, role_id, detail_name, detail_m_h, detail_m_l, detail_y_h, detail_y_l,detail_y_s, detail_content,convert_status, status, create_by, create_time, update_by, update_time from act_supplies_role_detail
</sql>
<select
id=
"saveRoleName"
parameterType=
"Long"
resultType=
"String"
>
select role_name from act_supplies_role where id = #{id}
</select>
<select
id=
"saveSid"
parameterType=
"com.ruoyi.system.domain.ActSuppliesTemplate"
resultMap=
"SuppliesTemplateResult"
>
select id, det_id, template_name from act_supplies_template where status = 0
</select>
<select
id=
"saveTemp"
parameterType=
"Long"
resultType=
"Integer"
>
select id from act_supplies_template where id = #{id} and status =0
</select>
<select
id=
"saveHistory"
parameterType=
"Long"
resultType=
"Integer"
>
SELECT COUNT(role_id) FROM act_supplies_historydata where role_id = #{id}
</select>
<select
id=
"saveStatus"
parameterType=
"Long"
resultType=
"Integer"
>
select id from act_supplies_template where id = #{id} and status = 0
</select>
<update
id=
"updateRelease"
parameterType=
"ActSuppliesRole"
>
update act_supplies_role
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</trim>
where id = #{id}
</update>
<select
id=
"selectActSuppliesRoleList"
parameterType=
"ActSuppliesRole"
resultMap=
"ActSuppliesRoleResult"
>
select a.id,a.temp_id,a.role_name,a.status,b.template_name from act_supplies_role a,act_supplies_template b
<where>
...
...
ruoyi-supplies/src/main/resources/mapper/system/ActSuppliesTemplateMapper.xml
View file @
0a8c0671
...
...
@@ -17,6 +17,19 @@
</resultMap>
<resultMap
type=
"ActSuppliesRole"
id=
"ActSuppliesRoleResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"tempId"
column=
"temp_id"
/>
<result
property=
"roleName"
column=
"role_name"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"templateName"
column=
"template_name"
/>
</resultMap>
<sql
id=
"selectSuppliesTemplateVo"
>
select id, det_id, template_name, template_content, status, create_by, create_time, update_by, update_time from act_supplies_template
</sql>
...
...
@@ -25,11 +38,8 @@
select temp_id from act_supplies_role where temp_id=#{id}
</select>
<select
id=
"findall"
parameterType=
"String"
resultType=
"Integer"
>
select temp_id from act_supplies_role where temp_id in
<foreach
collection=
"array"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
<select
id=
"findall"
parameterType=
"Long"
resultType=
"Long"
>
select count(*) from act_supplies_role where temp_id = #{id}
</select>
...
...
@@ -37,6 +47,32 @@
select template_name from act_supplies_template
</select>
<sql
id=
"selectActSuppliesRoleVo"
>
select id, temp_id, role_name, status, create_by, create_time, update_by, update_time from act_supplies_role
</sql>
<select
id=
"selectActSuppliesRoleList"
parameterType=
"Integer"
resultMap=
"ActSuppliesRoleResult"
>
select id , role_name from act_supplies_role where temp_id = #{id}
</select>
<select
id=
"selectActSuppliesRoleById"
parameterType=
"Integer"
resultMap=
"ActSuppliesRoleResult"
>
<include
refid=
"selectActSuppliesRoleVo"
/>
where temp_id = #{id}
</select>
<update
id=
"updateActSuppliesRole"
parameterType=
"ActSuppliesRole"
>
update act_supplies_role
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"tempId != null"
>
temp_id = #{tempId},
</if>
<if
test=
"roleName != null"
>
role_name = #{roleName},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</trim>
where id = #{id}
</update>
<select
id=
"selectSuppliesTemplateList"
parameterType=
"ActSuppliesTemplate"
resultMap=
"SuppliesTemplateResult"
>
select id, det_id, template_name, status from act_supplies_template
<where>
...
...
@@ -64,6 +100,16 @@
SELECT COUNT(template_id) FROM act_supplies_historydata where template_id = #{id}
</select>
<update
id=
"updateRelease"
parameterType=
"ActSuppliesTemplate"
>
update act_supplies_template
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</trim>
where id = #{id}
</update>
<insert
id=
"insertSuppliesTemplate"
parameterType=
"ActSuppliesTemplate"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into act_supplies_template
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
ruoyi-ui/public/exportExcel.js
View file @
0a8c0671
...
...
@@ -102,7 +102,8 @@ var setStyleAndValue = function(cellArr, worksheet) {
cell
.
it
,
cell
.
fs
,
cell
.
cl
,
cell
.
ul
cell
.
ul
,
cell
.
ps
);
let
alignment
=
alignmentConvert
(
cell
.
vt
,
cell
.
ht
,
cell
.
tb
,
cell
.
tr
);
let
value
=
''
;
...
...
@@ -155,7 +156,7 @@ var fontConvert = function(
it
=
0
,
fs
=
10
,
cl
=
0
,
ul
=
0
ul
=
0
,
)
{
// luckysheet:ff(样式), fc(颜色), bl(粗体), it(斜体), fs(大小), cl(删除线), ul(下划线)
const
luckyToExcel
=
{
...
...
@@ -186,7 +187,7 @@ var fontConvert = function(
bold
:
luckyToExcel
.
num2bl
(
bl
),
italic
:
luckyToExcel
.
num2bl
(
it
),
underline
:
luckyToExcel
.
num2bl
(
ul
),
strike
:
luckyToExcel
.
num2bl
(
cl
)
strike
:
luckyToExcel
.
num2bl
(
cl
)
,
};
return
font
;
...
...
@@ -196,7 +197,7 @@ var alignmentConvert = function(
vt
=
'
default
'
,
ht
=
'
default
'
,
tb
=
'
default
'
,
tr
=
'
default
'
tr
=
'
default
'
,
)
{
// luckysheet:vt(垂直), ht(水平), tb(换行), tr(旋转)
const
luckyToExcel
=
{
...
...
@@ -233,7 +234,8 @@ var alignmentConvert = function(
vertical
:
luckyToExcel
.
vertical
[
vt
],
horizontal
:
luckyToExcel
.
horizontal
[
ht
],
wrapText
:
luckyToExcel
.
wrapText
[
tb
],
textRotation
:
luckyToExcel
.
textRotation
[
tr
]
textRotation
:
luckyToExcel
.
textRotation
[
tr
],
};
return
alignment
;
};
...
...
ruoyi-ui/src/api/ActSuppliesDetails/ActSuppliesDetails.js
View file @
0a8c0671
...
...
@@ -62,15 +62,14 @@ export function exportActSuppliesDetails(query) {
//启用
export
function
toggleEnable
(
id
)
{
return
request
({
url
:
'
/ActSuppliesDetails/ActSuppliesDetails/enable/
'
+
id
,
method
:
'
get
'
,
url
:
`/Actsupplies/Actsupplies/
${
id
}
/enable?status=0`
,
method
:
'
put
'
,
})
}
//禁用
export
function
toggleDisable
(
id
)
{
return
request
({
url
:
'
/ActSuppliesDetails/ActSuppliesDetails/disable/
'
+
id
,
method
:
'
ge
t
'
,
url
:
`/Actsupplies/Actsupplies/
${
id
}
/disable?status=1`
,
method
:
'
pu
t
'
,
})
}
ruoyi-ui/src/api/Actsupplies/Actsupplies.js
View file @
0a8c0671
...
...
@@ -59,22 +59,35 @@ export function delSupplies(id) {
method
:
'
delete
'
})
}
//启用
export
function
toggleEnable
(
id
)
{
return
request
({
url
:
`/Actsupplies/Actsupplies/
${
id
}
/enable?status=0`
,
method
:
'
put
'
,
})
}
/*//启用
export function toggleEnable(id) {
return request({
url: '/Actsupplies/Actsupplies/enable/' +id,
method: 'get',
})
}
//禁用
}*/
export
function
toggleDisable
(
id
)
{
return
request
({
url
:
`/Actsupplies/Actsupplies/
${
id
}
/disable?status=1`
,
method
:
'
put
'
,
})
}
/*//禁用
export function toggleDisable(id) {
return request({
url: '/Actsupplies/Actsupplies/disable/' +id,
method: 'get',
})
}
}
*/
...
...
ruoyi-ui/src/api/ruoyi-myLuckyexcel/myluckyexcel.js
View file @
0a8c0671
...
...
@@ -19,6 +19,22 @@ export function listSuppliesTemplate(query) {
})
}
// 查询导入规则列表
export
function
listSuppliesrole
(
id
)
{
return
request
({
url
:
'
/SuppliesTemplate/SuppliesTemplate/lists/
'
+
id
,
method
:
'
get
'
,
})
}
// 查询导入规则详细
export
function
getSuppliesrole
(
id
)
{
return
request
({
url
:
'
/system/suppliesrole/
'
+
id
,
method
:
'
get
'
})
}
//展示excel模板
export
function
listSuppliesTemplateId
(
id
)
{
return
request
({
...
...
@@ -35,6 +51,15 @@ export function getSuppliesTemplate(id) {
})
}
// 修改导入规则
export
function
updateSuppliesrole
(
id
)
{
return
request
({
url
:
'
/system/suppliesrole/edit
'
+
id
,
method
:
'
put
'
,
})
}
// 新增Excel模板
export
function
addSuppliesTemplate
(
data
)
{
return
request
({
...
...
ruoyi-ui/src/api/system/historydata.js
View file @
0a8c0671
...
...
@@ -51,3 +51,12 @@ export function exportHistorydata(query) {
params
:
query
})
}
// 新增 历史数据
export
function
addInsert
(
data
)
{
return
request
({
url
:
'
/system/historydata/addInsert
'
,
method
:
'
post
'
,
data
:
data
})
}
ruoyi-ui/src/api/system/suppliesrole.js
View file @
0a8c0671
...
...
@@ -87,15 +87,31 @@ export function exportSuppliesrole(query) {
//启用
export
function
toggleEnable
(
id
)
{
return
request
({
url
:
'
/system/suppliesrole/enable/
'
+
id
,
method
:
'
get
'
,
url
:
`/system/suppliesrole/
${
id
}
/enable?status=0`
,
method
:
'
put
'
,
})
}
//禁用
export
function
toggleDisable
(
id
)
{
return
request
({
url
:
'
/system/suppliesrole/disable/
'
+
id
,
url
:
`/system/suppliesrole/
${
id
}
/disable?status=1`
,
method
:
'
put
'
,
})
}
//发布
export
function
releaseRoleStatus
(
ids
,
tempids
)
{
return
request
({
url
:
'
/system/suppliesrole/releaseRS/
'
+
ids
+
'
/
'
+
tempids
,
method
:
'
get
'
,
})
}
//下架
export
function
offShelfRoleStatus
(
ids
)
{
return
request
({
url
:
'
/system/suppliesrole/offShelfRS/
'
+
ids
,
method
:
'
get
'
,
})
...
...
ruoyi-ui/src/views/system/ActSuppliesDetails/ActSuppliesDetails/index.vue
View file @
0a8c0671
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/index.vue
View file @
0a8c0671
...
...
@@ -223,7 +223,7 @@ export default {
{
required
:
true
,
message
:
"
关联id不能为空
"
,
trigger
:
"
change
"
},
],
suppliesName
:[
{
required
:
true
,
message
:
"
物料
名称不能为空
"
,
trigger
:
"
blur
"
}
{
required
:
true
,
message
:
"
二级分类
名称不能为空
"
,
trigger
:
"
blur
"
}
],
},
idRules
:[
...
...
@@ -351,7 +351,7 @@ export default {
getSupplies
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"
修改
物料总分类管理
"
;
this
.
title
=
"
修改
二级分类
"
;
});
},
/** 提交按钮 */
...
...
@@ -380,7 +380,7 @@ export default {
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
const
name
=
row
.
suppliesName
||
this
.
name
;
this
.
$confirm
(
'
是否确认删除
物料总分类管理
编号为"
'
+
name
+
'
"的数据项?
'
,
"
警告
"
,
{
this
.
$confirm
(
'
是否确认删除
二级分类
编号为"
'
+
name
+
'
"的数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
...
...
ruoyi-ui/src/views/system/Actsupplies/Actsupplies/indexone.vue
View file @
0a8c0671
...
...
@@ -215,7 +215,7 @@ export default {
{
required
:
true
,
message
:
"
关联id不能为空
"
,
trigger
:
"
change
"
},
],
suppliesName
:[
{
required
:
true
,
message
:
"
物料
名称不能为空
"
,
trigger
:
"
blur
"
}
{
required
:
true
,
message
:
"
一级分类
名称不能为空
"
,
trigger
:
"
blur
"
}
],
},
idRules
:[
...
...
@@ -339,7 +339,7 @@ export default {
this
.
reset
();
this
.
form
.
pid
=
0
;
this
.
open
=
true
;
this
.
title
=
"
新增
二
级分类
"
;
this
.
title
=
"
新增
一
级分类
"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
...
...
@@ -348,7 +348,7 @@ export default {
getSupplies
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"
修改
物料总分类管理
"
;
this
.
title
=
"
修改
一级分类
"
;
});
},
/** 提交按钮 */
...
...
@@ -377,7 +377,7 @@ export default {
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
const
name
=
row
.
suppliesName
||
this
.
name
;
this
.
$confirm
(
'
是否确认删除
物料总分类管理
编号为"
'
+
name
+
'
"的数据项?
'
,
"
警告
"
,
{
this
.
$confirm
(
'
是否确认删除
一级分类
编号为"
'
+
name
+
'
"的数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
...
...
ruoyi-ui/src/views/system/supplies/index.vue
View file @
0a8c0671
This diff is collapsed.
Click to expand it.
ruoyi-ui/src/views/system/supplies/index_template.vue
View file @
0a8c0671
...
...
@@ -35,7 +35,7 @@
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<!--
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
...
...
@@ -46,7 +46,7 @@
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:edit']"
>
修改
</el-button>
</el-col>
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
...
...
@@ -79,7 +79,7 @@
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"index"
width=
"80"
align=
"center"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
label=
"模板名称"
align=
"center"
prop=
"templateName"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<!--
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<template
slot-scope=
"scope"
>
<div>
<el-switch
...
...
@@ -94,8 +94,24 @@
</el-switch>
</div>
</
template
>
</el-table-column>
-->
<el-table-column
label=
"状态"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div>
<template
v-if=
"scope.row.status === 0"
>
<span
style=
"color: #0cc030;"
>
已发布
</span>
</
template
>
<
template
v-else-if=
"scope.row.status === 1"
>
<span
style=
"color: #0077ff;"
>
未发布
</span>
</
template
>
<
template
v-else-if=
"scope.row.status === 2"
>
<span
style=
"color: #ff0000;"
>
未发布
</span>
</
template
>
</div>
</template>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
prop=
"status"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
...
...
@@ -152,6 +168,14 @@
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:remove']"
>
删除
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-detailUpdate"
@
click=
"detailUpdate(scope.row)"
v-hasPermi=
"['SuppliesTemplate:SuppliesTemplate:detailUpdate']"
>
修改购入规则
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -198,13 +222,69 @@
</div>
</el-dialog>
<!-- 添加或修改导入规则对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"optionRole"
width=
"500px"
append-to-body
>
<el-form
ref=
"forms"
:model=
"forms"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"所属模板"
prop=
"tempId"
>
<el-select
v-model=
"selectedOption"
filterable
placeholder=
"请选择关联项"
style=
"width:380px"
@
change=
"handleOptionChange(selectedOption)"
>
<el-option
v-for=
"option in options1"
:key=
"option.roleName"
:label=
"option.roleName"
:value=
"option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"规则名称"
prop=
"roleName"
>
<el-input
v-model=
"forms.roleName"
placeholder=
"请输入规则名称"
maxlength=
"36"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<div
id=
"luckysheet"
:style=
"{ position: positionValue, top: '0', left: '0', right: '0', bottom: '0' }"
></div>
<div
id=
"luckysheet"
:style=
"{ position: positionValue, top: '0', left: '0', right: '0', bottom: '0' }"
></div>
<!-- 遮罩层组件 -->
<div
v-if=
"uploading"
class=
"overlay"
>
<div
class=
"loader"
></div>
</div>
</div>
</template>
<
style
>
.overlay
{
position
:
fixed
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
z-index
:
9999
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.loader
{
border
:
16px
solid
#f3f3f3
;
/* 转圈圈的颜色 */
border-top
:
16px
solid
#3498db
;
/* 转圈圈的主题颜色 */
border-radius
:
50%
;
width
:
120px
;
height
:
120px
;
animation
:
spin
2s
linear
infinite
;
}
@keyframes
spin
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
360deg
);
}
}
</
style
>
<
style
>
#luckysheet_info_detail_title
{
display
:
none
;
...
...
@@ -227,6 +307,9 @@
<
script
>
import
{
listSuppliesTemplate
,
listSuppliesrole
,
getSuppliesrole
,
updateSuppliesrole
,
getSuppliesTemplate
,
delSuppliesTemplate
,
addSuppliesTemplate
,
...
...
@@ -237,11 +320,13 @@ import {
import
$
from
'
jquery
'
;
import
XLSX
from
'
xlsx
'
;
import
LuckyExcel
from
'
luckyexcel
'
;
import
{
Loading
}
from
'
element-ui
'
;
export
default
{
name
:
"
SuppliesTemplate
"
,
data
()
{
return
{
selectedOption
:
''
,
positionValue
:
'
static
'
,
fileList
:
[{
name
:
'
food.jpeg
'
,
...
...
@@ -278,6 +363,10 @@ export default {
open1
:
false
,
showProgress
:
false
,
uploadProgress
:
0
,
optionRole
:
false
,
options1
:[],
// 查询参数
queryParams
:
{
pageNum
:
1
,
...
...
@@ -288,6 +377,7 @@ export default {
status
:
null
,
},
form
:
{},
forms
:
{},
rules
:
{},
}
},
...
...
@@ -351,7 +441,7 @@ export default {
},
/**上传事件 */
beforeUpload
(
file
)
{
async
beforeUpload
(
file
)
{
//存在重复
findName
(
file
.
name
).
then
(
result
=>
{
console
.
log
(
result
.
data
)
...
...
@@ -368,11 +458,12 @@ export default {
if
(
!
isJpgOrPng
)
{
this
.
$message
.
error
(
'
只能上传xlsx文件
'
);
}
LuckyExcel
.
transformExcelToLucky
(
file
,
(
exportJson
,
lucksheetfile
)
=>
{
this
.
uploading
=
true
;
await
LuckyExcel
.
transformExcelToLucky
(
file
,
(
exportJson
,
lucksheetfile
)
=>
{
this
.
form
.
templateName
=
file
.
name
;
this
.
form
.
templateContent
=
JSON
.
stringify
(
exportJson
.
sheets
);
});
this
.
uploading
=
false
;
return
isJpgOrPng
;
},
...
...
@@ -399,6 +490,7 @@ export default {
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
optionRole
=
false
;
this
.
reset
();
},
// 表单重置
...
...
@@ -442,6 +534,7 @@ export default {
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
if
(
row
.
status
===
1
)
{
this
.
fileListName
=
[];
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
...
...
@@ -451,6 +544,30 @@ export default {
this
.
open
=
true
;
this
.
title
=
"
修改Excel模板
"
;
});
}
else
{
this
.
msgError
(
"
文件文件已发布无法修改!!!
"
)
}
},
detailUpdate
(
row
)
{
this
.
title
=
"
修改导入规则
"
;
this
.
selectedOption
=
''
;
this
.
forms
=
''
;
this
.
instea
=
''
;
const
id
=
row
.
id
||
this
.
ids
listSuppliesrole
(
id
).
then
(
response
=>
{
this
.
options1
=
response
.
rows
;
});
this
.
optionRole
=
true
;
},
handleOptionChange
(
selectedOption
)
{
getSuppliesrole
(
selectedOption
).
then
(
response
=>
{
this
.
forms
=
response
.
data
;
this
.
optionRole
=
true
;
});
},
/** 提交按钮 */
submitForm
()
{
...
...
@@ -528,16 +645,20 @@ export default {
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
const
name
=
row
.
templateName
||
this
.
name
;
this
.
$confirm
(
'
是否确认删除
Excel模板编号
为"
'
+
name
+
'
"的数据项?
'
,
"
警告
"
,
{
this
.
$confirm
(
'
是否确认删除
模板名称
为"
'
+
name
+
'
"的数据项?
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(
function
()
{
return
delSuppliesTemplate
(
ids
);
}).
then
((
result
)
=>
{
if
(
result
.
data
===
"
操作失败
"
)
{
if
(
result
.
msg
===
"
312
"
)
{
this
.
getList
();
this
.
msgError
(
"
该模板下存在关联规则,请先删除关联规则!!!
"
);
this
.
$confirm
(
'
模板名称为"
'
+
result
.
data
+
'
"的数据项下存在关联规则,请先删除关联规则在删除模板
'
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
}).
then
(()
=>
{
this
.
getList
();})
}
else
{
this
.
getList
();
this
.
msgSuccess
(
"
删除成功
"
);
...
...
ruoyi-ui/src/views/system/suppliesrole/index.vue
View file @
0a8c0671
This diff is collapsed.
Click to expand it.
ruoyi-ui/src/views/system/suppliesroledetail/index.vue
View file @
0a8c0671
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment