Merge remote-tracking branch 'origin/fix-bug-202303' into fix-bug-202303
This commit is contained in:
+23
-19
@@ -10,6 +10,8 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
@@ -61,7 +63,8 @@ public class SysUserAgentController {
|
||||
|
||||
@Value("${jero.path.upload}")
|
||||
private String upLoadPath;
|
||||
|
||||
|
||||
private static String ERROE_MSG = "未找到对应实体";
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @param sysUserAgent
|
||||
@@ -75,15 +78,15 @@ public class SysUserAgentController {
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<SysUserAgent>> result = new Result<IPage<SysUserAgent>>();
|
||||
Result<IPage<SysUserAgent>> result = new Result<>();
|
||||
QueryWrapper<SysUserAgent> queryWrapper = QueryGenerator.initQueryWrapper(sysUserAgent, req.getParameterMap());
|
||||
Page<SysUserAgent> page = new Page<SysUserAgent>(pageNo, pageSize);
|
||||
Page<SysUserAgent> page = new Page<>(pageNo, pageSize);
|
||||
IPage<SysUserAgent> pageList = sysUserAgentService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param sysUserAgent
|
||||
@@ -99,7 +102,7 @@ public class SysUserAgentController {
|
||||
return Result.error("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param sysUserAgent
|
||||
@@ -109,7 +112,7 @@ public class SysUserAgentController {
|
||||
public Result<Object> edit(@RequestBody SysUserAgent sysUserAgent) {
|
||||
SysUserAgent sysUserAgentEntity = sysUserAgentService.getById(sysUserAgent.getId());
|
||||
if(sysUserAgentEntity==null) {
|
||||
return Result.error("未找到对应实体");
|
||||
return Result.error(ERROE_MSG);
|
||||
}else {
|
||||
boolean ok = sysUserAgentService.updateById(sysUserAgent);
|
||||
if(ok) {
|
||||
@@ -119,7 +122,7 @@ public class SysUserAgentController {
|
||||
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param id
|
||||
@@ -129,7 +132,7 @@ public class SysUserAgentController {
|
||||
public Result<Object> delete(@RequestParam(name="id",required=true) String id) {
|
||||
SysUserAgent sysUserAgent = sysUserAgentService.getById(id);
|
||||
if(sysUserAgent==null) {
|
||||
return Result.error("未找到对应实体");
|
||||
return Result.error(ERROE_MSG);
|
||||
}else {
|
||||
boolean ok = sysUserAgentService.removeById(id);
|
||||
if(ok) {
|
||||
@@ -138,7 +141,7 @@ public class SysUserAgentController {
|
||||
}
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
@@ -153,7 +156,7 @@ public class SysUserAgentController {
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
@@ -163,12 +166,12 @@ public class SysUserAgentController {
|
||||
public Result<SysUserAgent> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
SysUserAgent sysUserAgent = sysUserAgentService.getById(id);
|
||||
if(sysUserAgent==null) {
|
||||
return Result.error("未找到对应实体");
|
||||
return Result.error(ERROE_MSG);
|
||||
}else {
|
||||
return Result.OK(sysUserAgent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过userName查询
|
||||
* @param userName
|
||||
@@ -176,11 +179,11 @@ public class SysUserAgentController {
|
||||
*/
|
||||
@GetMapping(value = "/queryByUserName")
|
||||
public Result<SysUserAgent> queryByUserName(@RequestParam(name="userName",required=true) String userName) {
|
||||
LambdaQueryWrapper<SysUserAgent> queryWrapper = new LambdaQueryWrapper<SysUserAgent>();
|
||||
LambdaQueryWrapper<SysUserAgent> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysUserAgent::getUserName, userName);
|
||||
SysUserAgent sysUserAgent = sysUserAgentService.getOne(queryWrapper);
|
||||
if(sysUserAgent==null) {
|
||||
return Result.error("未找到对应实体");
|
||||
return Result.error(ERROE_MSG);
|
||||
}else {
|
||||
return Result.OK(sysUserAgent);
|
||||
}
|
||||
@@ -200,12 +203,12 @@ public class SysUserAgentController {
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<SysUserAgent> pageList = sysUserAgentService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "用户代理人设置列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysUserAgent.class);
|
||||
mv.addObject(JeroController.FILE_NAME, "用户代理人设置列表");
|
||||
mv.addObject(JeroController.CLASS, SysUserAgent.class);
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
ExportParams exportParams = new ExportParams("用户代理人设置列表数据", "导出人:"+user.getRealname(), "导出信息");
|
||||
exportParams.setImageBasePath(upLoadPath);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
|
||||
mv.addObject(JeroController.PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
@@ -217,8 +220,9 @@ public class SysUserAgentController {
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
@PostMapping("/importExcel")
|
||||
public Result<T> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</span>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||
<a href='javascript:' @click="handleDetail(record)">详情</a>
|
||||
<a-divider type="vertical"/>
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多<a-icon type="down"/></a>
|
||||
|
||||
@@ -169,16 +169,16 @@ export default {
|
||||
align: 'center',
|
||||
dataIndex: 'templateType',
|
||||
customRender: function (text) {
|
||||
if (text == '1') {
|
||||
if ((text + '') === '1') {
|
||||
return '短信'
|
||||
}
|
||||
if (text == '2') {
|
||||
if ((text + '') === '2') {
|
||||
return '邮件'
|
||||
}
|
||||
if (text == '3') {
|
||||
if ((text + '') === '3') {
|
||||
return '微信'
|
||||
}
|
||||
if (text == '4') {
|
||||
if ((text + '') === '4') {
|
||||
return '系统'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ export default {
|
||||
if (!err) {
|
||||
that.confirmLoading = true
|
||||
let httpurl = ''
|
||||
let method = ''
|
||||
let method
|
||||
if (!this.model.id) {
|
||||
httpurl += this.url.add
|
||||
method = 'post'
|
||||
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
edit (record) {
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.useEditor = (record.templateType == 2 || record.templateType == 4)
|
||||
this.useEditor = ((record.templateType + '') === '2' || (record.templateType + '') === '4')
|
||||
if (this.useEditor) {
|
||||
this.templateEditorContent = record.templateContent
|
||||
} else {
|
||||
@@ -159,7 +159,7 @@ export default {
|
||||
if (!err) {
|
||||
that.confirmLoading = true
|
||||
let httpurl = ''
|
||||
let method = ''
|
||||
let method
|
||||
if (!this.model.id) {
|
||||
httpurl += this.url.add
|
||||
method = 'post'
|
||||
@@ -189,7 +189,7 @@ export default {
|
||||
})
|
||||
},
|
||||
validateTemplateCode (rule, value, callback) {
|
||||
var params = {
|
||||
const params = {
|
||||
tableName: 'sys_sms_template',
|
||||
fieldName: 'template_code',
|
||||
fieldVal: value,
|
||||
@@ -208,7 +208,7 @@ export default {
|
||||
},
|
||||
handleChangeTemplateType (value) {
|
||||
// 如果是邮件类型那么则改变模板内容是富文本编辑器
|
||||
this.useEditor = (value == 2 || value == 4)
|
||||
this.useEditor = ((value + '') === '2' || (value + '') === '4')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
created () {
|
||||
getAction(this.url.queryDiskInfo).then((res) => {
|
||||
if (res.success) {
|
||||
for (var i = 0; i < res.result.length; i++) {
|
||||
for (let i = 0; i < res.result.length; i++) {
|
||||
res.result[i].restPPT = res.result[i].restPPT / 10
|
||||
}
|
||||
this.diskInfo = res.result
|
||||
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
beforeUpload (file) {
|
||||
var fileType = file.type
|
||||
const fileType = file.type
|
||||
if (fileType === 'image') {
|
||||
if (fileType.indexOf('image') < 0) {
|
||||
this.$message.warning('请上传图片')
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
}
|
||||
},
|
||||
ossDelete (id) {
|
||||
var that = this
|
||||
const that = this
|
||||
that.$confirm({
|
||||
title: '确认删除',
|
||||
content: '是否删除选中文件?',
|
||||
@@ -168,7 +168,7 @@ export default {
|
||||
},
|
||||
handlePreview (record) {
|
||||
if (record && record.url) {
|
||||
var fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/download/${record.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.fileName}`
|
||||
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/download/${record.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.fileName}`
|
||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||
window.open(url)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user