Commit f3252829 authored by 张兴海's avatar 张兴海

修复缺陷

parent b868a419
......@@ -81,7 +81,7 @@ public class ActSuppliesController extends BaseController
List<ActSupplies> list = actSuppliesService.selectActSuppliesList(actSupplies);
ExcelUtil<ActSupplies> util = new ExcelUtil<ActSupplies>(ActSupplies.class);
return util.exportExcel(list, "用友物料");
return util.exportExcel(list, "二级分类数据");
}
/**
......@@ -94,7 +94,7 @@ public class ActSuppliesController extends BaseController
{
List<ActSupplies> list = actSuppliesService.selectActSuppliesListOne(actSupplies);
ExcelUtil<ActSupplies> util = new ExcelUtil<ActSupplies>(ActSupplies.class);
return util.exportExcel(list, "物料总分类管理数据");
return util.exportExcel(list, "一级分类数据");
}
/**
......
......@@ -5,6 +5,7 @@ import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.ActSuppliesTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -97,6 +98,8 @@ public class ActSuppliesRoleController extends BaseController
return AjaxResult.success("添加成功");
}
/**
* 修改导入规则
*/
......
......@@ -78,5 +78,7 @@ public interface ActSuppliesMapper
*/
public int countBySuppliesName(String suppliesName);
List<ActSupplies> selectActSuppliesListOne(ActSupplies actSupplies);
}
......@@ -67,7 +67,9 @@ public interface ActSuppliesRoleMapper
List<Integer> findall(Integer[] ids);
List<Integer> find(Integer id);
public int countByRoleName(String roleName);
public int countByRoleName(ActSuppliesRole actSuppliesRole);
}
......@@ -80,4 +80,5 @@ public interface IActSuppliesRoleService
List<Integer> findall(Integer[] ids);
List<Integer> find(Integer id);
}
......@@ -59,22 +59,20 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
@Override
public int insertActSuppliesRole(ActSuppliesRole actSuppliesRole)
{
String roleName = actSuppliesRole.getRoleName();
int countByRoleName = actSuppliesRoleMapper.countByRoleName(roleName);
int countByRoleName = actSuppliesRoleMapper.countByRoleName(actSuppliesRole);
if(countByRoleName > 0){
String message = "添加规则失败,规则名称已被占用";
System.out.println(message);
/*throw new ServiceException(ServiceCode.ERR_CONFLICT,message);*/
/* throw new ServiceException(ServiceCode.ERR_CONFLICT,message);*/
return 0;
}
ActSuppliesRole actSuppliesRole1 = new ActSuppliesRole();
BeanUtils.copyProperties(actSuppliesRole,actSuppliesRole1);
actSuppliesRole.setCreateTime(DateUtils.getNowDate());
return actSuppliesRoleMapper.insertActSuppliesRole(actSuppliesRole);
}
/**
* 修改导入规则
*
......@@ -84,18 +82,16 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
@Override
public int updateActSuppliesRole(ActSuppliesRole actSuppliesRole)
{
String roleName = actSuppliesRole.getRoleName();
int countByRoleName = actSuppliesRoleMapper.countByRoleName(roleName);
int countByRoleName = actSuppliesRoleMapper.countByRoleName(actSuppliesRole);
if(countByRoleName > 0){
String message = "修改规则失败,新的规则名称已被占用";
System.out.println(message);
/* throw new ServiceException(ServiceCode.ERR_CONFLICT,message);*/
/*throw new ServiceException(ServiceCode.ERR_CONFLICT,message);*/
return 0;
}
ActSuppliesRole actSuppliesRole2 = new ActSuppliesRole();
BeanUtils.copyProperties(actSuppliesRole,actSuppliesRole2);
actSuppliesRole.setUpdateTime(DateUtils.getNowDate());
return 0;
/* actSuppliesRoleMapper.insertActSuppliesRole(actSuppliesRole)*/
return actSuppliesRoleMapper.updateActSuppliesRole(actSuppliesRole);
}
/**
......
......@@ -42,8 +42,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="countByRoleName" resultType="int">
select count(*) from act_supplies_role where role_name=#{roleName}
<select id="countByRoleName" parameterType="ActSuppliesRole" resultType="int">
select count(*) from act_supplies_role where role_name=#{roleName} AND temp_id=#{tempId}
</select>
......
......@@ -418,6 +418,7 @@ export default {
})
},
/** 导出设置 */
handleExport123: debounce(function() {
// 处理点击事件
......
......@@ -143,6 +143,7 @@
:key="option.suppliesName"
:label="option.suppliesName"
:value="option.id"
maxlength="15"
></el-option>
</el-select>
</el-form-item>
......@@ -333,6 +334,7 @@ export default {
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.name=selection.map(item => item.suppliesName)
this.single = selection.length!==1
this.multiple = !selection.length
},
......@@ -395,6 +397,7 @@ export default {
}).catch(()=>{
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
......
......@@ -377,7 +377,7 @@ export default {
handleDelete(row) {
const ids = row.id || this.ids;
const name = row.suppliesName || this.name;
this.$confirm('是否确认删除物料总分类管理编号为"' + row.name + '"的数据项?', "警告", {
this.$confirm('是否确认删除物料总分类管理编号为"' + name + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......@@ -394,9 +394,9 @@ export default {
}).catch(()=>{
})
},
/** 导出按钮操作 */
handleExport() {
debugger
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有一级分类数据项?', "警告", {
confirmButtonText: "确定",
......
......@@ -111,6 +111,7 @@ export default {
this.depss = response.rows;
});
},
/** 下拉选和页面luckysheet绑定 */
handleOptionChange() {
......
......@@ -441,6 +441,7 @@ export default {
}
},
/** 详情按钮操作 */
handleSave(row) {
......
......@@ -20,6 +20,13 @@
</el-select>
</el-form-item>
<el-form-item label="规则名称" prop="roleName">
<!-- <el-select v-model="queryParams.roleName" filterable clearable placeholder="请选择规则" >
<el-option
v-for="option in options1"
:key="option.roleName"
:label="option.roleName"
:value="option.id"
></el-option>-->
<el-input
v-model="queryParams.roleName"
placeholder="请输入规则名称"
......@@ -27,6 +34,7 @@
size="small"
@keyup.enter.native="handleQuery"
/>
<!-- </el-select>-->
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态">
......@@ -147,7 +155,15 @@
</el-select>
</el-form-item>
<el-form-item label="规则名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入规则名称" />
<el-input v-model="form.roleName" placeholder="请输入规则名称" maxlength="15"/>
<!-- <el-select v-model="queryParams.roleName" filterable clearable placeholder="请选择规则" >
<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="状态">
<el-select v-model="form.status" style="width:380px">
......@@ -178,6 +194,7 @@ export default {
loading: true,
// 选中数组
ids: [],
name:[],
// 非单个禁用
single: true,
// 非多个禁用
......@@ -190,6 +207,7 @@ export default {
suppliesroleList: [],
options:[],
options1:[],
// 弹出层标题
title: "",
......@@ -222,6 +240,7 @@ export default {
},
methods: {
/**启用 */
toggleEnable(suppliesRole){
console.log('你点击了【' + suppliesRole.s+'】的开关控件,当前开关值:' + suppliesRole.status);
......@@ -264,6 +283,7 @@ export default {
getnameid(){
saveSid().then(response =>{
this.options = response.rows;
this.options1=response.rows;
})
},
......@@ -309,6 +329,7 @@ export default {
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.name = selection.map(item => item.roleName)
this.single = selection.length!==1
this.multiple = !selection.length
},
......@@ -351,7 +372,8 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除规则名称为"' + row.roleName + '"的数据项?', "警告", {
const name = row.roleName || this.name;
this.$confirm('是否确认删除规则名称为"' + name + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......@@ -368,6 +390,7 @@ export default {
}).catch(()=>{
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
......
......@@ -199,6 +199,7 @@
<!-- <el-button type="primary" @click="addInputs">添加规则</el-button>-->
<!-- </el-form-item>-->
<el-row>
<el-col :span="8">
<el-form-item label="转换类型" prop="detailYS">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment