Commit d5b7c93d by yangyang

代码同步(重庆)

parent d5739485
...@@ -2,6 +2,7 @@ package com.founder.commonutils.model.newPublicEntity; ...@@ -2,6 +2,7 @@ package com.founder.commonutils.model.newPublicEntity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data; import lombok.Data;
...@@ -59,7 +60,12 @@ public class SkServiceApply extends Model<SkServiceApply> { ...@@ -59,7 +60,12 @@ public class SkServiceApply extends Model<SkServiceApply> {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date sqsj; private Date sqsj;
/** /**
* 授权时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date ssqsj;
/**
* 1代表授权,0代表撤销 * 1代表授权,0代表撤销
*/ */
private String status; private String status;
} }
package com.founder.commonutils.model.newPublicEntity.cqEntity;
import lombok.Data;
import java.util.List;
/**
* @author yangyang
* @description 可视化表格实体
*/
@Data
public class KsjTableResult {
private String count;// rows数量
private List<Rows> rows;// 内容
@Data
public static class Rows {
private String tabsName;// tab的名字
private String url;// 接口路径
private List<Title> title;// 表头
@Data
public static class Title {
private String prop;// 标签(对应数据库字段)
private String label;// 标签(对应的字段注释)
private boolean search;// True/false true得即为查询条件
private String type;// 日期为date 其他的都为text类型
}
}
}
package com.founder.commonutils.model.newPublicEntity.cqEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* </p>
* @author yangyang
* @since 2022/12/08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ksh_table")
@ApiModel(value = "kshTable对象", description = "新可视化表格对接")
public class kshTable implements Serializable {
@ApiModelProperty(value = "信息主键编号")
@TableId(type = IdType.INPUT)
private String xxzjbh;
@ApiModelProperty(value = "表头")
private String prop;
@ApiModelProperty(value = "表头描述")
private String label;
@ApiModelProperty(value = "是否为展示查询条件,0是,1否")
private String issearch;
@ApiModelProperty(value = "是否为展示表头,0是,1否")
private String ishead;
@ApiModelProperty(value = "日期为date 其他的都为text类型")
private String type;
@ApiModelProperty(value = "来源")
private String ly;
@ApiModelProperty(value = "接口url")
private String url;
@ApiModelProperty(value = "创建时间")
private String cjsj;
@ApiModelProperty(value = "更新时间")
private String gxsj;
@ApiModelProperty(value = "删除标志")
private String isdeleted;
}
...@@ -26,6 +26,10 @@ public class SkServiceApplyParam { ...@@ -26,6 +26,10 @@ public class SkServiceApplyParam {
*/ */
private String applyurl; private String applyurl;
/** /**
* status 1已授权 2撤销 0是未授权
*/
private String status;
/**
* 行数 * 行数
*/ */
private Integer page; private Integer page;
......
...@@ -18,6 +18,14 @@ public class SkServiceParam { ...@@ -18,6 +18,14 @@ public class SkServiceParam {
*/ */
private String name; private String name;
/** /**
* 服务类型
*/
private String servicetypename;
/**
* 服务来源
*/
private String fwly;
/**
* 行数 * 行数
*/ */
private Integer page; private Integer page;
......
...@@ -58,6 +58,10 @@ public class SkServiceApplyVO { ...@@ -58,6 +58,10 @@ public class SkServiceApplyVO {
* 授权时间 * 授权时间
*/ */
private String ssqsj; private String ssqsj;
/**
* 授权状态 1已授权 2撤销 0是未授权
*/
private String status;
public SkServiceApplyVO(){} public SkServiceApplyVO(){}
public SkServiceApplyVO(SkServiceApply skServiceApply, String name,String ms){ public SkServiceApplyVO(SkServiceApply skServiceApply, String name,String ms){
......
...@@ -176,5 +176,13 @@ public class DateUtil { ...@@ -176,5 +176,13 @@ public class DateUtil {
} }
return result; return result;
} }
/** 十位时间戳转化成时间
* */
public static String getTimestampToTime(String timestamp){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = sdf.format(new Date(Long.valueOf(timestamp + "000")));
return format;
}
} }
...@@ -15,7 +15,6 @@ import com.founder.commonutils.model.vo.response.SkServiceApplyVO; ...@@ -15,7 +15,6 @@ import com.founder.commonutils.model.vo.response.SkServiceApplyVO;
import com.founder.commonutils.util.ExportExcelUtil; import com.founder.commonutils.util.ExportExcelUtil;
import com.founder.commonutils.util.JwtUser; import com.founder.commonutils.util.JwtUser;
import com.founder.commonutils.util.KeyUtil; import com.founder.commonutils.util.KeyUtil;
import com.founder.commonutils.util.NetworkUtil;
import com.founder.servicebase.logs.OperLog; import com.founder.servicebase.logs.OperLog;
import com.founder.servicebase.logs.OperationType; import com.founder.servicebase.logs.OperationType;
import com.founder.servicebase.service.SkServiceApplyService; import com.founder.servicebase.service.SkServiceApplyService;
...@@ -33,6 +32,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -33,6 +32,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -66,8 +66,10 @@ public class SkServiceApplyController extends ApiController { ...@@ -66,8 +66,10 @@ public class SkServiceApplyController extends ApiController {
@OperLog(message = "新增服务授权信息", operation = OperationType.ADD) @OperLog(message = "新增服务授权信息", operation = OperationType.ADD)
public MapRestResult save(SkServiceApply skService) throws IOException { public MapRestResult save(SkServiceApply skService) throws IOException {
skService.setXxzjbh(KeyUtil.getUUIDKey("SQ")); skService.setXxzjbh(KeyUtil.getUUIDKey("SQ"));
//时间不能为空 这块前端做校验去了
skService.setSqsj(new Date()); skService.setSqsj(new Date());
//时间不能为空 这块前端做校验去了
skService.setSsqsj(new Date());
skService.setStatus("0");
boolean save = skServiceApplyService.save(skService); boolean save = skServiceApplyService.save(skService);
if (save) { if (save) {
return new MapRestResult(); return new MapRestResult();
...@@ -98,8 +100,8 @@ public class SkServiceApplyController extends ApiController { ...@@ -98,8 +100,8 @@ public class SkServiceApplyController extends ApiController {
public MapRestResult apply(SkServiceApply skServiceApply, String servicename) throws Exception { public MapRestResult apply(SkServiceApply skServiceApply, String servicename) throws Exception {
UpdateWrapper updateWrapper = new UpdateWrapper(); UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.eq("xxzjbh", skServiceApply.getXxzjbh()); updateWrapper.eq("xxzjbh", skServiceApply.getXxzjbh());
String message=""; String message="";//status 1已授权 2撤销 0是未授权
if ("0".equals(skServiceApply.getStatus())) {//撤销 if ("2".equals(skServiceApply.getStatus())) {//撤销
updateWrapper.set("token", null); updateWrapper.set("token", null);
updateWrapper.set("ssqsj", null); updateWrapper.set("ssqsj", null);
message="撤销成功"; message="撤销成功";
...@@ -235,7 +237,10 @@ public class SkServiceApplyController extends ApiController { ...@@ -235,7 +237,10 @@ public class SkServiceApplyController extends ApiController {
return new MapRestResult(201, "error", 1, "token获取失败!"); return new MapRestResult(201, "error", 1, "token获取失败!");
} }
} }
return new MapRestResult(200, "OK", 1, token); Map mapResult = new HashMap();
mapResult.put("token",token);
mapResult.put("expire","86400");
return new MapRestResult(200, "OK", 1, mapResult);
} }
} }
...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.api.ApiController; ...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.founder.commonutils.model.newPublicEntity.MapRestResult; import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.commonutils.model.newPublicEntity.SkService; import com.founder.commonutils.model.newPublicEntity.SkService;
import com.founder.commonutils.model.newPublicEntity.SkTrail;
import com.founder.commonutils.model.newPublicEntity.hnkshEntity.HnTbStRygx;
import com.founder.commonutils.model.vo.param.SkServiceParam; import com.founder.commonutils.model.vo.param.SkServiceParam;
import com.founder.commonutils.util.ExcelUtil; import com.founder.commonutils.util.ExcelUtil;
import com.founder.commonutils.util.ExportExcelUtil; import com.founder.commonutils.util.ExportExcelUtil;
...@@ -57,7 +59,7 @@ public class SkServiceController extends ApiController { ...@@ -57,7 +59,7 @@ public class SkServiceController extends ApiController {
public MapRestResult save(SkService skService) throws IOException { public MapRestResult save(SkService skService) throws IOException {
skService.setXxzjbh(KeyUtil.getUUIDKey("FW")); skService.setXxzjbh(KeyUtil.getUUIDKey("FW"));
skService.setCjsj(new Date()); skService.setCjsj(new Date());
skService.setServicetypename(skDictionaryService.findDmmcByDmAndDmlx(skService.getServicetype(),"ZF")); // skService.setServicetypename(skDictionaryService.findDmmcByDmAndDmlx(skService.getServicetype(),"ZF"));
boolean save = skServiceService.save(skService); boolean save = skServiceService.save(skService);
if (save) { if (save) {
...@@ -75,14 +77,25 @@ public class SkServiceController extends ApiController { ...@@ -75,14 +77,25 @@ public class SkServiceController extends ApiController {
@ApiOperation(value = "excel新增服务信息") @ApiOperation(value = "excel新增服务信息")
@OperLog(message = "excel新增服务信息", operation = OperationType.ADD) @OperLog(message = "excel新增服务信息", operation = OperationType.ADD)
public MapRestResult excelsave( MultipartFile file) { public MapRestResult excelsave( MultipartFile file) {
List<SkService> list = readExcel(file); if (file != null) {
for (SkService sk : list) { List<SkService> list = readExcel(file);
sk.setXxzjbh(KeyUtil.getUUIDKey("FW")); for (SkService sk : list) {
sk.setCjsj(new Date()); sk.setXxzjbh(KeyUtil.getUUIDKey("FW"));
sk.setServicetypename(skDictionaryService.findDmmcByDmAndDmlx(sk.getServicetype(),"ZF")); sk.setCjsj(new Date());
skServiceService.save(sk); if (sk.getServicetypename().equals("数据服务")){
sk.setServicetype("sjfw");
} else if (sk.getServicetypename().equals("接口服务")){
sk.setServicetype("jkfw");
} else if (sk.getServicetypename().equals("页面")){
sk.setServicetype("ymfw");
}
// sk.setServicetypename(skDictionaryService.findDmmcByDmAndDmlx(sk.getServicetype(),"ZF"));
skServiceService.save(sk);
}
return new MapRestResult();
}else {
return new MapRestResult(200,"请上传文件",null);
} }
return new MapRestResult();
} }
...@@ -97,9 +110,9 @@ public class SkServiceController extends ApiController { ...@@ -97,9 +110,9 @@ public class SkServiceController extends ApiController {
String postfix = filename.substring(filename.lastIndexOf(".") + 1); String postfix = filename.substring(filename.lastIndexOf(".") + 1);
//根据Excel文件后缀读取数据 //根据Excel文件后缀读取数据
if (postfix.equals("xls")) { if (postfix.equals("xls")) {
Map xlsExcelMap = ExcelUtil.readXLSExcel(file.getInputStream(), SkService.class, abandonFields); Map xlsExcelMap = ExcelUtil.readXLSXExcel(file.getInputStream(), SkService.class, abandonFields);
resultList = (List) xlsExcelMap.get("dataList"); resultList = (List) xlsExcelMap.get("dataList");
} else { } else if (postfix.equals("xlsx")){
Map xlsxExcelMap = ExcelUtil.readXLSXExcel(file.getInputStream(), SkService.class, abandonFields); Map xlsxExcelMap = ExcelUtil.readXLSXExcel(file.getInputStream(), SkService.class, abandonFields);
resultList = (List) xlsxExcelMap.get("dataList"); resultList = (List) xlsxExcelMap.get("dataList");
} }
...@@ -116,12 +129,12 @@ public class SkServiceController extends ApiController { ...@@ -116,12 +129,12 @@ public class SkServiceController extends ApiController {
@ApiOperation(value = "修改服务信息") @ApiOperation(value = "修改服务信息")
@OperLog(message = "修改服务信息", operation = OperationType.UPDATE) @OperLog(message = "修改服务信息", operation = OperationType.UPDATE)
public MapRestResult update(SkService skRegionalsResult)throws IOException { public MapRestResult update(SkService skRegionalsResult)throws IOException {
skRegionalsResult.setServicetypename(skDictionaryService.findDmmcByDmAndDmlx(skRegionalsResult.getServicetype(),"ZF")); // skRegionalsResult.setServicetypename(skDictionaryService.findDmmcByDmAndDmlx(skRegionalsResult.getServicetype(),"ZF"));
boolean update = skServiceService.updateById(skRegionalsResult); boolean update = skServiceService.updateById(skRegionalsResult);
if (update) { if (update) {
return new MapRestResult(); return new MapRestResult();
} else { } else {
return new MapRestResult().error("更新失败"); return new MapRestResult(200,"更新失败",null);
} }
} }
...@@ -140,7 +153,7 @@ public class SkServiceController extends ApiController { ...@@ -140,7 +153,7 @@ public class SkServiceController extends ApiController {
if (update) { if (update) {
return new MapRestResult(); return new MapRestResult();
} else { } else {
return new MapRestResult().error("更新失败"); return new MapRestResult(200,"更新失败",null);
} }
} }
...@@ -153,7 +166,7 @@ public class SkServiceController extends ApiController { ...@@ -153,7 +166,7 @@ public class SkServiceController extends ApiController {
public MapRestResult detail(String xxzjbh) { public MapRestResult detail(String xxzjbh) {
SkService byId = skServiceService.getById(xxzjbh); SkService byId = skServiceService.getById(xxzjbh);
if (byId == null) { if (byId == null) {
return new MapRestResult().error("不存在该数据"); return new MapRestResult(200,"不存在该数据",null);
} else { } else {
return new MapRestResult(byId); return new MapRestResult(byId);
} }
...@@ -178,6 +191,14 @@ public class SkServiceController extends ApiController { ...@@ -178,6 +191,14 @@ public class SkServiceController extends ApiController {
if (skRegionalsDetailParam.getDes()!=null&& !skRegionalsDetailParam.getDes().equals("")){ if (skRegionalsDetailParam.getDes()!=null&& !skRegionalsDetailParam.getDes().equals("")){
queryWrapper.like("serviceMs",skRegionalsDetailParam.getDes()); queryWrapper.like("serviceMs",skRegionalsDetailParam.getDes());
} }
//服务来源
if (skRegionalsDetailParam.getFwly()!=null&& !skRegionalsDetailParam.getFwly().equals("")){
queryWrapper.like("fwly",skRegionalsDetailParam.getFwly());
}
//服务类型
if (skRegionalsDetailParam.getServicetypename()!=null&& !skRegionalsDetailParam.getServicetypename().equals("")){
queryWrapper.eq("serviceTypeName",skRegionalsDetailParam.getServicetypename());
}
queryWrapper.eq("isDeleted", "0"); queryWrapper.eq("isDeleted", "0");
queryWrapper.orderByDesc("cjsj"); queryWrapper.orderByDesc("cjsj");
...@@ -188,6 +209,7 @@ public class SkServiceController extends ApiController { ...@@ -188,6 +209,7 @@ public class SkServiceController extends ApiController {
} }
/** /**
* 服务列表信息导出 * 服务列表信息导出
*/ */
...@@ -216,5 +238,6 @@ public class SkServiceController extends ApiController { ...@@ -216,5 +238,6 @@ public class SkServiceController extends ApiController {
} }
} }
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
<if test="applyurl!= null and applyurl!=''"> <if test="applyurl!= null and applyurl!=''">
AND a.applyUrl like "%"#{ applyurl , jdbcType=VARCHAR }"%" AND a.applyUrl like "%"#{ applyurl , jdbcType=VARCHAR }"%"
</if> </if>
<if test="status!= null and status!=''">
AND a.status = #{ status , jdbcType=VARCHAR }
</if>
order by a.sqsj desc order by a.sqsj desc
limit #{page},#{pageSize} limit #{page},#{pageSize}
</select> </select>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.founder.publicapi.mapper.mysqlMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.model.newPublicEntity.cqEntity.kshTable;
import org.springframework.stereotype.Component;
@Component
public interface KshTableMapper extends BaseMapper<kshTable> {
}
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