Commit 89e13894 authored by lenovo's avatar lenovo

规则详情修改,物料转换修改

parent 6f9872d4
...@@ -93,27 +93,11 @@ public class ActSuppliesConvertController extends BaseController{ ...@@ -93,27 +93,11 @@ public class ActSuppliesConvertController extends BaseController{
@PostMapping("/converSupplies") @PostMapping("/converSupplies")
public TableDataInfo convertSupplies(@RequestBody String[] names){ public TableDataInfo convertSupplies(@RequestBody String[] names){
List<String> name = Arrays.asList(names);
List<ActOperation> list = actSuppliesConvertService.converSupplies(name);
name = name.stream()
.map(str -> {
if (str == null) {
return null; // 保留原始的null值
}
for (int i = 0; i < list.size(); i++) {
if (str.equals(list.get(i).getDetaliesName())) {
return list.get(i).getSuppliesName();
}
}
return str;
})
.collect(Collectors.toList());
return getDataTable(name);
} List<String> list = actSuppliesConvertService.converSupplies(names);
return getDataTable(list);
}
} }
...@@ -32,7 +32,7 @@ public class ActSuppliesRoleDetailController extends BaseController ...@@ -32,7 +32,7 @@ public class ActSuppliesRoleDetailController extends BaseController
/** /**
* 查询上级分类 * 查询上级分类(所有)
* */ * */
@PreAuthorize("@ss.hasPermi('system:suppliesroledetail:savesid')") @PreAuthorize("@ss.hasPermi('system:suppliesroledetail:savesid')")
@GetMapping("/savesid") @GetMapping("/savesid")
...@@ -45,6 +45,20 @@ public class ActSuppliesRoleDetailController extends BaseController ...@@ -45,6 +45,20 @@ public class ActSuppliesRoleDetailController extends BaseController
} }
/**
* 查询上级分类(未发布)
* */
@PreAuthorize("@ss.hasPermi('system:suppliesroledetail:savesidsta')")
@GetMapping("/savesidsta")
@ResponseBody
public TableDataInfo saveSidsta(){
List<ActSuppliesRole> options = actSuppliesRoleDetailService.saveSidsta();
return getDataTable(options);
}
// /** // /**
// * 查询运算方法 // * 查询运算方法
// * */ // * */
......
...@@ -9,7 +9,9 @@ public class ActOperation extends BaseEntity { ...@@ -9,7 +9,9 @@ public class ActOperation extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Integer id; private Integer id;
private String encoding; private String oneLevel;
private String twoLevel;
private String threeLevel;
private String suppliesName; private String suppliesName;
private String detaliesName; private String detaliesName;
...@@ -21,12 +23,28 @@ public class ActOperation extends BaseEntity { ...@@ -21,12 +23,28 @@ public class ActOperation extends BaseEntity {
this.id = id; this.id = id;
} }
public String getEncoding() { public String getOneLevel() {
return encoding; return oneLevel;
} }
public void setEncoding(String encoding) { public void setOneLevel(String oneLevel) {
this.encoding = encoding; this.oneLevel = oneLevel;
}
public String getTwoLevel() {
return twoLevel;
}
public void setTwoLevel(String twoLevel) {
this.twoLevel = twoLevel;
}
public String getThreeLevel() {
return threeLevel;
}
public void setThreeLevel(String threeLevel) {
this.threeLevel = threeLevel;
} }
public String getSuppliesName() { public String getSuppliesName() {
......
...@@ -68,5 +68,7 @@ public interface ActSuppliesRoleDetailMapper ...@@ -68,5 +68,7 @@ public interface ActSuppliesRoleDetailMapper
void updateRoleDetailStatus(ActSuppliesRoleDetail actSuppliesRoleDetail); void updateRoleDetailStatus(ActSuppliesRoleDetail actSuppliesRoleDetail);
List<ActSuppliesRole> saveSidsta();
// List<ActOperation> saveOperation(); // List<ActOperation> saveOperation();
} }
...@@ -16,5 +16,5 @@ public interface IActSuppliesConvertService { ...@@ -16,5 +16,5 @@ public interface IActSuppliesConvertService {
ActSupplies selectSuppliesname(String name); ActSupplies selectSuppliesname(String name);
List<ActOperation> converSupplies(List<String> name); List<String> converSupplies(String[] name);
} }
...@@ -82,4 +82,7 @@ public interface IActSuppliesRoleDetailService ...@@ -82,4 +82,7 @@ public interface IActSuppliesRoleDetailService
* @param id 尝试禁用物料细分类管理的id * @param id 尝试禁用物料细分类管理的id
*/ */
void setDisable(Long id); void setDisable(Long id);
List<ActSuppliesRole> saveSidsta();
} }
...@@ -7,7 +7,9 @@ import com.ruoyi.system.service.IActSuppliesConvertService; ...@@ -7,7 +7,9 @@ import com.ruoyi.system.service.IActSuppliesConvertService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service
public class ActSuppliesConvertServiceImpl implements IActSuppliesConvertService { public class ActSuppliesConvertServiceImpl implements IActSuppliesConvertService {
...@@ -41,7 +43,26 @@ public class ActSuppliesConvertServiceImpl implements IActSuppliesConvertService ...@@ -41,7 +43,26 @@ public class ActSuppliesConvertServiceImpl implements IActSuppliesConvertService
} }
@Override @Override
public List<ActOperation> converSupplies(List<String> name) { public List<String> converSupplies(String[] names) {
return actSuppliesConverMapper.converSupplies(name);
List<String> name = Arrays.asList(names);
List<ActOperation> list = actSuppliesConverMapper.converSupplies(name);
name = name.stream()
.map(str -> {
if (str == null) {
return null; // 保留原始的null值
}
for (int i = 0; i < list.size(); i++) {
if (str.equals(list.get(i).getDetaliesName())) {
return list.get(i).getSuppliesName();
}
}
return str;
})
.collect(Collectors.toList());
return name;
} }
} }
...@@ -167,6 +167,11 @@ public class ActSuppliesRoleDetailServiceImpl implements IActSuppliesRoleDetailS ...@@ -167,6 +167,11 @@ public class ActSuppliesRoleDetailServiceImpl implements IActSuppliesRoleDetailS
updateStatusById(id,1); updateStatusById(id,1);
} }
@Override
public List<ActSuppliesRole> saveSidsta() {
return actSuppliesRoleDetailMapper.saveSidsta();
}
private void updateStatusById(Long id, Integer status){ private void updateStatusById(Long id, Integer status){
String[] statusText={"禁用","启用"}; String[] statusText={"禁用","启用"};
......
...@@ -63,6 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -63,6 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="com.ruoyi.system.domain.ActOperation" id="ActOperationResult"> <resultMap type="com.ruoyi.system.domain.ActOperation" id="ActOperationResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="oneLevel" column="one_level" />
<result property="twoLevel" column="two_level" />
<result property="threeLevel" column="three_level" />
<result property="suppliesName" column="supplies_name" /> <result property="suppliesName" column="supplies_name" />
<result property="detaliesName" column="details_name" /> <result property="detaliesName" column="details_name" />
</resultMap> </resultMap>
...@@ -89,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -89,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="converSupplies" parameterType="java.util.List" resultMap="ActOperationResult"> <select id="converSupplies" parameterType="java.util.List" resultMap="ActOperationResult">
select id , supplies_name, b.details_name from act_supplies a ,( select a.id ,a.one_level,a.two_level,a.three_level, a.supplies_name, b.details_name from act_supplies a ,(
SELECT sid ,details_name SELECT sid ,details_name
FROM act_supplies_details FROM act_supplies_details
WHERE details_name IN WHERE details_name IN
......
...@@ -47,9 +47,12 @@ ...@@ -47,9 +47,12 @@
</sql> </sql>
<select id="saveSid" parameterType="com.ruoyi.system.domain.ActSuppliesRole" resultMap="ActSuppliesRoleResult"> <select id="saveSid" parameterType="com.ruoyi.system.domain.ActSuppliesRole" resultMap="ActSuppliesRoleResult">
select id, temp_id, role_name from act_supplies_role where status = 1 select id, temp_id, role_name from act_supplies_role
</select> </select>
<select id="saveSidsta" parameterType="com.ruoyi.system.domain.ActSuppliesRole" resultMap="ActSuppliesRoleResult">
select id, temp_id, role_name from act_supplies_role where status = 1;
</select>
<!-- <select id="saveOperation" parameterType="ActOperation" resultMap="ActOperationResult">--> <!-- <select id="saveOperation" parameterType="ActOperation" resultMap="ActOperationResult">-->
<!-- select id, operation_name, status from act_operation_role where status = 0--> <!-- select id, operation_name, status from act_operation_role where status = 0-->
<!-- </select>--> <!-- </select>-->
......
...@@ -16,7 +16,13 @@ export function saveSid() { ...@@ -16,7 +16,13 @@ export function saveSid() {
method: 'get' method: 'get'
}) })
} }
//查询上级ID
export function saveSidsta() {
return request({
url: '/system/suppliesroledetail/savesidsta',
method: 'get'
})
}
export function saveOperation(){ export function saveOperation(){
return request({ return request({
......
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
<el-form-item label="上级规则" prop="roleId"> <el-form-item label="上级规则" prop="roleId">
<el-select v-model="form.roleId" filterable placeholder="请选择关联项" > <el-select v-model="form.roleId" filterable placeholder="请选择关联项" >
<el-option <el-option
v-for="option in options1" v-for="option in options3"
:key="option.roleName" :key="option.roleName"
:label="option.roleName" :label="option.roleName"
:value="option.id" :value="option.id"
...@@ -279,6 +279,7 @@ import { ...@@ -279,6 +279,7 @@ import {
toggleEnable, toggleEnable,
toggleDisable, toggleDisable,
saveOperation, saveOperation,
saveSidsta,
} from "@/api/system/suppliesroledetail"; } from "@/api/system/suppliesroledetail";
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
...@@ -424,11 +425,6 @@ export default { ...@@ -424,11 +425,6 @@ export default {
saveSid().then(response =>{ saveSid().then(response =>{
this.options1 = response.rows; this.options1 = response.rows;
}) })
// //运算规则
// saveOperation().then(response =>{
// this.options2 = response.rows;
// console.log(this.options2)
// })
}, },
...@@ -483,6 +479,12 @@ export default { ...@@ -483,6 +479,12 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
//上级规则
saveSidsta().then(response =>{
this.options3 = response.rows;
})
this.instea=0; this.instea=0;
this.getnameid(); this.getnameid();
this.reset(); this.reset();
......
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