修复修改公告的BUG以及工作台公告展示的BUG

lihaobo
yeqifu 5 years ago
parent 447c8d559f
commit d09b6a12f5

@ -136,7 +136,7 @@
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!--hutool-->
<!--huTool-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
@ -153,13 +153,27 @@
<artifactId>pinyin4j</artifactId>
<version>${pinyin4j.version}</version>
</dependency>
<!-- fastjson -->
<!-- fastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<!-- swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
<build>

@ -10,6 +10,9 @@ import org.springframework.util.unit.DataSize;
import javax.servlet.MultipartConfigElement;
/**
* @author luoyi-
*/
@Configuration
@SpringBootApplication
@MapperScan(basePackages = {"com.yeqifu.*.mapper"})
@ -33,5 +36,4 @@ public class WarehouseApplication {
return factory.createMultipartConfig();
}
}

@ -113,7 +113,6 @@ public class BusinessCacheAspect {
*/
@Around(value = POINTCUT_CUSTOMER_DELETE)
public Object cacheCustomerDelete(ProceedingJoinPoint joinPoint) throws Throwable {
//取出第一个参数
Integer id = (Integer) joinPoint.getArgs()[0];
Boolean isSuccess = (Boolean) joinPoint.proceed();
@ -223,7 +222,6 @@ public class BusinessCacheAspect {
*/
@Around(value = POINTCUT_GOODS_DELETE)
public Object cacheGoodsDelete(ProceedingJoinPoint joinPoint) throws Throwable {
//取出第一个参数
Integer id = (Integer) joinPoint.getArgs()[0];
Boolean isSuccess = (Boolean) joinPoint.proceed();

@ -10,9 +10,13 @@ import com.yeqifu.bus.vo.CustomerVo;
import com.yeqifu.sys.common.Constast;
import com.yeqifu.sys.common.DataGridView;
import com.yeqifu.sys.common.ResultObj;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@ -87,7 +91,9 @@ public class CustomerController {
* @param id ID
* @return
*/
@RequestMapping("deleteCustomer")
@ApiOperation(value = "删除一个客户",notes = "删除一个客户")
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "客户ID",required = true,paramType = "query",dataType = "Integer")})
@RequestMapping(value = "deleteCustomer",method = RequestMethod.DELETE)
public ResultObj deleteCustomer(Integer id){
try {
customerService.deleteCustomerById(id);

@ -64,17 +64,21 @@ public class SalesController {
for (Sales sales : records) {
//设置客户姓名
Customer customer = customerService.getById(sales.getCustomerid());
sales.setCustomername(customer.getCustomername());
if(null!=customer){
sales.setCustomername(customer.getCustomername());
}
//设置商品名称
Goods goods = goodsService.getById(sales.getGoodsid());
sales.setGoodsname(goods.getGoodsname());
//设置商品规格
sales.setSize(goods.getSize());
if (null!=goods){
//设置商品名称
sales.setGoodsname(goods.getGoodsname());
//设置商品规格
sales.setSize(goods.getSize());
}
}
return new DataGridView(page1.getTotal(),page1.getRecords());
}
/**
*
* @param salesVo
@ -91,7 +95,7 @@ public class SalesController {
salesVo.setSalestime(new Date());
salesService.save(salesVo);
return ResultObj.ADD_SUCCESS;
} catch (Exception e) {
}catch (Exception e) {
e.printStackTrace();
return ResultObj.ADD_ERROR;
}
@ -111,7 +115,6 @@ public class SalesController {
e.printStackTrace();
return ResultObj.UPDATE_ERROR;
}
}
/**

@ -32,7 +32,6 @@ public class CacheAspect {
*/
private Map<String,Object> CACHE_CONTAINER = CachePool.CACHE_CONTAINER;
/**
*
*/

@ -1,8 +1,9 @@
package com.yeqifu.sys.config;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.Filter;
import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
import com.yeqifu.sys.common.Constast;
import com.yeqifu.sys.realm.UserRealm;
import lombok.Data;
import org.apache.shiro.authc.credential.CredentialsMatcher;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.apache.shiro.mgt.SecurityManager;
@ -19,10 +20,9 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.DelegatingFilterProxy;
import com.yeqifu.sys.realm.UserRealm;
import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
import lombok.Data;
import javax.servlet.Filter;
import java.util.HashMap;
import java.util.Map;
/**
* @Author: -
@ -37,11 +37,17 @@ public class ShiroAutoConfiguration {
private static final String SHIRO_DIALECT = "shiroDialect";
private static final String SHIRO_FILTER = "shiroFilter";
// 加密方式
/**
*
*/
private String hashAlgorithmName = "md5";
// 散列次数
private int hashIterations = 2;
// 默认的登陆页面
/**
*
*/
private int hashIterations = Constast.HASHITERATIONS;
/**
*
*/
private String loginUrl = "/index.html";
private String[] anonUrls;

@ -0,0 +1,44 @@
package com.yeqifu.sys.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @Author: -
* @Date: 2020/3/8 17:30
*/
@Configuration
@EnableSwagger2 //启用Swagger2
public class Swagger2AutoConfiguration {
/**
* IOCControllerSwagger
* @return
*/
@Bean
public Docket swaggerSpringMvcPlugin(){
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)).build();
}
private ApiInfo apiInfo(){
return new ApiInfoBuilder().description("仓库后台管理系统SwaggerUI接口工具")
//名片
.contact(new Contact("luoyi-","http://39.97.277.129","1784525940@qq.com"))
//版本
.version("1.0")
//所有者
.license("luoyi-工作室")
//构造
.build();
}
}

@ -4,7 +4,10 @@ import com.yeqifu.sys.cache.CachePool;
import com.yeqifu.sys.common.CacheBean;
import com.yeqifu.sys.common.DataGridView;
import com.yeqifu.sys.common.ResultObj;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
@ -17,6 +20,7 @@ import java.util.Set;
* @Author: -
* @Date: 2019/12/20 18:36
*/
@Api(description = "缓存管理")
@RestController
@RequestMapping("cache")
public class CacheController {
@ -27,7 +31,8 @@ public class CacheController {
*
* @return
*/
@RequestMapping("loadAllCache")
@ApiOperation(value = "查询所有缓存",notes = "查询所有缓存")
@RequestMapping(value = "loadAllCache",method = RequestMethod.GET)
public DataGridView loadAllCache(){
List<CacheBean> list = new ArrayList<>();

@ -1,11 +1,9 @@
package com.yeqifu.sys.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.org.apache.regexp.internal.RE;
import com.yeqifu.sys.common.DataGridView;
import com.yeqifu.sys.common.ResultObj;
import com.yeqifu.sys.common.TreeNode;
@ -15,7 +13,6 @@ import com.yeqifu.sys.vo.DeptVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
@ -43,6 +40,8 @@ public class DeptController {
@RequestMapping("loadDeptManagerLeftTreeJson")
public DataGridView loadManagerLeftTreeJson(DeptVo deptVo){
//查询出所有的部门存放进list中
// QueryWrapper<Dept> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq('1');
List<Dept> list = deptService.list();
List<TreeNode> treeNodes = new ArrayList<>();

@ -46,4 +46,6 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
public boolean save(Dept entity) {
return super.save(entity);
}
}

@ -1 +1,2 @@
filepath=G:/upload/
filepath=G:/upload/
#filepath=/root/project/G:/upload/

@ -16,6 +16,12 @@
<link rel="stylesheet" th:href="@{/resources/css/public.css}" media="all"/>
<link rel="stylesheet" th:href="@{/resources/layui_ext/dtree/dtree.css}" media="all"/>
<link rel="stylesheet" th:href="@{/resources/layui_ext/dtree/font/dtreefont.css}" media="all"/>
<style>
.disabled {
pointer-events:none; //使其不可点击
opacity:0.6; //使其样式变为不可用
}
</style>
</head>
<body>
<!---->
@ -79,7 +85,7 @@
<form action="" method="post" class="layui-form" id="dataFrm" lay-filter="dataFrm">
<div class="layui-form-item">
<label class="layui-form-label"></label>
<div class="layui-input-block">
<div class="layui-input-block" id="parentDept">
<input type="hidden" name="pid" id="pid" lay-verify="required">
<ul id="deptTree" class="dtree" data-id="0"></ul>
</div>
@ -266,10 +272,15 @@
success:function () {
//清空原有的数据
$("#dataFrm")[0].reset();
$("#parentDept").removeClass("disabled");
//装载新的数据
form.val("dataFrm",data);
//选中之前的父级部门 nodeId=data.pid
dtree.dataInit("deptTree",data.pid);
if (data.pid!=0){
dtree.dataInit("deptTree",data.pid);
}else {
$("#parentDept").addClass("disabled");
}
dtree.selectVal("deptTree");
url="/dept/updateDept";
}

@ -105,11 +105,21 @@
$.get("/notice/loadAllNotice?page=1&limit=5",function(data){
var hotNewsHtml = '';
if(data.count>0){
for(var i=0;i<5;i++){
hotNewsHtml += '<tr ondblclick="viewNews('+data.data[i].id+')">'
+'<td align="left"><a href="javascript:;"> '+data.data[i].title+'</a></td>'
+'<td>'+data.data[i].createtime.substring(0,10)+'</td>'
+'</tr>';
if(data.count<=5){
for(var i=0;i<data.count;i++){
hotNewsHtml += '<tr ondblclick="viewNews('+data.data[i].id+')">'
+'<td align="left"><a href="javascript:;"> '+data.data[i].title+'</a></td>'
+'<td>'+data.data[i].createtime.substring(0,10)+'</td>'
+'</tr>';
}
}
if (data.count>5){
for(var i=0;i<5;i++){
hotNewsHtml += '<tr ondblclick="viewNews('+data.data[i].id+')">'
+'<td align="left"><a href="javascript:;"> '+data.data[i].title+'</a></td>'
+'<td>'+data.data[i].createtime.substring(0,10)+'</td>'
+'</tr>';
}
}
}else {
hotNewsHtml+='<h3 style="text-align: center"></h3>';

@ -105,11 +105,11 @@
</div>
<div class="layui-form-item">
<div class="layui-input-block" style="text-align: center;padding-right: 7%">
<button type="button" class="layui-btn layui-btn-radius" lay-submit="" id="doSubmit"><i
class="layui-icon layui-icon-search layui-icon-normal"></i>
<button type="button" class="layui-btn layui-btn-radius" lay-submit="" id="doSubmit">
<i class="layui-icon layui-icon-search layui-icon-normal"></i>
</button>
<button type="reset" class="layui-btn layui-btn-radius layui-btn-warm"><i
class="layui-icon layui-icon-refresh"></i><span></span>
<button type="reset" class="layui-btn layui-btn-radius layui-btn-warm">
<i class="layui-icon layui-icon-refresh"></i><span></span>
</button>
</div>
</div>
@ -164,32 +164,13 @@
{fixed: 'right', title: '', toolbar: '#noticeRowBar', align: 'center'}
] ],
done:function (data, curr, count) {
/*if(data.count==0&&data.data.length==0){
tableIns.reload({
page:{
curr:1
}
})
}else*/
/* console.log(data);
console.log(curr); //1
console.log(count); //0*/
if(data.data.length==0&&curr!=1){ //不是第一页时如果当前返回的数据为0那么就返回上一页
tableIns.reload({
page:{
curr:curr-1
}
});
}/*else if (data.data.length==0 && curr==1){ //当前是第一页时如果当前返回的数据为0并且当前为第一页 给一个空的查询条件并给curr赋初值为1
tableIns.reload({
where: "",
page:{
curr:1
}
});
}*/
}
}
});
@ -212,10 +193,10 @@
switch (obj.event) {
case 'batchDelete':
batchDelete();
break;
break;
case 'add':
openAddLayer();
break;
break;
};
});
@ -226,65 +207,16 @@
switch (obj.event){
case 'delete':
deleteInfo(data);
break;
break;
case 'update':
updateNotice(data);
break;
break;
case 'show':
showNotice(data);
break;
break;
};
});
//删除
function deleteInfo(data) {
layer.confirm(''+data.title+'',{icon: 3,title:''},function (index) {
$.post("/notice/deleteNotice",{id:data.id},function (res) {
if (res.code==200){
tableIns.reload({
//删除成功加载表格时,要重置查询条件
where:"",
});
}
layer.msg(res.msg);
});
layer.close(index);
});
}
//批量删除
function batchDelete() {
//得到选中行
var checkStatus = table.checkStatus('noticeTable');
var dataLength = checkStatus.data.length;
if (dataLength>0){
layer.confirm('',{icon: 3,title: ''},function (index) {
//获取选中行数据
var data = checkStatus.data;
var ids = "";
$.each(data,function (index, item) {
if (index==0){
ids+="ids="+item.id;
}else {
ids+="&ids="+item.id;
}
});
$.post("/notice/batchDeleteNotice",ids,function (res) {
if (res.code==200){
//重新刷新表格
tableIns.reload({
where:"",
});
}
layer.msg(res.msg);
});
layer.close(index);
});
}else {
layer.msg("请选中操作行")
}
}
var mainIndex;
var url;
@ -306,6 +238,7 @@
//打开修改的弹出层
function updateNotice(data) {
//console.log(data);
mainIndex = layer.open({
type:1,
content:$("#addOrUpdateDiv"),
@ -316,12 +249,13 @@
//装载新的数据
form.val("dataFrm",data);
layedit.setContent(editIndex,data.content);
url:"/notice/updateNotice";
url="/notice/updateNotice";
}
});
};
$("#doSubmit").click(function () {
//alert(url);
//同步富文本和textarea里面的内容
layedit.sync(editIndex);
var data = $("#dataFrm").serialize();
@ -351,6 +285,54 @@
});
}
//删除
function deleteInfo(data) {
layer.confirm(''+data.title+'',{icon: 3,title:''},function (index) {
$.post("/notice/deleteNotice",{id:data.id},function (res) {
if (res.code==200){
tableIns.reload({
//删除成功加载表格时,要重置查询条件
where:"",
});
}
layer.msg(res.msg);
});
layer.close(index);
});
}
//批量删除
function batchDelete() {
//得到选中行
var checkStatus = table.checkStatus('noticeTable');
var dataLength = checkStatus.data.length;
if (dataLength>0){
layer.confirm('',{icon: 3,title: ''},function (index) {
//获取选中行数据
var data = checkStatus.data;
var ids = "";
$.each(data,function (index, item) {
if (index==0){
ids+="ids="+item.id;
}else {
ids+="&ids="+item.id;
}
});
$.post("/notice/batchDeleteNotice",ids,function (res) {
if (res.code==200){
//重新刷新表格
tableIns.reload({
where:"",
});
}
layer.msg(res.msg);
});
layer.close(index);
});
}else {
layer.msg("请选中操作行")
}
}
});

Loading…
Cancel
Save