问题修改及优化--下拉选查询去除权限

This commit is contained in:
hayu 2024-07-30 10:47:35 +08:00
parent 436355fa07
commit da0753286f
9 changed files with 4 additions and 196 deletions

View File

@ -73,7 +73,6 @@ public class SamplesManageController {
@PostMapping(value = "all")
@LogAnnotation(operModul = "收样管理", operation = "查询所有工器具", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getAll() {
try {
List<SamplesManageDto> list = samplesManageService.listTools();
@ -86,7 +85,6 @@ public class SamplesManageController {
@PostMapping(value = "allCustomName")
@LogAnnotation(operModul = "收样管理", operation = "查询所有单位", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getAllCustomName() {
try {
List<SamplesManageDto> list = samplesManageService.getAllCustomName();
@ -115,7 +113,6 @@ public class SamplesManageController {
@PostMapping(value = "getTeamSelected")
@LogAnnotation(operModul = "收样管理", operation = "查询所有班组", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getToolsSelected() {
try {
List<SamplesManageDto> list = samplesManageService.getTeamSelected();
@ -145,7 +142,6 @@ public class SamplesManageController {
@PostMapping(value = "getDeptSelectedById")
@DecryptAndVerify(decryptedClass = SamplesManageDto.class)
@LogAnnotation(operModul = "收样管理", operation = "根据单位id获取部门", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:tools:query')" )
public ServerResponse getDeptSelectedById(EncryptedReq<SamplesManageDto> data) {
try {
List<SamplesManageDto> list = samplesManageService.getDeptSelectedById(data.getData());
@ -169,6 +165,4 @@ public class SamplesManageController {
}
return ServerResponse.createErroe("操作失败");
}
}

View File

@ -60,8 +60,8 @@ public class TestReportManageController {
@PostMapping(value = "getDetailsList")
@DecryptAndVerify(decryptedClass = TestReportManageDto.class)
@LogAnnotation(operModul = "检测报告管理-收样管理详情", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
@LogAnnotation(operModul = "检测报告管理-检测报告管理详情", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:testReport:query')" )
public ServerResponse getDetailsList(EncryptedReq<TestReportManageDto> data) {
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
try {
@ -77,7 +77,6 @@ public class TestReportManageController {
@PostMapping(value = "all")
@LogAnnotation(operModul = "检测报告管理", operation = "查询所有工器具", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getAll() {
try {
List<TestReportManageDto> list = testReportManageService.listTools();
@ -90,7 +89,6 @@ public class TestReportManageController {
@PostMapping(value = "allCustomName")
@LogAnnotation(operModul = "检测报告管理", operation = "查询所有单位", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getAllCustomName() {
try {
List<TestReportManageDto> list = testReportManageService.getAllCustomName();
@ -101,25 +99,8 @@ public class TestReportManageController {
return ServerResponse.createErroe("操作失败");
}
/**
* @description 新增收样数据
*/
@PostMapping("addSamples")
@DecryptAndVerify(decryptedClass = TestReportManageDto.class)
@LogAnnotation(operModul = "检测报告管理", operation = "新增收样数据", operDesc = "业务级事件", operType = "新增")
@PreAuthorize("@pms.hasPermission('sys:samples:add')")
public ServerResponse addSamples(EncryptedReq<TestReportManageDto> vo) {
try {
return testReportManageService.addSamples(vo.getData());
}catch (Exception e){
log.error(e.toString(),e);
return ServerResponse.createErroe("操作失败");
}
}
@PostMapping(value = "getTeamSelected")
@LogAnnotation(operModul = "检测报告管理", operation = "查询所有班组", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getToolsSelected() {
try {
List<TestReportManageDto> list = testReportManageService.getTeamSelected();
@ -130,22 +111,6 @@ public class TestReportManageController {
return ServerResponse.createErroe("操作失败");
}
/**
* @description 派工
*/
@PostMapping("dispatchWork")
@DecryptAndVerify(decryptedClass = TestReportManageDto.class)
@LogAnnotation(operModul = "检测报告管理", operation = "派工", operDesc = "业务级事件", operType = "新增")
@PreAuthorize("@pms.hasPermission('sys:samples:dispatch')")
public ServerResponse dispatchWork(EncryptedReq<TestReportManageDto> vo) {
try {
return testReportManageService.dispatchWork(vo.getData());
} catch (Exception e) {
log.error(e.toString(), e);
return ServerResponse.createErroe("操作失败");
}
}
@PostMapping(value = "viewTestData")
@DecryptAndVerify(decryptedClass = TestReportManageDto.class)
@LogAnnotation(operModul = "检测报告管理", operation = "试验数据详情", operDesc = "业务级事件", operType = "查询")

View File

@ -82,7 +82,6 @@ public class ToolsManageController {
@PostMapping(value = "all")
@LogAnnotation(operModul = "工器具管理", operation = "查询所有工器具", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:tools:query')" )
public ServerResponse getAll() {
try {
List<ToolsManageDto> list = toolsManageService.listTools();

View File

@ -47,27 +47,6 @@ public interface TestReportManageDao {
*/
List<TestReportManageDto> getAllCustomName();
/**
* 新增收样数据 tb_samples
* @param TestReportManageDto
* @return
*/
int addSamples(TestReportManageDto TestReportManageDto);
/**
* 新增设备数据 tb_samples_device
* @param dto
* @return
*/
int addSamplesDevice(TestReportManageDto dto);
/**
* 设备类型编码
* @param sampleToolsId
* @return
*/
String getDevTypeCodeById(Integer sampleToolsId);
/**
* 获取设备编码
* @param nowDate
@ -81,13 +60,6 @@ public interface TestReportManageDao {
*/
List<TestReportManageDto> getTeamSelected();
/**
* 修改班组
* @param dto
* @return
*/
int updateTeamId(TestReportManageDto dto);
/**
* 获取当前年月 报告编号
* @param nowDate

View File

@ -41,26 +41,12 @@ public interface TestReportManageService {
*/
List<TestReportManageDto> getAllCustomName();
/**
* 新增
* @param data
* @return
*/
ServerResponse addSamples(TestReportManageDto data);
/**
* 获取所有班组数据
* @return
*/
List<TestReportManageDto> getTeamSelected();
/**
* 派工
* @param data
* @return
*/
ServerResponse dispatchWork(TestReportManageDto data);
/**
* 试验数据详情
* @param data

View File

@ -133,43 +133,6 @@ public class TestReportManageServiceImpl implements TestReportManageService {
return testReportManageDao.getAllCustomName();
}
@Override
@Transactional(rollbackFor = Exception.class)
public ServerResponse addSamples(TestReportManageDto data) {
JSONArray jsonArray = JSONObject.parseArray(data.getParamsList());
List<TestReportManageDto> TestReportManageDtos = jsonArray.toJavaList(TestReportManageDto.class);
if (TestReportManageDtos.size() > 0){
//先增加基础数据表并返回Id
Integer userId = Integer.parseInt(UserUtil.getLoginUser().getId().toString());
TestReportManageDtos.get(0).setCreateBy(userId);
int re= testReportManageDao.addSamples(TestReportManageDtos.get(0));
if (re>0){
//添加详情数据
for (TestReportManageDto dto : TestReportManageDtos){
//查询设备类型编码
if (dto.getSampleToolsId()!=null){
String devTypeCode = testReportManageDao.getDevTypeCodeById(dto.getSampleToolsId());
dto.setDevTypeCode(devTypeCode);
}
//生成设备编码
String customerCode = customerCodeRule();
dto.setCustomerCode(customerCode);
dto.setId(TestReportManageDtos.get(0).getId());
dto.setCreateBy(userId);
int res= testReportManageDao.addSamplesDevice(dto);
if (res<=0){
throw new RuntimeException("收样设备信息表添加失败");
}
}
}else {
throw new RuntimeException("收样单位信息表添加失败");
}
}else {
throw new RuntimeException("未获取到数据");
}
return ServerResponse.createBySuccessMsg("上传成功");
}
/**
* 查询所有班组
* @return
@ -178,27 +141,6 @@ public class TestReportManageServiceImpl implements TestReportManageService {
public List<TestReportManageDto> getTeamSelected() {
return testReportManageDao.getTeamSelected();
}
@Override
@Transactional(rollbackFor = Exception.class)
public ServerResponse dispatchWork(TestReportManageDto data) {
if (StringHelper.isNotEmpty(data.getIds())){
//拆分用逗号分隔的数据
String[] ids = data.getIds().split(",");
for (String id : ids){
TestReportManageDto dto = new TestReportManageDto();
dto.setId(Integer.parseInt(id));
dto.setTeamId(data.getTeamId());
//更新班组数据
int res = testReportManageDao.updateTeamId(dto);
if (res<=0){
throw new RuntimeException("派工失败");
}
}
}
return ServerResponse.createBySuccessMsg("派工成功");
}
@Override
public ServerResponse viewTestData(TestReportManageDto dto) {
TestReportManageDto testVo = new TestReportManageDto();

View File

@ -1,49 +1,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.aqgqj.basis.dao.TestReportManageDao">
<insert id="addSamples" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
INSERT INTO tb_sample(custom_id,
custom_name,
department,
sample_user,
sample_time,
create_time,
create_user,
sample_date)
VALUES (#{customId},
#{customName},
#{sampleDepartment},
#{sampleUser},
#{sampleTime},
NOW(),
#{createBy},
#{sampleTime})
</insert>
<insert id="addSamplesDevice">
INSERT INTO tb_sample_device(sample_id,
dev_type_name,
dev_type_code,
dev_module,
dev_code,
customer_code,
sample_time,
create_time,
create_user)
VALUES (#{id},
#{sampleTools},
#{devTypeCode},
#{devModule},
#{devCode},
#{customerCode},
#{sampleTime},
NOW(),
#{createBy})
</insert>
<update id="updateTeamId">
UPDATE tb_sample
SET team_id = #{teamId}
WHERE id = #{id}
</update>
<update id="updateReportCode">
INSERT INTO tb_certificate
(`code`, `exper_id`, `dev_type`, `is_hg`, `department`, `create_time`)
@ -176,13 +133,6 @@
del_flag = 0
and custom_status=0
</select>
<select id="getDevTypeCodeById" resultType="java.lang.String">
select sd.dict_code
from sys_distinct sd
where sd.p_id = 92
and sd.id = #{sampleToolsId}
and del_flag = 0
</select>
<select id="selectCustomerCode" resultType="java.lang.String">
SELECT
SUBSTRING( customer_code, - 4 ) AS CODE

View File

@ -15,7 +15,7 @@ layui.use(['form', 'layer', 'table', 'laydate'], function () {
function getToolsSelected() {
let url = dataUrl + '/tools/all';
let url = dataUrl + '/samples/all';
ajaxRequest(url, "POST", null, true, function () {
}, function (result) {
if (result.code === 200) {

View File

@ -236,7 +236,7 @@ function getCustomNameSelected() {
* 获取设备类型数据
*/
function getToolsSelected() {
let url = dataUrl + '/tools/all';
let url = dataUrl + '/samples/all';
ajaxRequest(url, "POST", null, true, function () {
}, function (result) {
if (result.code === 200) {