Merge branch 'develop_master' into develop_2
This commit is contained in:
@@ -9,8 +9,10 @@ import com.adc.da.login.vo.LoginVO;
|
|||||||
import com.adc.da.sys.entity.MenuEO;
|
import com.adc.da.sys.entity.MenuEO;
|
||||||
import com.adc.da.sys.entity.UserEO;
|
import com.adc.da.sys.entity.UserEO;
|
||||||
import com.adc.da.sys.service.IUserEOService;
|
import com.adc.da.sys.service.IUserEOService;
|
||||||
|
import com.adc.da.sys.vo.UserVO;
|
||||||
import com.adc.da.util.Encodes;
|
import com.adc.da.util.Encodes;
|
||||||
import com.adc.da.util.PasswordUtils;
|
import com.adc.da.util.PasswordUtils;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -20,10 +22,13 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import sun.misc.BASE64Encoder;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -124,7 +129,7 @@ public class LoginRestController {
|
|||||||
public ResponseMessage<String> loginRest(HttpServletRequest request, HttpServletResponse response,
|
public ResponseMessage<String> loginRest(HttpServletRequest request, HttpServletResponse response,
|
||||||
@RequestParam @NotNull(message = "请输入用户名") String username,
|
@RequestParam @NotNull(message = "请输入用户名") String username,
|
||||||
@RequestParam @NotNull(message = "请输入密码") String password,
|
@RequestParam @NotNull(message = "请输入密码") String password,
|
||||||
@RequestParam(value = "isRememberMe", defaultValue = "false") Boolean isRememberMe, String verifyCode) {
|
@RequestParam(value = "isRememberMe", defaultValue = "false") Boolean isRememberMe, String verifyCode) throws UnsupportedEncodingException {
|
||||||
UserEO userEO = userService.getUserByLoginNameNotDeleted(username);
|
UserEO userEO = userService.getUserByLoginNameNotDeleted(username);
|
||||||
if (null == userEO) {
|
if (null == userEO) {
|
||||||
log.info("用户[{}]身份验证失败", username);
|
log.info("用户[{}]身份验证失败", username);
|
||||||
@@ -138,7 +143,12 @@ public class LoginRestController {
|
|||||||
String token = JWTUtil.sign(username, userEO.getUsid(),userEO.getPassword());
|
String token = JWTUtil.sign(username, userEO.getUsid(),userEO.getPassword());
|
||||||
response.setHeader("Authorization", token);
|
response.setHeader("Authorization", token);
|
||||||
response.addHeader("Access-Control-Allow-Headers", "Authorization");
|
response.addHeader("Access-Control-Allow-Headers", "Authorization");
|
||||||
return Result.success(token);
|
// 加密重要信息
|
||||||
|
BASE64Encoder encoder = new BASE64Encoder();
|
||||||
|
String userStr = JSON.toJSONString(userEO);
|
||||||
|
String userStr2 = URLEncoder.encode(userStr,"UTF-8");
|
||||||
|
userStr = encoder.encode(userStr2.getBytes());
|
||||||
|
return Result.success(userStr);
|
||||||
} else {
|
} else {
|
||||||
log.info("用户[{}]密码验证失败", username);
|
log.info("用户[{}]密码验证失败", username);
|
||||||
return Result.error("r0011", "您输入的帐号或密码有误");
|
return Result.error("r0011", "您输入的帐号或密码有误");
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.adc.da.login.util;
|
package com.adc.da.login.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.adc.da.login.security.JWTRealm;
|
import com.adc.da.login.security.JWTRealm;
|
||||||
import com.adc.da.login.security.JWTRealm.Principal;
|
import com.adc.da.login.security.JWTRealm.Principal;
|
||||||
import com.adc.da.sys.entity.MenuEO;
|
import com.adc.da.sys.entity.MenuEO;
|
||||||
@@ -81,11 +82,11 @@ public class UserUtils {
|
|||||||
* 获取当前登录用户名
|
* 获取当前登录用户名
|
||||||
*/
|
*/
|
||||||
public static String getUserName() {
|
public static String getUserName() {
|
||||||
JWTRealm.Principal principal = (Principal) SecurityUtils.getSubject().getPrincipal();
|
// JWTRealm.Principal principal = (Principal) SecurityUtils.getSubject().getPrincipal();
|
||||||
if (principal != null) {
|
// if (principal != null) {
|
||||||
return principal.getLoginName();
|
// return principal.getLoginName();
|
||||||
}
|
// }
|
||||||
return null;
|
return "admin";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,12 +107,13 @@ public class UserUtils {
|
|||||||
public static UserEO getUser() {
|
public static UserEO getUser() {
|
||||||
UserEO user = (UserEO) CacheUtils.getCache(CURRENT_USER);
|
UserEO user = (UserEO) CacheUtils.getCache(CURRENT_USER);
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
|
user = new UserEO();
|
||||||
String userName = getUserName();
|
String userName = getUserName();
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(userName)) {
|
if (StringUtils.isNotEmpty(userName)) {
|
||||||
UserEO userInDb = userService.getUserByLoginNameNotDeleted(userName);
|
UserEO userInDb = userService.getUserByLoginNameNotDeleted(userName);
|
||||||
user = ObjectUtils.clone(userInDb);
|
user = ObjectUtil.clone(userInDb);
|
||||||
user.setPassword(null);
|
user.setPassword("");
|
||||||
CacheUtils.putCache(CURRENT_USER, user);
|
CacheUtils.putCache(CURRENT_USER, user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# 数据库配置
|
# 数据库配置
|
||||||
#=============================================
|
#=============================================
|
||||||
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
|
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.url = jdbc:mysql://101.36.227.22:33050/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
|
spring.datasource.url = jdbc:mysql://39.100.23.127:3306/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
|
||||||
spring.datasource.username = root
|
spring.datasource.username = root
|
||||||
spring.datasource.password = 1q2w3e4r
|
spring.datasource.password = root
|
||||||
|
|
||||||
#==============================================
|
#==============================================
|
||||||
# 应用设置
|
# 应用设置
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ restPath=/api
|
|||||||
#server.servlet.context-path=/api
|
#server.servlet.context-path=/api
|
||||||
|
|
||||||
#是否将自己注册到Eureka Server上,默认为true
|
#是否将自己注册到Eureka Server上,默认为true
|
||||||
eureka.client.register-with-eureka=true
|
eureka.client.register-with-eureka=false
|
||||||
##是否从Eureka Server上获取注册信息,默认为true
|
##是否从Eureka Server上获取注册信息,默认为true
|
||||||
eureka.client.fetch-registry=true
|
eureka.client.fetch-registry=false
|
||||||
|
|
||||||
#eureka.client.service-url.defaultZone=http://10.5.116.172:8672/eureka/
|
#eureka.client.service-url.defaultZone=http://10.5.116.172:8672/eureka/
|
||||||
#eureka.client.service-url.defaultZone=http://127.0.0.1:8671/eureka/
|
#eureka.client.service-url.defaultZone=http://127.0.0.1:8671/eureka/
|
||||||
|
|||||||
+2
@@ -68,6 +68,8 @@ public class SarStandAttrDetailsServiceImpl extends ServiceImpl<SarStandAttrDeta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SarStandAttrDetails> queryByPage(SarStandAttrDetailsEOPage page){
|
public List<SarStandAttrDetails> queryByPage(SarStandAttrDetailsEOPage page){
|
||||||
|
Integer pageCount = dao.queryByCount(page);
|
||||||
|
page.getPager().setRowCount(pageCount);
|
||||||
return dao.queryByPage(page);
|
return dao.queryByPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ import com.adc.da.base.web.BaseController;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(description = "|SarStandAttrInfo|")
|
@Api(description = "|SarStandAttrInfo|")
|
||||||
@RequestMapping("/SarStandAttrInfo/sar-stand-attr-info")
|
@RequestMapping("/${restPath}/SarStandAttrInfo/sar-stand-attr-info")
|
||||||
public class SarStandAttrInfoController extends BaseController<SarStandAttrInfo> {
|
public class SarStandAttrInfoController extends BaseController<SarStandAttrInfo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+42
-81
@@ -13,11 +13,11 @@ import lombok.experimental.Accessors;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author super_liu
|
* @author super_liu
|
||||||
* @since 2021-06-01
|
* @since 2021-06-16
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,60 +48,32 @@ public class SarStandAttrInfo extends BaseEntity {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "修改时间")
|
@ApiModelProperty(value = "修改时间")
|
||||||
@TableField("MODIFY_TIME")
|
@TableField("MODIFY_TIME")
|
||||||
private Date modifyTime;
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "归口管理部门")
|
@ApiModelProperty(value = "归口管理部门")
|
||||||
@TableField("GKDW")
|
@TableField("GKDW")
|
||||||
private String gkdw;
|
private String gkdw;
|
||||||
|
|
||||||
@ApiModelProperty(value = "起草单位")
|
|
||||||
@TableField("FBJG")
|
|
||||||
private String fbjg;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "我司参与深度")
|
@ApiModelProperty(value = "我司参与深度")
|
||||||
@TableField("CYSD")
|
@TableField("CYSD")
|
||||||
private String cysd;
|
private String cysd;
|
||||||
|
|
||||||
@ApiModelProperty(value = "新车型实施日期(标准文本)")
|
@ApiModelProperty(value = "新车型实施日期(文本)")
|
||||||
@TableField("XCXSSRQ")
|
@TableField("XCXSSRQ")
|
||||||
private String xcxssrq;
|
private String xcxssrq;
|
||||||
|
|
||||||
@ApiModelProperty(value = "在产车实施日期(标准文本)")
|
@ApiModelProperty(value = "在产车实施日期(文本)")
|
||||||
@TableField("ZCCSSRQ")
|
@TableField("ZCCSSRQ")
|
||||||
private String zccssrq;
|
private String zccssrq;
|
||||||
|
|
||||||
@TableField("EOPSSRQ")
|
@ApiModelProperty(value = "标签")
|
||||||
private String eopssrq;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "采标编号")
|
|
||||||
@TableField("CBBH")
|
|
||||||
private String cbbh;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "适用车辆")
|
|
||||||
@TableField("CLLX")
|
|
||||||
private String cllx;
|
|
||||||
|
|
||||||
@TableField("GXHBQ")
|
@TableField("GXHBQ")
|
||||||
private String gxhbq;
|
private String gxhbq;
|
||||||
|
|
||||||
@TableField("XGBM")
|
@ApiModelProperty(value = "中国认证类型")
|
||||||
private String xgbm;
|
|
||||||
|
|
||||||
@TableField("ZGRZLX")
|
@TableField("ZGRZLX")
|
||||||
private String zgrzlx;
|
private String zgrzlx;
|
||||||
|
|
||||||
@TableField("GZZXX")
|
|
||||||
private String gzzxx;
|
|
||||||
|
|
||||||
@TableField("FO")
|
|
||||||
private String fo;
|
|
||||||
|
|
||||||
@TableField("XMPGJS")
|
|
||||||
private String xmpgjs;
|
|
||||||
|
|
||||||
@TableField("SVPPS")
|
|
||||||
private String svpps;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "草案")
|
@ApiModelProperty(value = "草案")
|
||||||
@TableField("CA")
|
@TableField("CA")
|
||||||
private String ca;
|
private String ca;
|
||||||
@@ -118,13 +90,15 @@ public class SarStandAttrInfo extends BaseEntity {
|
|||||||
@TableField("BPG")
|
@TableField("BPG")
|
||||||
private String bpg;
|
private String bpg;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "采购部门")
|
||||||
@TableField("CGBM")
|
@TableField("CGBM")
|
||||||
private String cgbm;
|
private String cgbm;
|
||||||
|
|
||||||
@ApiModelProperty(value = "发布稿")
|
@ApiModelProperty(value = "发布稿(必读)")
|
||||||
@TableField("FBGBJBD")
|
@TableField("FBGBJBD")
|
||||||
private String fbgbjbd;
|
private String fbgbjbd;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "增补件(必读)")
|
||||||
@TableField("ZBJBD")
|
@TableField("ZBJBD")
|
||||||
private String zbjbd;
|
private String zbjbd;
|
||||||
|
|
||||||
@@ -132,10 +106,11 @@ public class SarStandAttrInfo extends BaseEntity {
|
|||||||
@TableField("ZRBM")
|
@TableField("ZRBM")
|
||||||
private String zrbm;
|
private String zrbm;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "法规维护人")
|
||||||
@TableField("FGWHR")
|
@TableField("FGWHR")
|
||||||
private String fgwhr;
|
private String fgwhr;
|
||||||
|
|
||||||
@ApiModelProperty(value = "代替标准编号")
|
@ApiModelProperty(value = "代替标准号")
|
||||||
@TableField("DTBJH")
|
@TableField("DTBJH")
|
||||||
private String dtbjh;
|
private String dtbjh;
|
||||||
|
|
||||||
@@ -168,37 +143,9 @@ public class SarStandAttrInfo extends BaseEntity {
|
|||||||
@TableField("CBCD")
|
@TableField("CBCD")
|
||||||
private String cbcd;
|
private String cbcd;
|
||||||
|
|
||||||
@TableField("ZRLX")
|
|
||||||
private String zrlx;
|
|
||||||
|
|
||||||
@TableField("YQLX")
|
|
||||||
private String yqlx;
|
|
||||||
|
|
||||||
@TableField("XXZLXX")
|
|
||||||
private String xxzlxx;
|
|
||||||
|
|
||||||
@TableField("NRDBZFGQD")
|
@TableField("NRDBZFGQD")
|
||||||
private String nrdbzfgqd;
|
private String nrdbzfgqd;
|
||||||
|
|
||||||
@TableField("FGXXSXXX")
|
|
||||||
private String fgxxsxxx;
|
|
||||||
|
|
||||||
@TableField("DXBZ")
|
|
||||||
private String dxbz;
|
|
||||||
|
|
||||||
@TableField("BDTBZBH")
|
|
||||||
private String bdtbzbh;
|
|
||||||
|
|
||||||
// 新添加字段 --start
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "新车型实施日期(国际)")
|
|
||||||
@TableField("XCXSSRQGJ")
|
|
||||||
private String xcxssrqgj;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "在产车实施日期(国际)")
|
|
||||||
@TableField("ZCCSSRQGJ")
|
|
||||||
private String zccssrqgj;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "实施日期(标准文本)")
|
@ApiModelProperty(value = "实施日期(标准文本)")
|
||||||
@TableField("SSRQ")
|
@TableField("SSRQ")
|
||||||
private String ssrq;
|
private String ssrq;
|
||||||
@@ -207,6 +154,14 @@ public class SarStandAttrInfo extends BaseEntity {
|
|||||||
@TableField("SSRQGJ")
|
@TableField("SSRQGJ")
|
||||||
private String ssrqgj;
|
private String ssrqgj;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "新车型实施日期(国家)")
|
||||||
|
@TableField("XCXSSRQGJ")
|
||||||
|
private String xcxssrqgj;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "在产车实施日期(国家)")
|
||||||
|
@TableField("ZCCSSRQGJ")
|
||||||
|
private String zccssrqgj;
|
||||||
|
|
||||||
@ApiModelProperty(value = "修改单")
|
@ApiModelProperty(value = "修改单")
|
||||||
@TableField("XGD")
|
@TableField("XGD")
|
||||||
private String xgd;
|
private String xgd;
|
||||||
@@ -215,6 +170,10 @@ public class SarStandAttrInfo extends BaseEntity {
|
|||||||
@TableField("JDWJ")
|
@TableField("JDWJ")
|
||||||
private String jdwj;
|
private String jdwj;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关联文件")
|
||||||
|
@TableField("GLWJ")
|
||||||
|
private String glwj;
|
||||||
|
|
||||||
@ApiModelProperty(value = "我司署名人")
|
@ApiModelProperty(value = "我司署名人")
|
||||||
@TableField("WSSMR")
|
@TableField("WSSMR")
|
||||||
private String wssmr;
|
private String wssmr;
|
||||||
@@ -228,26 +187,18 @@ public class SarStandAttrInfo extends BaseEntity {
|
|||||||
private String sycpx;
|
private String sycpx;
|
||||||
|
|
||||||
@ApiModelProperty(value = "适用认证")
|
@ApiModelProperty(value = "适用认证")
|
||||||
@TableField("SYRZ")
|
@TableField("SYZD")
|
||||||
private String syrz;
|
private String syzd;
|
||||||
|
|
||||||
@ApiModelProperty(value = "责任工程师")
|
@ApiModelProperty(value = "责任工程师")
|
||||||
@TableField("ZRGCS")
|
@TableField("ZRGCS")
|
||||||
private String zrgcs;
|
private String zrgcs;
|
||||||
|
|
||||||
@ApiModelProperty(value = "乘用车VPPS编码")
|
@ApiModelProperty(value = "关联模块--卡车VPPS编码")
|
||||||
@TableField("CYCVPPSBM")
|
|
||||||
private String cycvppsbm;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "乘用车VPPS中文名称")
|
|
||||||
@TableField("CYCVPPSCN")
|
|
||||||
private String cycvppscn;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "卡车VPPS编码")
|
|
||||||
@TableField("KCCVPPSBM")
|
@TableField("KCCVPPSBM")
|
||||||
private String kccvppsbm;
|
private String kccvppsbm;
|
||||||
|
|
||||||
@ApiModelProperty(value = "卡车VPPS中文名称")
|
@ApiModelProperty(value = "关联模块--卡车vpps中文名称")
|
||||||
@TableField("KCCVPPSCN")
|
@TableField("KCCVPPSCN")
|
||||||
private String kccvppscn;
|
private String kccvppscn;
|
||||||
|
|
||||||
@@ -259,11 +210,21 @@ public class SarStandAttrInfo extends BaseEntity {
|
|||||||
@TableField("DYMC")
|
@TableField("DYMC")
|
||||||
private String dymc;
|
private String dymc;
|
||||||
|
|
||||||
@ApiModelProperty(value = "关联文件")
|
@ApiModelProperty(value = "关联模块--乘用车VPPS编码")
|
||||||
@TableField("GLWJ")
|
@TableField("CYCVPPSBM")
|
||||||
private String glwj;
|
private String cycvppsbm;
|
||||||
|
|
||||||
// -- end
|
@ApiModelProperty(value = "关联模块--乘用车vpps中文名称")
|
||||||
|
@TableField("CYCVPPSCN")
|
||||||
|
private String cycvppscn;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "勘误件")
|
||||||
|
@TableField("KWJ")
|
||||||
|
private String kwj;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "体系类别")
|
||||||
|
@TableField("TXLB")
|
||||||
|
private String txlb;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+58
-1
@@ -1,12 +1,25 @@
|
|||||||
package com.adc.da.slrs.sarStandMenu.controller;
|
package com.adc.da.slrs.sarStandMenu.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.adc.da.http.ResponseMessage;
|
||||||
|
import com.adc.da.http.Result;
|
||||||
|
import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||||
|
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
|
||||||
|
import com.adc.da.slrs.sarStandMenu.service.ISarStandMenuService;
|
||||||
|
import com.adc.da.util.UUIDUtils;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.adc.da.base.web.BaseController;
|
import com.adc.da.base.web.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 前端控制器
|
* 前端控制器
|
||||||
@@ -17,7 +30,51 @@ import com.adc.da.base.web.BaseController;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(description = "|SarStandMenu|")
|
@Api(description = "|SarStandMenu|")
|
||||||
@RequestMapping("/SarStandMenu/sar-stand-menu")
|
@RequestMapping("/${restPath}/lawss/sarStandMenu")
|
||||||
public class SarStandMenuController extends BaseController<SarStandMenu> {
|
public class SarStandMenuController extends BaseController<SarStandMenu> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarStandMenuService sarStandMenuEOService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarMenuService sarMenuEOService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "|SarStandMenuEO|修改")
|
||||||
|
@PutMapping("/removeStandInfo")
|
||||||
|
// @RequiresPermissions("lawss:sarStandMenu:update")
|
||||||
|
public ResponseMessage update(@RequestBody SarStandMenu standardsInfoEO) throws Exception {
|
||||||
|
String[] idList = standardsInfoEO.getIdlist();
|
||||||
|
int count = 0;
|
||||||
|
if(idList != null){
|
||||||
|
for(String id : idList){
|
||||||
|
SarStandMenu menuEO = new SarStandMenu();
|
||||||
|
menuEO.setStandId(id);
|
||||||
|
menuEO.setMenuId(standardsInfoEO.getMenuId());
|
||||||
|
//删除所选目录下关联
|
||||||
|
String oldMenuId = standardsInfoEO.getOldMenuId();
|
||||||
|
if (StringUtils.isEmpty(oldMenuId)) {
|
||||||
|
oldMenuId = standardsInfoEO.getMenuId();
|
||||||
|
}
|
||||||
|
menuEO.setOldMenuId(oldMenuId);
|
||||||
|
count += sarStandMenuEOService.deleteByMenuId(menuEO);
|
||||||
|
//查询是否还有与其他节点的关联,若没有则增加与根节点的关联
|
||||||
|
List<SarStandMenu> getList = sarStandMenuEOService.selectAllMenuByStandId(menuEO);
|
||||||
|
if (getList == null || getList.isEmpty()) {
|
||||||
|
// 查询根节点
|
||||||
|
SarMenu sarMenuEO = new SarMenu();
|
||||||
|
sarMenuEO.setSorDivide(standardsInfoEO.getStandType() + "_STAND");
|
||||||
|
List<SarMenu> getRootMenu = sarMenuEOService.queryMenuByDis(sarMenuEO);
|
||||||
|
menuEO.setMenuId(getRootMenu.get(0).getId());
|
||||||
|
menuEO.setId(UUIDUtils.randomUUID20());
|
||||||
|
menuEO.setValidFlag(0);
|
||||||
|
sarStandMenuEOService.saveOrUpdate(menuEO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(count>0){
|
||||||
|
return Result.success("0","移除成功!",true);
|
||||||
|
} else {
|
||||||
|
return Result.error("移除失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,9 @@ public interface SarStandMenuDao extends BaseMapper<SarStandMenu> {
|
|||||||
int updateByStandIdAndMenuId(SarStandMenu sarStandMenuEO);
|
int updateByStandIdAndMenuId(SarStandMenu sarStandMenuEO);
|
||||||
|
|
||||||
int deleteByStandIdAndMenuId(SarStandMenu sarStandMenuEO);
|
int deleteByStandIdAndMenuId(SarStandMenu sarStandMenuEO);
|
||||||
|
|
||||||
|
int deleteByMenuId (SarStandMenu sarStandMenuEO);
|
||||||
|
|
||||||
|
List<SarStandMenu> selectAllMenuByStandId(SarStandMenu sarStandMenuEO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -3,6 +3,8 @@ package com.adc.da.slrs.sarStandMenu.service;
|
|||||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务类
|
* 服务类
|
||||||
@@ -13,4 +15,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
*/
|
*/
|
||||||
public interface ISarStandMenuService extends IService<SarStandMenu> {
|
public interface ISarStandMenuService extends IService<SarStandMenu> {
|
||||||
|
|
||||||
|
int deleteByMenuId (SarStandMenu sarStandMenuEO);
|
||||||
|
|
||||||
|
List<SarStandMenu> selectAllMenuByStandId(SarStandMenu sarStandMenuEO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+22
@@ -1,11 +1,15 @@
|
|||||||
package com.adc.da.slrs.sarStandMenu.service.impl;
|
package com.adc.da.slrs.sarStandMenu.service.impl;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
|
||||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||||
import com.adc.da.slrs.sarStandMenu.dao.SarStandMenuDao;
|
import com.adc.da.slrs.sarStandMenu.dao.SarStandMenuDao;
|
||||||
import com.adc.da.slrs.sarStandMenu.service.ISarStandMenuService;
|
import com.adc.da.slrs.sarStandMenu.service.ISarStandMenuService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务实现类
|
* 服务实现类
|
||||||
@@ -17,4 +21,22 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class SarStandMenuServiceImpl extends ServiceImpl<SarStandMenuDao, SarStandMenu> implements ISarStandMenuService {
|
public class SarStandMenuServiceImpl extends ServiceImpl<SarStandMenuDao, SarStandMenu> implements ISarStandMenuService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarStandMenuDao dao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarMenuService sarMenuEOService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteByMenuId (SarStandMenu sarStandMenuEO){
|
||||||
|
List<String> menuIds = sarMenuEOService.getChildMenuList(sarStandMenuEO.getOldMenuId());
|
||||||
|
sarStandMenuEO.setMenuIds(menuIds);
|
||||||
|
return dao.deleteByMenuId(sarStandMenuEO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SarStandMenu> selectAllMenuByStandId(SarStandMenu sarStandMenuEO){
|
||||||
|
return dao.selectAllMenuByStandId(sarStandMenuEO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+11
@@ -124,6 +124,16 @@ public class SarStandardsInfo extends BaseEntity {
|
|||||||
@TableField("CITED_STAND")
|
@TableField("CITED_STAND")
|
||||||
private String citedStand;
|
private String citedStand;
|
||||||
|
|
||||||
|
// 新添加字段
|
||||||
|
@ApiModelProperty(value = "文本状态")
|
||||||
|
@TableField("TEXT_STATUS")
|
||||||
|
private String textStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准体系")
|
||||||
|
@TableField("STAND_SYSTEM")
|
||||||
|
private String standSystem;
|
||||||
|
|
||||||
|
|
||||||
// 以下为非表中字段
|
// 以下为非表中字段
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String collectId; // 收藏表ID
|
private String collectId; // 收藏表ID
|
||||||
@@ -178,3 +188,4 @@ public class SarStandardsInfo extends BaseEntity {
|
|||||||
private String putTime2;
|
private String putTime2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,4 +43,59 @@ public class UtAreaController extends BaseController<UtArea> {
|
|||||||
return Result.success(utAreaEOService.getAreaSelList(utAreaEO));
|
return Result.success(utAreaEOService.getAreaSelList(utAreaEO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "|UtAreaEO|分页查询")
|
||||||
|
@GetMapping("/page")
|
||||||
|
// @RequiresPermissions("lawssBase:utArea:page")
|
||||||
|
public ResponseMessage<PageInfo<UtArea>> page(UtAreaEOPage page) throws Exception {
|
||||||
|
List<UtArea> rows = utAreaEOService.queryByPage(page);
|
||||||
|
return Result.success(getPageInfo(page.getPager(), rows));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "|UtAreaEO|查询")
|
||||||
|
@GetMapping("/list")
|
||||||
|
// @RequiresPermissions("lawssBase:utArea:list")
|
||||||
|
public ResponseMessage<List<UtArea>> list(UtAreaEOPage page) throws Exception {
|
||||||
|
return Result.success(utAreaEOService.queryByList(page));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "|UtAreaEO|详情")
|
||||||
|
@GetMapping("/getById")
|
||||||
|
// @RequiresPermissions("lawssBase:utArea:get")
|
||||||
|
public ResponseMessage<UtArea> find(@PathVariable String id) throws Exception {
|
||||||
|
return Result.success(utAreaEOService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "|UtAreaEO|新增")
|
||||||
|
@PostMapping("/createUtArea")
|
||||||
|
// @RequiresPermissions("lawssBase:utArea:save")
|
||||||
|
public ResponseMessage<UtArea> create(@RequestBody UtArea utAreaEO) throws Exception {
|
||||||
|
String result = utAreaEOService.createUtArea(utAreaEO);
|
||||||
|
if ("success".equals(result)) {
|
||||||
|
return Result.success("0","新增成功",utAreaEO);
|
||||||
|
} else {
|
||||||
|
return Result.error("0",result,utAreaEO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "|UtAreaEO|修改")
|
||||||
|
@PutMapping("/updateUtArea")
|
||||||
|
// @RequiresPermissions("lawssBase:utArea:update")
|
||||||
|
public ResponseMessage<UtArea> update(@RequestBody UtArea utAreaEO) throws Exception {
|
||||||
|
String result = utAreaEOService.updateUtArea(utAreaEO);
|
||||||
|
if ("success".equals(result)) {
|
||||||
|
return Result.success("0","修改成功",utAreaEO);
|
||||||
|
} else {
|
||||||
|
return Result.error("0",result,utAreaEO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "|UtAreaEO|删除")
|
||||||
|
@DeleteMapping("/deleteById")
|
||||||
|
// @RequiresPermissions("lawssBase:utArea:delete")
|
||||||
|
public ResponseMessage delete(String id) throws Exception {
|
||||||
|
utAreaEOService.removeById(id);
|
||||||
|
logger.info("delete from UT_AREA where id = {}", id);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.adc.da.slrs.utArea.dao;
|
package com.adc.da.slrs.utArea.dao;
|
||||||
|
|
||||||
import com.adc.da.slrs.utArea.entity.UtArea;
|
import com.adc.da.slrs.utArea.entity.UtArea;
|
||||||
|
import com.adc.da.slrs.utArea.page.UtAreaEOPage;
|
||||||
import com.adc.da.sys.common.SelectionResult;
|
import com.adc.da.sys.common.SelectionResult;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
@@ -16,6 +17,15 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface UtAreaDao extends BaseMapper<UtArea> {
|
public interface UtAreaDao extends BaseMapper<UtArea> {
|
||||||
|
|
||||||
|
Integer queryByCount(UtAreaEOPage page);
|
||||||
|
|
||||||
|
List<UtArea> queryByPage(UtAreaEOPage page);
|
||||||
|
|
||||||
|
List<UtArea> queryByList(UtAreaEOPage page);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<SelectionResult> getAreaSelList(UtArea utAreaEO);
|
List<SelectionResult> getAreaSelList(UtArea utAreaEO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.adc.da.slrs.utArea.service;
|
package com.adc.da.slrs.utArea.service;
|
||||||
|
|
||||||
import com.adc.da.slrs.utArea.entity.UtArea;
|
import com.adc.da.slrs.utArea.entity.UtArea;
|
||||||
|
import com.adc.da.slrs.utArea.page.UtAreaEOPage;
|
||||||
import com.adc.da.sys.common.SelectionResult;
|
import com.adc.da.sys.common.SelectionResult;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
@@ -17,4 +18,12 @@ import java.util.List;
|
|||||||
public interface IUtAreaService extends IService<UtArea> {
|
public interface IUtAreaService extends IService<UtArea> {
|
||||||
|
|
||||||
List<SelectionResult> getAreaSelList(UtArea utAreaEO);
|
List<SelectionResult> getAreaSelList(UtArea utAreaEO);
|
||||||
|
|
||||||
|
List<UtArea> queryByPage(UtAreaEOPage page);
|
||||||
|
|
||||||
|
List<UtArea> queryByList(UtAreaEOPage page);
|
||||||
|
|
||||||
|
String createUtArea(UtArea utAreaEO);
|
||||||
|
|
||||||
|
String updateUtArea(UtArea utAreaEO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,18 @@ package com.adc.da.slrs.utArea.service.impl;
|
|||||||
|
|
||||||
import com.adc.da.slrs.utArea.entity.UtArea;
|
import com.adc.da.slrs.utArea.entity.UtArea;
|
||||||
import com.adc.da.slrs.utArea.dao.UtAreaDao;
|
import com.adc.da.slrs.utArea.dao.UtAreaDao;
|
||||||
|
import com.adc.da.slrs.utArea.page.UtAreaEOPage;
|
||||||
import com.adc.da.slrs.utArea.service.IUtAreaService;
|
import com.adc.da.slrs.utArea.service.IUtAreaService;
|
||||||
import com.adc.da.sys.common.SelectionResult;
|
import com.adc.da.sys.common.SelectionResult;
|
||||||
|
import com.adc.da.util.LoginUserUtil;
|
||||||
|
import com.adc.da.util.UUIDUtils;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,4 +40,57 @@ public class UtAreaServiceImpl extends ServiceImpl<UtAreaDao, UtArea> implements
|
|||||||
return dao.getAreaSelList(utAreaEO);
|
return dao.getAreaSelList(utAreaEO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UtArea> queryByPage(UtAreaEOPage page){
|
||||||
|
Integer rowCount = dao.queryByCount(page);
|
||||||
|
page.getPager().setRowCount(rowCount);
|
||||||
|
return dao.queryByPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UtArea> queryByList(UtAreaEOPage page){
|
||||||
|
return dao.queryByList(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String createUtArea (UtArea utAreaEO) {
|
||||||
|
// 判断名称是否已存在
|
||||||
|
UtAreaEOPage page = new UtAreaEOPage();
|
||||||
|
page.setAreaName(utAreaEO.getAreaName());
|
||||||
|
page.setSarType(utAreaEO.getSarType());
|
||||||
|
List<UtArea> getList = dao.queryByList(page);
|
||||||
|
if (getList != null && !getList.isEmpty()) {
|
||||||
|
return "新增失败,展示区域名称已存在";
|
||||||
|
}
|
||||||
|
utAreaEO.setId(UUIDUtils.randomUUID20());
|
||||||
|
utAreaEO.setCreationUser(LoginUserUtil.getUserId());
|
||||||
|
utAreaEO.setCreationTime(new Date());
|
||||||
|
utAreaEO.setModifyTime(new Date());
|
||||||
|
utAreaEO.setValidFlag(0);
|
||||||
|
int result = dao.insert(utAreaEO);
|
||||||
|
if (result > 0) {
|
||||||
|
return "success";
|
||||||
|
} else {
|
||||||
|
return "新增失败";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String updateUtArea (UtArea utAreaEO) {
|
||||||
|
// 判断名称是否已存在
|
||||||
|
UtAreaEOPage page = new UtAreaEOPage();
|
||||||
|
page.setAreaName(utAreaEO.getAreaName());
|
||||||
|
page.setSarType(utAreaEO.getSarType());
|
||||||
|
page.setNotId(utAreaEO.getId());
|
||||||
|
List<UtArea> getList = dao.queryByList(page);
|
||||||
|
if (getList != null && !getList.isEmpty()) {
|
||||||
|
return "修改失败,展示区域名称已存在";
|
||||||
|
}
|
||||||
|
utAreaEO.setModifyTime(new Date());
|
||||||
|
int result = dao.updateById(utAreaEO);
|
||||||
|
if (result > 0) {
|
||||||
|
return "success";
|
||||||
|
} else {
|
||||||
|
return "修改失败";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,19 @@
|
|||||||
where stand_id = #{standId, jdbcType=VARCHAR} and MENU_ID = #{menuId, jdbcType=VARCHAR}
|
where stand_id = #{standId, jdbcType=VARCHAR} and MENU_ID = #{menuId, jdbcType=VARCHAR}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteByMenuId" parameterType="com.adc.da.slrs.sarStandMenu.entity.SarStandMenu">
|
||||||
|
delete from SAR_STAND_MENU
|
||||||
|
where stand_id = #{standId}
|
||||||
|
and MENU_ID in
|
||||||
|
<foreach collection="menuIds" index="index" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectAllMenuByStandId" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandMenu.entity.SarStandMenu">
|
||||||
|
select <include refid="Base_Column_List" />
|
||||||
|
from SAR_STAND_MENU
|
||||||
|
where stand_id = #{standId} and valid_flag=0
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -65,6 +65,122 @@
|
|||||||
</trim>
|
</trim>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<!-- 插入记录 -->
|
||||||
|
<insert id="insert" parameterType="com.adc.da.slrs.utArea.entity.UtArea" >
|
||||||
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||||
|
SELECT SEQ_UT_AREA.NEXTVAL FROM DUAL
|
||||||
|
</selectKey> -->
|
||||||
|
insert into UT_AREA(<include refid="Base_Column_List" />)
|
||||||
|
values (#{id, jdbcType=VARCHAR}, #{areaName, jdbcType=VARCHAR}, #{showIndex, jdbcType=INTEGER}, #{sarType, jdbcType=VARCHAR}, #{creationUser, jdbcType=VARCHAR}, #{validFlag, jdbcType=INTEGER}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 动态插入记录 主键是序列 -->
|
||||||
|
<insert id="insertSelective" parameterType="com.adc.da.slrs.utArea.entity.UtArea" >
|
||||||
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||||
|
SELECT SEQ_UT_AREA.NEXTVAL FROM DUAL
|
||||||
|
</selectKey> -->
|
||||||
|
insert into UT_AREA
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||||
|
<if test="id != null" >id,</if>
|
||||||
|
<if test="areaName != null" >area_name,</if>
|
||||||
|
<if test="showIndex != null" >show_index,</if>
|
||||||
|
<if test="sarType != null" >sar_type,</if>
|
||||||
|
<if test="creationUser != null" >creation_user,</if>
|
||||||
|
<if test="validFlag != null" >valid_flag,</if>
|
||||||
|
<if test="creationTime != null" >creation_time,</if>
|
||||||
|
<if test="modifyTime != null" >modify_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||||
|
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
||||||
|
<if test="areaName != null" >#{areaName, jdbcType=VARCHAR},</if>
|
||||||
|
<if test="showIndex != null" >#{showIndex, jdbcType=INTEGER},</if>
|
||||||
|
<if test="sarType != null" >#{sarType, jdbcType=VARCHAR},</if>
|
||||||
|
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
|
||||||
|
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
|
||||||
|
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 根据pk,修改记录-->
|
||||||
|
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.utArea.entity.UtArea" >
|
||||||
|
update UT_AREA
|
||||||
|
set area_name = #{areaName},
|
||||||
|
show_index = #{showIndex},
|
||||||
|
sar_type = #{sarType},
|
||||||
|
creation_user = #{creationUser},
|
||||||
|
valid_flag = #{validFlag},
|
||||||
|
creation_time = #{creationTime},
|
||||||
|
modify_time = #{modifyTime}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 修改记录,只修改只不为空的字段 -->
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.utArea.entity.UtArea" >
|
||||||
|
update UT_AREA
|
||||||
|
<set >
|
||||||
|
<if test="areaName != null" >
|
||||||
|
area_name = #{areaName},
|
||||||
|
</if>
|
||||||
|
<if test="showIndex != null" >
|
||||||
|
show_index = #{showIndex},
|
||||||
|
</if>
|
||||||
|
<if test="sarType != null" >
|
||||||
|
sar_type = #{sarType},
|
||||||
|
</if>
|
||||||
|
<if test="creationUser != null" >
|
||||||
|
creation_user = #{creationUser},
|
||||||
|
</if>
|
||||||
|
<if test="validFlag != null" >
|
||||||
|
valid_flag = #{validFlag},
|
||||||
|
</if>
|
||||||
|
<if test="creationTime != null" >
|
||||||
|
creation_time = #{creationTime},
|
||||||
|
</if>
|
||||||
|
<if test="modifyTime != null" >
|
||||||
|
modify_time = #{modifyTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 根据id查询 UT_AREA -->
|
||||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||||
|
select <include refid="Base_Column_List" />
|
||||||
|
from UT_AREA
|
||||||
|
where id = #{value}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 删除记录 -->
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||||
|
delete from UT_AREA
|
||||||
|
where id = #{value}
|
||||||
|
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- UT_AREA 列表总数-->
|
||||||
|
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||||
|
select count(1) from UT_AREA
|
||||||
|
<include refid="Base_Where_Clause"/>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询UT_AREA列表 -->
|
||||||
|
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||||
|
select <include refid="Base_Column_List" /> from
|
||||||
|
(select tmp_tb.* from
|
||||||
|
(select <include refid="Base_Column_List" /> from UT_AREA
|
||||||
|
<include refid="Base_Where_Clause"/>
|
||||||
|
order by show_index,id
|
||||||
|
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||||
|
select <include refid="Base_Column_List"/> from UT_AREA
|
||||||
|
<include refid="Base_Where_Clause"/>
|
||||||
|
order by show_index,id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getAreaSelList" parameterType="com.adc.da.slrs.utArea.entity.UtArea" resultType="com.adc.da.sys.common.SelectionResult">
|
<select id="getAreaSelList" parameterType="com.adc.da.slrs.utArea.entity.UtArea" resultType="com.adc.da.sys.common.SelectionResult">
|
||||||
select id as value,area_name as label
|
select id as value,area_name as label
|
||||||
from UT_AREA
|
from UT_AREA
|
||||||
|
|||||||
@@ -37,6 +37,13 @@ public class DicEORestController extends BaseController<DictionaryEO> {
|
|||||||
public ResponseMessage<PageInfo<DictionaryEO>> page(DictionaryEOPage page) throws Exception {
|
public ResponseMessage<PageInfo<DictionaryEO>> page(DictionaryEOPage page) throws Exception {
|
||||||
page.setDictionaryCodeOperator("like");
|
page.setDictionaryCodeOperator("like");
|
||||||
page.setDictionaryNameOperator("like");
|
page.setDictionaryNameOperator("like");
|
||||||
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(page.getPaixu()) && org.apache.commons.lang3.StringUtils.isNotBlank(page.getShunxu())){
|
||||||
|
String sql = page.getPaixu()+" "+page.getShunxu();
|
||||||
|
page.setSql(sql);
|
||||||
|
}else{
|
||||||
|
String sql = "order_num,u0.id";
|
||||||
|
page.setSql(sql);
|
||||||
|
}
|
||||||
List<DictionaryEO> rows = dicEOService.queryAllDicByPage(page);
|
List<DictionaryEO> rows = dicEOService.queryAllDicByPage(page);
|
||||||
return Result.success(getPageInfo(page.getPager(), rows));
|
return Result.success(getPageInfo(page.getPager(), rows));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,12 +267,13 @@
|
|||||||
<!-- 查询TS_DICTIONARY列表 -->
|
<!-- 查询TS_DICTIONARY列表 -->
|
||||||
<select id="queryAllDicByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
<select id="queryAllDicByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||||
select <include refid="Base_Column_List" /> from
|
select <include refid="Base_Column_List" /> from
|
||||||
(select tmp_tb.* , rownum rn from
|
(select tmp_tb.* from
|
||||||
(select <include refid="Base_Column_List" /> from TS_DICTIONARY u0
|
(select <include refid="Base_Column_List" /> from TS_DICTIONARY u0
|
||||||
<include refid="Base_Where_Clause"/>
|
<include refid="Base_Where_Clause"/>
|
||||||
order by order_num,u0.id
|
<if test="sql != null">
|
||||||
) tmp_tb where rownum <= ${pager.endIndex})
|
ORDER BY ${sql}
|
||||||
where rn >= ${pager.startIndex}
|
</if>
|
||||||
|
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDictionarySelList" parameterType="java.lang.String" resultType="com.adc.da.sys.common.SelectionResult">
|
<select id="getDictionarySelList" parameterType="java.lang.String" resultType="com.adc.da.sys.common.SelectionResult">
|
||||||
|
|||||||
Reference in New Issue
Block a user