Commit 9bc1a91f by 宋珺琪

服务管理列表排序、时空桌面bug、添加统计第三方接口(西藏)

parent 5aa3071c
......@@ -66,6 +66,9 @@ public class SkMenu {
@TableField("isFixedMenu")
private String isFixedMenu;
@ApiModelProperty(value = "菜单")
@TableField("menuTop")
private String menuTop;
}
......
......@@ -7,10 +7,13 @@ import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.commonutils.util.DateUtil;
import com.founder.commonutils.util.StringUtil;
import com.founder.servicebase.logs.LogMoudleCount;
import com.founder.servicebase.logs.OperLog;
import com.founder.servicebase.logs.OperationType;
import com.founder.servicebase.logs.SkSysLog;
import com.founder.servicebase.logs.param.LogCountParam;
import com.founder.servicebase.logs.param.LogParam;
import com.founder.servicebase.logs.service.SkSysLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -96,4 +99,13 @@ public class SkSysLogController {
return new MapRestResult(200,"ok",logMoudleCounts.size(),logMoudleCounts);
}
@ApiOperation(value = "只统计含第三方的userid")
@OperLog(message = "只统计含第三方的userid", operation = OperationType.QUERY)
@PostMapping("countThreeUserId")
public MapRestResult countThreeUserId(@RequestBody LogCountParam param) throws ParseException {
List<LogMoudleCount> logMoudleCounts = service.countThreeUserId(param);
return new MapRestResult(200,"ok",logMoudleCounts.size(),logMoudleCounts);
}
}
......@@ -39,6 +39,7 @@
<if test="applyurl!= null and applyurl!=''">
AND a.applyUrl like "%"#{ applyurl , jdbcType=VARCHAR }"%"
</if>
order by a.sqsj desc
limit #{page},#{pageSize}
</select>
</mapper>
......@@ -20,4 +20,7 @@ public interface SkSysLogMapper extends BaseMapper<SkSysLog> {
LogCount countOne(@Param("date") String date);
List<LogMoudleCount> countMoudle(LogCountParam param);
List<LogMoudleCount> countThreeUserId(LogCountParam param);
}
......@@ -40,6 +40,18 @@
message is not NULL group by SUBSTRING_INDEX(message,'_',1)
</select>
<select id="countThreeUserId" resultType="com.founder.servicebase.logs.LogMoudleCount" parameterType="com.founder.servicebase.logs.param.LogCountParam">
select COUNT(*) as count,userId as moudle from sk_sys_log
where userId like '%第三方%'
<if test="startTime!=null and startTime!='' ">
and str_to_date(#{startTime},'%Y-%m-%d') <![CDATA[ <= ]]> date_format(createDate,'%Y-%m-%d')
</if>
<if test="endTime!=null and endTime!='' ">
and str_to_date(#{endTime},'%Y-%m-%d') <![CDATA[ >= ]]> date_format(createDate,'%Y-%m-%d')
</if>
and
userId is not NULL group BY userId
</select>
</mapper>
......@@ -14,4 +14,7 @@ public interface SkSysLogService extends IService<SkSysLog> {
List<LogCount> countTotal(LogCountParam param) throws ParseException;
List<LogMoudleCount> countMoudle(LogCountParam param);
List<LogMoudleCount> countThreeUserId(LogCountParam param) throws ParseException;
}
......@@ -44,6 +44,10 @@ public class SkSysLogServiceImpl extends ServiceImpl<SkSysLogMapper, SkSysLog> i
return baseMapper.countMoudle(param);
}
@Override
public List<LogMoudleCount> countThreeUserId(LogCountParam param) throws ParseException {
return baseMapper.countThreeUserId(param);
}
/**
* 计算两个日期得时间差
......
......@@ -14,9 +14,9 @@ import com.founder.servicebase.logs.OperationType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -41,15 +41,21 @@ public class SkypDesktopController {
@PostMapping("menuAdd")
@ApiOperation(value = "时空桌面菜单新增")
@OperLog(message = "时空桌面菜单新增", operation = OperationType.ADD)
public MapRestResult menuAdd(SkMenu skMenu , MultipartFile photoFile ) throws IOException {
public MapRestResult menuAdd( SkMenu skMenu , MultipartFile[] photoFile ) throws IOException {
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq(!StringUtil.isEmpty(skMenu.getMenu()),"menu", skMenu.getMenu());
wrapper.eq("isDeleted","0");
Integer count = skMenuMapper.selectCount(wrapper);
if (count!=0){
return new MapRestResult(200,"已经存在该菜单名称",null);
}else {
if(photoFile==null){
return new MapRestResult(200,"请上传菜单图片",null);
}
skMenu.setState("1");// 桌面
skMenu.setPhoto("data:image/jpg;base64,"+ Base64Util.getBase64(photoFile));
for (MultipartFile file : photoFile) {
skMenu.setPhoto("data:image/jpg;base64,"+Base64Util.getBase64(file));
}
skMenu.setDjsj(nowTime());
skMenu.setGxsj(nowTime());
String xxzjbh = KeyUtilNaotu.getJzKey("me");
......@@ -88,18 +94,18 @@ public class SkypDesktopController {
@PostMapping("menuUpdate")
@ApiOperation(value = "时空桌面菜单修改")
@OperLog(message = "时空桌面菜单修改", operation = OperationType.UPDATE)
public MapRestResult menuUpdate(SkMenu skMenu, @RequestParam(required = false) MultipartFile photoFile ) throws IOException {
public MapRestResult menuUpdate( SkMenu skMenu, @RequestParam(required = false) MultipartFile photoFile ) throws IOException {
if (photoFile!=null){
skMenu.setPhoto("data:image/jpg;base64,"+ Base64Util.getBase64(photoFile));
skMenu.setPhoto("data:image/jpg;base64,"+Base64Util.getBase64(photoFile));
}
skMenu.setGxsj(nowTime());
int i = skMenuMapper.updateById(skMenu);
if (i > 0 ){
return new MapRestResult();
return new MapRestResult(200,"修改成功",null);
}else {
return new MapRestResult().error();
return new MapRestResult(200,"不存在该菜单",null);
}
}
/**
......@@ -117,12 +123,12 @@ public class SkypDesktopController {
}
Map<Object, Object> map = new HashMap<>();
// 十个固定的
/* // 十个固定的
QueryWrapper wrapper2 = new QueryWrapper<>();
wrapper2.eq(!StringUtil.isEmpty(zjhm),"zjhm", zjhm);
wrapper2.eq("isDeleted","0");
wrapper2.eq("isFixedMenu","1");
List list2 = skMenuMapper.selectList(wrapper2);
List list2 = skMenuMapper.selectList(wrapper2);*/
// 新增的
QueryWrapper wrapper = new QueryWrapper<>();
......@@ -138,11 +144,11 @@ public class SkypDesktopController {
wrapper3.eq("state","2");
List list3 = skMenuMapper.selectList(wrapper3);*/
List<Object> collect = Stream.of(list2, list)
/* List<Object> collect = Stream.of(list2, list)
.flatMap(Collection::stream)
.distinct()
.collect(Collectors.toList());
map.put("桌面",collect);
.collect(Collectors.toList());*/
map.put("桌面",list);
//查询移入的
QueryWrapper wrapper1 = new QueryWrapper<>();
......@@ -275,6 +281,7 @@ public class SkypDesktopController {
wrapper.eq("state",state);
wrapper.eq("zjhm",zjhm);
wrapper.eq("isDeleted","0");
wrapper.orderByDesc("time");
List list = skScheduleMapper.selectList(wrapper);
return new MapRestResult(200,"ok",list.size(),list);
}
......
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