wangyuzhe 1 ヶ月 前
コミット
0c7cca5953
76 ファイル変更1873 行追加115 行削除
  1. 1 1
      src/main/java/org/springblade/common/config/BladeConfiguration.java
  2. 27 0
      src/main/java/org/springblade/common/config/WxConfig.java
  3. 134 0
      src/main/java/org/springblade/common/utils/HttpClientUtil.java
  4. 81 0
      src/main/java/org/springblade/common/utils/WechatQsUtil.java
  5. 50 0
      src/main/java/org/springblade/modules/auth/enums/UserEnum.java
  6. 1 1
      src/main/java/org/springblade/modules/auth/service/BladeUserDetailService.java
  7. 87 0
      src/main/java/org/springblade/modules/auth/utils/TokenUtil.java
  8. 2 2
      src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
  9. 46 6
      src/main/java/org/springblade/modules/ffxc/controller/JwtdFfxcController.java
  10. 3 1
      src/main/java/org/springblade/modules/ffxc/mapper/JwtdFfxcMapper.java
  11. 12 1
      src/main/java/org/springblade/modules/ffxc/mapper/JwtdFfxcMapper.xml
  12. 6 1
      src/main/java/org/springblade/modules/ffxc/pojo/entity/JwtdFfxcEntity.java
  13. 3 1
      src/main/java/org/springblade/modules/ffxc/service/IJwtdFfxcService.java
  14. 6 1
      src/main/java/org/springblade/modules/ffxc/service/impl/JwtdFfxcServiceImpl.java
  15. 11 8
      src/main/java/org/springblade/modules/ffxcLlls/controller/JwtdFfxcLllsController.java
  16. 2 0
      src/main/java/org/springblade/modules/ffxcLlls/mapper/JwtdFfxcLllsMapper.java
  17. 4 0
      src/main/java/org/springblade/modules/ffxcLlls/mapper/JwtdFfxcLllsMapper.xml
  18. 2 0
      src/main/java/org/springblade/modules/ffxcLlls/service/IJwtdFfxcLllsService.java
  19. 5 0
      src/main/java/org/springblade/modules/ffxcLlls/service/impl/JwtdFfxcLllsServiceImpl.java
  20. 170 0
      src/main/java/org/springblade/modules/jwtdGwc/controller/JwtdGwcController.java
  21. 67 0
      src/main/java/org/springblade/modules/jwtdGwc/excel/JwtdGwcExcel.java
  22. 65 0
      src/main/java/org/springblade/modules/jwtdGwc/mapper/JwtdGwcMapper.java
  23. 34 0
      src/main/java/org/springblade/modules/jwtdGwc/mapper/JwtdGwcMapper.xml
  24. 45 0
      src/main/java/org/springblade/modules/jwtdGwc/pojo/dto/JwtdGwcDTO.java
  25. 70 0
      src/main/java/org/springblade/modules/jwtdGwc/pojo/entity/JwtdGwcEntity.java
  26. 45 0
      src/main/java/org/springblade/modules/jwtdGwc/pojo/vo/JwtdGwcVO.java
  27. 63 0
      src/main/java/org/springblade/modules/jwtdGwc/service/IJwtdGwcService.java
  28. 72 0
      src/main/java/org/springblade/modules/jwtdGwc/service/impl/JwtdGwcServiceImpl.java
  29. 58 0
      src/main/java/org/springblade/modules/jwtdGwc/wrapper/JwtdGwcWrapper.java
  30. 18 1
      src/main/java/org/springblade/modules/jwtdJfjl/controller/JwtdJfjlController.java
  31. 4 0
      src/main/java/org/springblade/modules/jwtdJfjl/mapper/JwtdJfjlMapper.java
  32. 29 1
      src/main/java/org/springblade/modules/jwtdJfjl/mapper/JwtdJfjlMapper.xml
  33. 4 0
      src/main/java/org/springblade/modules/jwtdJfjl/service/IJwtdJfjlService.java
  34. 10 0
      src/main/java/org/springblade/modules/jwtdJfjl/service/impl/JwtdJfjlServiceImpl.java
  35. 15 7
      src/main/java/org/springblade/modules/jwtdJwgk/mapper/JwtdJwgkMapper.xml
  36. 4 0
      src/main/java/org/springblade/modules/jwtdJwgk/pojo/entity/JwtdJwgkEntity.java
  37. 34 4
      src/main/java/org/springblade/modules/jwtdSpgl/controller/JwtdSpglController.java
  38. 10 1
      src/main/java/org/springblade/modules/jwtdSpgl/mapper/JwtdSpglMapper.java
  39. 42 7
      src/main/java/org/springblade/modules/jwtdSpgl/mapper/JwtdSpglMapper.xml
  40. 2 0
      src/main/java/org/springblade/modules/jwtdSpgl/pojo/entity/JwtdSpglEntity.java
  41. 10 1
      src/main/java/org/springblade/modules/jwtdSpgl/service/IJwtdSpglService.java
  42. 25 1
      src/main/java/org/springblade/modules/jwtdSpgl/service/impl/JwtdSpglServiceImpl.java
  43. 44 13
      src/main/java/org/springblade/modules/jwtdSpglDhjl/controller/JwtdSpglDhjlController.java
  44. 5 1
      src/main/java/org/springblade/modules/jwtdSpglDhjl/mapper/JwtdSpglDhjlMapper.java
  45. 34 3
      src/main/java/org/springblade/modules/jwtdSpglDhjl/mapper/JwtdSpglDhjlMapper.xml
  46. 11 1
      src/main/java/org/springblade/modules/jwtdSpglDhjl/pojo/entity/JwtdSpglDhjlEntity.java
  47. 10 0
      src/main/java/org/springblade/modules/jwtdSpglDhjl/pojo/vo/JfVO.java
  48. 5 1
      src/main/java/org/springblade/modules/jwtdSpglDhjl/service/IJwtdSpglDhjlService.java
  49. 12 2
      src/main/java/org/springblade/modules/jwtdSpglDhjl/service/impl/JwtdSpglDhjlServiceImpl.java
  50. 1 1
      src/main/java/org/springblade/modules/resource/builder/OssBuilder.java
  51. 33 2
      src/main/java/org/springblade/modules/system/controller/DeptController.java
  52. 50 1
      src/main/java/org/springblade/modules/system/controller/UserController.java
  53. 11 0
      src/main/java/org/springblade/modules/system/mapper/DeptMapper.java
  54. 44 4
      src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
  55. 2 0
      src/main/java/org/springblade/modules/system/mapper/DictBizMapper.java
  56. 4 0
      src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml
  57. 2 0
      src/main/java/org/springblade/modules/system/mapper/UserMapper.java
  58. 4 0
      src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
  59. 0 20
      src/main/java/org/springblade/modules/system/pojo/entity/User.java
  60. 12 0
      src/main/java/org/springblade/modules/system/pojo/vo/DeptListVO.java
  61. 1 0
      src/main/java/org/springblade/modules/system/pojo/vo/ZdVO.java
  62. 11 0
      src/main/java/org/springblade/modules/system/service/IDeptService.java
  63. 2 0
      src/main/java/org/springblade/modules/system/service/IDictBizService.java
  64. 8 0
      src/main/java/org/springblade/modules/system/service/IUserService.java
  65. 26 0
      src/main/java/org/springblade/modules/system/service/impl/DeptServiceImpl.java
  66. 5 0
      src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
  67. 47 0
      src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
  68. 17 4
      src/main/java/org/springblade/modules/szqyCsjl/mapper/JwtdSzqyCsjlMapper.xml
  69. 23 3
      src/main/java/org/springblade/modules/szqyCsjl/pojo/entity/JwtdSzqyCsjlEntity.java
  70. 32 1
      src/main/java/org/springblade/modules/szqyJyz/controller/JwtdSzqyJyzController.java
  71. 4 0
      src/main/java/org/springblade/modules/szqyJyz/mapper/JwtdSzqyJyzMapper.java
  72. 16 7
      src/main/java/org/springblade/modules/szqyJyz/mapper/JwtdSzqyJyzMapper.xml
  73. 2 5
      src/main/java/org/springblade/modules/szqyJyz/pojo/entity/JwtdSzqyJyzEntity.java
  74. 4 0
      src/main/java/org/springblade/modules/szqyJyz/service/IJwtdSzqyJyzService.java
  75. 10 0
      src/main/java/org/springblade/modules/szqyJyz/service/impl/JwtdSzqyJyzServiceImpl.java
  76. 2 0
      src/main/resources/application.yml

+ 1 - 1
src/main/java/org/springblade/common/config/BladeConfiguration.java

@@ -53,7 +53,7 @@ public class BladeConfiguration implements WebMvcConfigurer {
 	@Bean
 	public SecureRegistry secureRegistry() {
 		SecureRegistry secureRegistry = new SecureRegistry();
-		secureRegistry.setEnabled(true);
+		secureRegistry.setEnabled(false);
 		secureRegistry.excludePathPatterns("/blade-auth/**");
 		secureRegistry.excludePathPatterns("/blade-system/tenant/info");
 		secureRegistry.excludePathPatterns("/blade-flow/process/resource-view");

+ 27 - 0
src/main/java/org/springblade/common/config/WxConfig.java

@@ -0,0 +1,27 @@
+package org.springblade.common.config;
+
+public class WxConfig {
+
+
+	/**-------骑手端------微信支付的AppId*/
+	public static final String QS_APP_ID = "wxee8f6bac8979eec1";
+
+	/**-------骑手端------AppSecret(小程序密钥)*/
+	public static final String QS_AppSecret = "1ac6a40fd83065583f80fa051d860c34";
+
+	/**微信支付的AppId*/
+	public static final String APP_ID = "wxade26aebf348223e";
+
+	/**AppSecret(小程序密钥)*/
+	public static final String AppSecret = "5ce4a147f3cfe7b6eb4953b41109ce66";
+
+	/**微信支付的商户号(mchid)*/
+	public static final String Mch_ID = "1650795138";
+
+	/**证书序列号*/
+	public static final String mchSerialNo = "3F551601EC110B22562DF99F94A83ACF28E19713";
+
+	/**APIv3密钥*/
+	public static final String apiV3Key = "JLSmsxxjsyxgsTB2023JLSmsxxjsyxgs";
+
+}

+ 134 - 0
src/main/java/org/springblade/common/utils/HttpClientUtil.java

@@ -0,0 +1,134 @@
+package org.springblade.common.utils;
+
+import org.apache.http.NameValuePair;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class HttpClientUtil {
+
+	public static String doGet(String url, Map<String, String> param) {
+
+		// 创建Httpclient对象
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+
+		String resultString = "";
+		CloseableHttpResponse response = null;
+		try {
+			// 创建uri
+			URIBuilder builder = new URIBuilder(url);
+			if (param != null) {
+				for (String key : param.keySet()) {
+					builder.addParameter(key, param.get(key));
+				}
+			}
+			URI uri = builder.build();
+
+			// 创建http GET请求
+			HttpGet httpGet = new HttpGet(uri);
+
+			// 执行请求
+			response = httpclient.execute(httpGet);
+			// 判断返回状态是否为200
+			if (response.getStatusLine().getStatusCode() == 200) {
+				resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				if (response != null) {
+					response.close();
+				}
+				httpclient.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		return resultString;
+	}
+
+	public static String doGet(String url) {
+		return doGet(url, null);
+	}
+
+	public static String doPost(String url, Map<String, String> param) {
+		// 创建Httpclient对象
+		CloseableHttpClient httpClient = HttpClients.createDefault();
+		CloseableHttpResponse response = null;
+		String resultString = "";
+		try {
+			// 创建Http Post请求
+			HttpPost httpPost = new HttpPost(url);
+			// 创建参数列表
+			if (param != null) {
+				List<NameValuePair> paramList = new ArrayList<>();
+				for (String key : param.keySet()) {
+					paramList.add(new BasicNameValuePair(key, param.get(key)));
+				}
+				// 模拟表单
+				UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList);
+				httpPost.setEntity(entity);
+			}
+			// 执行http请求
+			response = httpClient.execute(httpPost);
+			resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				response.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+
+		return resultString;
+	}
+
+	public static String doPost(String url) {
+		return doPost(url, null);
+	}
+
+	public static String doPostJson(String url, String json) {
+		// 创建Httpclient对象
+		CloseableHttpClient httpClient = HttpClients.createDefault();
+		CloseableHttpResponse response = null;
+		String resultString = "";
+		try {
+			// 创建Http Post请求
+			HttpPost httpPost = new HttpPost(url);
+			// 创建请求内容
+			StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
+			httpPost.setEntity(entity);
+			// 执行http请求
+			response = httpClient.execute(httpPost);
+			resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				response.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+
+		return resultString;
+	}
+}
+

+ 81 - 0
src/main/java/org/springblade/common/utils/WechatQsUtil.java

@@ -0,0 +1,81 @@
+package org.springblade.common.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import org.springblade.common.config.WxConfig;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class WechatQsUtil {
+
+	public final static String APPID = WxConfig.QS_APP_ID;
+	public final static String SECRET = WxConfig.QS_AppSecret;
+
+//	public static JSONObject getSessionKeyOrOpenId(String code) {
+//		String requestUrl = "https://api.weixin.qq.com/sns/jscode2session";
+//		Map<String, String> requestUrlParam = new HashMap<>();
+//		// https://mp.weixin.qq.com/wxopen/devprofile?action=get_profile&token=164113089&lang=zh_CN
+//		//小程序appId
+//		requestUrlParam.put("appid", APPID);
+//		//小程序secret
+//		requestUrlParam.put("secret", SECRET);
+//		//小程序端返回的code
+//		requestUrlParam.put("js_code", code);
+//		//默认参数
+//		requestUrlParam.put("grant_type", "authorization_code");
+//		//发送post请求读取调用微信接口获取openid用户唯一标识
+//		JSONObject jsonObject = JSON.parseObject(HttpClientUtil.doPost(requestUrl, requestUrlParam));
+//		return jsonObject;
+//	}
+
+	public  static String getOpenid(String code) {
+// 调用接口必要的参数
+		StringBuilder data=new StringBuilder();
+// appid、secret定义在配置文件中,注入到项目里
+		data.append("appid="+APPID+"&");
+		data.append("secret="+ SECRET+"&");
+		data.append("js_code="+ code+"&");
+		data.append("grant_type="+ "authorization_code");
+
+		String response = HttpClientUtil.doGet("https://api.weixin.qq.com/sns/jscode2session?" + data);
+
+
+		return response;
+	}
+
+	public static Object getPhoneNumber(String appCode){
+		try {
+			Map<String, String> params = new HashMap<>(1);
+			params.put("code",appCode);
+			HttpHeaders headers = new HttpHeaders();
+			HttpEntity<Map<String, String>> httpEntity = new HttpEntity<>(params, headers);
+
+//			String objectStr = HttpClientUtil.doPostJson(String.format("https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=%s",getAccessToken()), JSONObject.toJSONString(httpEntity));
+			RestTemplate restTemplate = new RestTemplate();
+			ResponseEntity<Object> response = restTemplate.postForEntity(String.format("https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=%s",getAccessToken()), httpEntity, Object.class);
+			return response.getBody();
+		}catch (Exception e){
+			e.printStackTrace();
+//			log.error("微信code解析异常", e.getMessage());
+		}
+		return null;
+	}
+
+	public static String getAccessToken(){
+		try {
+			String objectStr = HttpClientUtil.doGet(String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s",APPID, SECRET));
+//			log.info(objectStr);
+			JSONObject jsonObject = JSON.parseObject(objectStr);
+			return jsonObject.getString("access_token");
+		}catch (Exception e){
+			e.printStackTrace();
+//			log.error("微信code解析异常", e.getMessage());
+		}
+		return null;
+	}
+}

+ 50 - 0
src/main/java/org/springblade/modules/auth/enums/UserEnum.java

@@ -0,0 +1,50 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.auth.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 用户类型枚举
+ *
+ * @author Chill
+ */
+@Getter
+@AllArgsConstructor
+public enum UserEnum {
+
+	/**
+	 * web
+	 */
+	WEB("web", 1),
+
+	/**
+	 * app
+	 */
+	APP("app", 2),
+
+	/**
+	 * other
+	 */
+	OTHER("other", 3),
+	;
+
+	final String name;
+	final int category;
+
+}

+ 1 - 1
src/main/java/org/springblade/modules/auth/service/BladeUserDetailService.java

@@ -8,6 +8,7 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.modules.auth.provider.UserType;
 import org.springblade.modules.auth.utils.TokenUtil;
+import org.springblade.modules.system.pojo.entity.User;
 import org.springblade.modules.system.pojo.entity.UserInfo;
 import org.springblade.modules.system.service.IUserService;
 
@@ -46,7 +47,6 @@ public class BladeUserDetailService implements OAuth2UserService {
 
 		// 获取用户信息
 		UserInfo userInfo = userService.userInfo(tenantId, username, UserType.of(userType));
-
 		// 构建oauth2用户信息
 		return TokenUtil.convertUser(userInfo, request);
 	}

+ 87 - 0
src/main/java/org/springblade/modules/auth/utils/TokenUtil.java

@@ -25,13 +25,31 @@
  */
 package org.springblade.modules.auth.utils;
 
+import jakarta.servlet.http.HttpServletResponse;
+import org.springblade.core.launch.constant.TokenConstant;
+import org.springblade.core.oauth2.granter.AbstractTokenGranter;
+import org.springblade.core.oauth2.granter.TokenGranter;
+import org.springblade.core.oauth2.handler.PasswordHandler;
 import org.springblade.core.oauth2.provider.OAuth2Request;
+import org.springblade.core.oauth2.service.OAuth2Client;
+import org.springblade.core.oauth2.service.OAuth2ClientService;
 import org.springblade.core.oauth2.service.OAuth2User;
+import org.springblade.core.oauth2.service.OAuth2UserService;
 import org.springblade.core.oauth2.service.impl.OAuth2UserDetail;
+import org.springblade.core.oauth2.utils.OAuth2ExceptionUtil;
+import org.springblade.core.oauth2.utils.OAuth2Util;
+import org.springblade.core.secure.TokenInfo;
+import org.springblade.core.oauth2.granter.TokenGranterFactory;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.support.Kv;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.system.pojo.entity.User;
 import org.springblade.modules.system.pojo.entity.UserInfo;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * 认证工具类
  *
@@ -82,4 +100,73 @@ public class TokenUtil {
 		return userDetail;
 	}
 
+	public static Kv createAuthInfo(UserInfo userInfo) {
+		Kv authInfo = Kv.create();
+		User user = userInfo.getUser();
+		OAuth2Request request = OAuth2Request.create().buildArgs();
+		OAuth2User oUser = TokenUtil.convertUser(userInfo, request);
+		String clientId = request.getClientId();
+		String clientSecret = request.getClientSecret();
+		oUser.setClient(null);
+		//设置jwt参数
+		Map<String, Object> param = new HashMap<>(16);
+		param.put(TokenConstant.TOKEN_TYPE, TokenConstant.ACCESS_TOKEN);
+		param.put(TokenConstant.TENANT_ID, user.getTenantId());
+		param.put(TokenConstant.USER_ID, Func.toStr(user.getId()));
+		param.put(TokenConstant.DEPT_ID, user.getDeptId());
+		param.put(TokenConstant.POST_ID, user.getPostId());
+		param.put(TokenConstant.ROLE_ID, user.getRoleId());
+		param.put(TokenConstant.OAUTH_ID, userInfo.getOauthId());
+		param.put(TokenConstant.ACCOUNT, user.getAccount());
+		param.put(TokenConstant.USER_NAME, user.getAccount());
+		param.put(TokenConstant.NICK_NAME, user.getName());
+		param.put(TokenConstant.REAL_NAME, user.getRealName());
+		param.put(TokenConstant.ROLE_NAME, Func.join(userInfo.getRoles()));
+		param.put(TokenConstant.DETAIL, userInfo.getDetail());
+
+		//拼装accessToken
+		try {
+			TokenInfo accessToken = OAuth2Util.createAccessToken(oUser);
+			//TokenInfo accessToken = SecureUtil.createJWT(param, "audience", "issuser", TokenConstant.ACCESS_TOKEN);
+			//返回accessToken
+			return authInfo.set(TokenConstant.TENANT_ID, user.getTenantId())
+				.set(TokenConstant.USER_ID, Func.toStr(user.getId()))
+				.set(TokenConstant.DEPT_ID, user.getDeptId())
+				.set(TokenConstant.POST_ID, user.getPostId())
+				.set(TokenConstant.ROLE_ID, user.getRoleId())
+				.set(TokenConstant.OAUTH_ID, userInfo.getOauthId())
+				.set(TokenConstant.ACCOUNT, user.getAccount())
+				.set(TokenConstant.USER_NAME, user.getAccount())
+				.set(TokenConstant.NICK_NAME, user.getName())
+				.set(TokenConstant.REAL_NAME, user.getRealName())
+				.set(TokenConstant.ROLE_NAME, Func.join(userInfo.getRoles()))
+				.set(TokenConstant.AVATAR, Func.toStr(user.getAvatar(), TokenConstant.DEFAULT_AVATAR))
+				.set(TokenConstant.ACCESS_TOKEN, accessToken.getToken())
+				.set(TokenConstant.REFRESH_TOKEN, createRefreshToken(userInfo).getToken())
+				.set(TokenConstant.TOKEN_TYPE, TokenConstant.BEARER)
+				.set(TokenConstant.EXPIRES_IN, accessToken.getExpire())
+				.set(TokenConstant.DETAIL, userInfo.getDetail())
+				.set(TokenConstant.LICENSE, TokenConstant.LICENSE_NAME);
+		} catch (Exception ex) {
+			return authInfo.set("error_code", HttpServletResponse.SC_UNAUTHORIZED).set("error_description", ex.getMessage());
+		}
+	}
+
+	/**
+	 * 创建refreshToken
+	 *
+	 * @param userInfo 用户信息
+	 * @return refreshToken
+	 */
+	private static TokenInfo createRefreshToken(UserInfo userInfo) {
+		User user = userInfo.getUser();
+		OAuth2User oUser = new OAuth2UserDetail();
+		BeanUtil.copyProperties(oUser, user);
+		Map<String, Object> param = new HashMap<>(16);
+		param.put(TokenConstant.TOKEN_TYPE, TokenConstant.REFRESH_TOKEN);
+		param.put(TokenConstant.USER_ID, Func.toStr(user.getId()));
+		param.put(TokenConstant.DEPT_ID, Func.toStr(user.getDeptId()));
+		param.put(TokenConstant.ROLE_ID, Func.toStr(user.getRoleId()));
+		return OAuth2Util.createAccessToken(oUser);
+	}
 }

+ 2 - 2
src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml

@@ -40,9 +40,9 @@
         d.dict_value AS categoryName
         FROM
         blade_notice n
-        LEFT JOIN ( SELECT * FROM blade_dict WHERE CODE = 'notice' ) d ON n.category = d.dict_key
+        LEFT JOIN ( SELECT * FROM blade_dict WHERE CODE = 'notice' ) d ON n.category :: text = d.dict_key :: text
         WHERE
-        n.is_deleted = 0 and n.tenant_id = #{notice.tenantId}
+        n.is_deleted = 0 and n.tenant_id :: text = #{notice.tenantId} :: text
         <if test="notice.title!=null">
             and n.title like concat(concat('%', #{notice.title}), '%')
         </if>

+ 46 - 6
src/main/java/org/springblade/modules/ffxc/controller/JwtdFfxcController.java

@@ -56,8 +56,13 @@ import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.tool.constant.BladeConstant;
 import org.springblade.core.tool.constant.RoleConstant;
+
+import java.util.ArrayList;
 import java.util.Map;
 import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import jakarta.servlet.http.HttpServletResponse;
 
 /**
@@ -98,7 +103,7 @@ public class JwtdFfxcController extends BladeController {
 		jfls.setLlzt("0");
 		jfls.setJf(0);
 		jwtdFfxcLllsService.save(jfls);
-		JwtdFfxcEntity detail = jwtdFfxcService.getById(jwtdFfxc);
+		JwtdFfxcEntity detail = jwtdFfxcService.detailApp(jwtdFfxc);
 		detail.setLsId(jfls.getId());
 		return R.data(detail);
 	}
@@ -121,8 +126,38 @@ public class JwtdFfxcController extends BladeController {
 	@GetMapping("/page")
 	@ApiOperationSupport(order = 3)
 	@Operation(summary = "分页", description  = "传入jwtdFfxc")
-	public R<IPage<JwtdFfxcVO>> page(JwtdFfxcVO jwtdFfxc, Query query) {
-		IPage<JwtdFfxcVO> pages = jwtdFfxcService.selectJwtdFfxcPage(Condition.getPage(query), jwtdFfxc);
+	public R<IPage<JwtdFfxcEntity>> page(JwtdFfxcVO jwtdFfxc, Query query) {
+		IPage<JwtdFfxcEntity> pages = jwtdFfxcService.selectJwtdFfxcPage(Condition.getPage(query), jwtdFfxc);
+		for (JwtdFfxcEntity jwtdFfxcVO : pages.getRecords()) {
+			List<String> file = new ArrayList<>();
+			String input = jwtdFfxcVO.getXcnr();
+			// 定义照片后缀
+			String[] suffixes = {".jpg", ".png", ".jfif", ".mp4"};
+			// 遍历所有后缀
+			for (String suffix : suffixes) {
+				// 查找第一个照片URL
+				int index = input.indexOf("http://");
+				while (index != -1) {
+					// 查找照片URL的结束位置
+					int endIndex = input.indexOf(suffix, index);
+					if (endIndex != -1) {
+						// 提取照片URL
+						String url = input.substring(index, endIndex + suffix.length());
+						input = input.replace(url,"");
+						if (".mp4".equals(suffix)) {
+							jwtdFfxcVO.setVideo(url);
+						} else {
+							file.add(url);
+						}
+					} else {
+						break;
+					}
+					// 查找下一个照片URL
+					index = input.indexOf("http://", endIndex);
+				}
+			}
+			jwtdFfxcVO.setFile(file);
+		}
 		return R.data(pages);
 	}
 
@@ -133,8 +168,10 @@ public class JwtdFfxcController extends BladeController {
 	@ApiOperationSupport(order = 4)
 	@Operation(summary = "新增", description  = "传入jwtdFfxc")
 	public R save(@Valid @RequestBody JwtdFfxcEntity jwtdFfxc) {
-		DictBiz byId = dictBizService.getById(jwtdFfxc.getXclxId());
-		jwtdFfxc.setJf(Integer.valueOf(byId.getRemark()));
+		DictBiz byId = dictBizService.selectFfxc(jwtdFfxc.getXclx());
+		if (byId != null) {
+			jwtdFfxc.setJf(Integer.valueOf(byId.getRemark()));
+		}
 		return R.status(jwtdFfxcService.save(jwtdFfxc));
 	}
 
@@ -145,6 +182,10 @@ public class JwtdFfxcController extends BladeController {
 	@ApiOperationSupport(order = 5)
 	@Operation(summary = "修改", description  = "传入jwtdFfxc")
 	public R update(@Valid @RequestBody JwtdFfxcEntity jwtdFfxc) {
+		DictBiz byId = dictBizService.selectFfxc(jwtdFfxc.getXclx());
+		if (byId != null) {
+			jwtdFfxc.setJf(Integer.valueOf(byId.getRemark()));
+		}
 		return R.status(jwtdFfxcService.updateById(jwtdFfxc));
 	}
 
@@ -184,5 +225,4 @@ public class JwtdFfxcController extends BladeController {
 		List<JwtdFfxcExcel> list = jwtdFfxcService.exportJwtdFfxc(queryWrapper);
 		ExcelUtil.export(response, "警务团队_防范宣传数据" + DateUtil.time(), "警务团队_防范宣传数据表", list, JwtdFfxcExcel.class);
 	}
-
 }

+ 3 - 1
src/main/java/org/springblade/modules/ffxc/mapper/JwtdFfxcMapper.java

@@ -49,7 +49,7 @@ public interface JwtdFfxcMapper extends BaseMapper<JwtdFfxcEntity> {
 	 * @param jwtdFfxc 查询参数
 	 * @return List<JwtdFfxcVO>
 	 */
-	List<JwtdFfxcVO> selectJwtdFfxcPage(IPage page, JwtdFfxcVO jwtdFfxc);
+	List<JwtdFfxcEntity> selectJwtdFfxcPage(IPage page, JwtdFfxcEntity jwtdFfxc);
 
 	/**
 	 * 获取导出数据
@@ -58,4 +58,6 @@ public interface JwtdFfxcMapper extends BaseMapper<JwtdFfxcEntity> {
 	 * @return List<JwtdFfxcExcel>
 	 */
 	List<JwtdFfxcExcel> exportJwtdFfxc(@Param("ew") Wrapper<JwtdFfxcEntity> queryWrapper);
+
+    JwtdFfxcEntity detailApp(JwtdFfxcEntity jwtdFfxc);
 }

+ 12 - 1
src/main/java/org/springblade/modules/ffxc/mapper/JwtdFfxcMapper.xml

@@ -14,8 +14,10 @@
     <select id="selectJwtdFfxcPage" resultMap="jwtdFfxcResultMap">
         select
             jf.*,
-            (select count(0) from jwtd_ffxc_llls jfl where jfl.ffxc_id = jf.id) as count
+            (select count(0) from jwtd_ffxc_llls jfl where jfl.ffxc_id = jf.id) as count,
+            bdb.dict_value as xclxmc
         from jwtd_ffxc jf
+        left join blade_dict_biz bdb on jf.xclx = bdb.dict_key and bdb.code = 'ffxclx'
         where jf.is_deleted = 0
         <if test="jwtdFfxc.xcbt != null and jwtdFfxc.xcbt != ''">
             and jf.xcbt like '%' || #{jwtdFfxc.xcbt} || '%'
@@ -31,4 +33,13 @@
     <select id="exportJwtdFfxc" resultType="org.springblade.modules.ffxc.excel.JwtdFfxcExcel">
         SELECT * FROM jwtd_ffxc ${ew.customSqlSegment}
     </select>
+
+    <select id="detailApp" resultMap="jwtdFfxcResultMap">
+        select
+            jf.*,
+            bdb.dict_value as xclxmc
+        from jwtd_ffxc jf
+        left join blade_dict_biz bdb on jf.xclx = bdb.dict_key and bdb.code = 'ffxclx'
+        where jf.id = #{id} and jf.is_deleted = 0
+    </select>
 </mapper>

+ 6 - 1
src/main/java/org/springblade/modules/ffxc/pojo/entity/JwtdFfxcEntity.java

@@ -32,6 +32,7 @@ import org.springblade.core.mp.base.BaseEntity;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.EqualsAndHashCode;
 import java.io.Serial;
+import java.util.List;
 
 /**
  * 警务团队_防范宣传 实体类
@@ -83,5 +84,9 @@ public class JwtdFfxcEntity extends BaseEntity {
 	@TableField(exist = false)
 	private Long userId;
 	@TableField(exist = false)
-	private Long xclxId;
+	private String xclxmc;
+	@TableField(exist = false)
+	private String video;
+	@TableField(exist = false)
+	private List<String> file;
 }

+ 3 - 1
src/main/java/org/springblade/modules/ffxc/service/IJwtdFfxcService.java

@@ -47,7 +47,7 @@ public interface IJwtdFfxcService extends BaseService<JwtdFfxcEntity> {
 	 * @param jwtdFfxc 查询参数
 	 * @return IPage<JwtdFfxcVO>
 	 */
-	IPage<JwtdFfxcVO> selectJwtdFfxcPage(IPage<JwtdFfxcVO> page, JwtdFfxcVO jwtdFfxc);
+	IPage<JwtdFfxcEntity> selectJwtdFfxcPage(IPage<JwtdFfxcEntity> page, JwtdFfxcEntity jwtdFfxc);
 
 	/**
 	 * 导出数据
@@ -56,4 +56,6 @@ public interface IJwtdFfxcService extends BaseService<JwtdFfxcEntity> {
 	 * @return List<JwtdFfxcExcel>
 	 */
 	List<JwtdFfxcExcel> exportJwtdFfxc(Wrapper<JwtdFfxcEntity> queryWrapper);
+
+	JwtdFfxcEntity detailApp(JwtdFfxcEntity jwtdFfxc);
 }

+ 6 - 1
src/main/java/org/springblade/modules/ffxc/service/impl/JwtdFfxcServiceImpl.java

@@ -46,7 +46,7 @@ import java.util.List;
 public class JwtdFfxcServiceImpl extends BaseServiceImpl<JwtdFfxcMapper, JwtdFfxcEntity> implements IJwtdFfxcService {
 
 	@Override
-	public IPage<JwtdFfxcVO> selectJwtdFfxcPage(IPage<JwtdFfxcVO> page, JwtdFfxcVO jwtdFfxc) {
+	public IPage<JwtdFfxcEntity> selectJwtdFfxcPage(IPage<JwtdFfxcEntity> page, JwtdFfxcEntity jwtdFfxc) {
 		return page.setRecords(baseMapper.selectJwtdFfxcPage(page, jwtdFfxc));
 	}
 
@@ -58,4 +58,9 @@ public class JwtdFfxcServiceImpl extends BaseServiceImpl<JwtdFfxcMapper, JwtdFfx
 		//});
 		return jwtdFfxcList;
 	}
+
+	@Override
+	public JwtdFfxcEntity detailApp(JwtdFfxcEntity jwtdFfxc) {
+		return baseMapper.detailApp(jwtdFfxc);
+	}
 }

+ 11 - 8
src/main/java/org/springblade/modules/ffxcLlls/controller/JwtdFfxcLllsController.java

@@ -129,13 +129,8 @@ public class JwtdFfxcLllsController extends BladeController {
 	@ApiOperationSupport(order = 5)
 	@Operation(summary = "修改", description  = "传入jwtdFfxcLlls")
 	public R update(@Valid @RequestBody JwtdFfxcLllsEntity jwtdFfxcLlls) {
-		JwtdJfjlEntity jwtdJfjl = new JwtdJfjlEntity();
-		jwtdJfjl.setUserId(AuthUtil.getUserId());
-		jwtdJfjl.setType("1");
-		jwtdJfjl.setJfId(jwtdFfxcLlls.getFfxcId());
-		jwtdJfjl.setJf(jwtdFfxcLlls.getJf());
-		jwtdJfjlService.save(jwtdJfjl);
-		jwtdFfxcLlls.setUserId(AuthUtil.getUserId());
+		//jwtdFfxcLlls.setUserId(AuthUtil.getUserId());
+		jwtdFfxcLlls.setUserId(Long.valueOf("1123598821738675201"));
 		List<JwtdFfxcLllsEntity> llls = jwtdFfxcLllsService.selectLllsByUserIdAndFfxcId(jwtdFfxcLlls);
 		for (JwtdFfxcLllsEntity ryls : llls) {
 			if (ryls.getLlzt().equals("1") && ryls.getJf() != 0) {
@@ -144,11 +139,19 @@ public class JwtdFfxcLllsController extends BladeController {
 			}
 		}
 		if (jwtdFfxcLlls.getJf() != 0) {
-			User user = userService.getById(AuthUtil.getUserId());
+			User user = userService.getById(Long.valueOf("1123598821738675201"));
 			Integer jf = user.getJf() + jwtdFfxcLlls.getJf();
 			user.setJf(jf);
 			userService.updateById(user);
+			JwtdJfjlEntity jwtdJfjl = new JwtdJfjlEntity();
+			jwtdJfjl.setUserId(AuthUtil.getUserId());
+			jwtdJfjl.setType("1");
+			jwtdJfjl.setJfId(jwtdFfxcLlls.getFfxcId());
+			jwtdJfjl.setJf(jwtdFfxcLlls.getJf());
+			jwtdJfjlService.save(jwtdJfjl);
 		}
+		Long id = jwtdFfxcLllsService.selectNewId(jwtdFfxcLlls);
+		jwtdFfxcLlls.setId(id);
 		return R.status(jwtdFfxcLllsService.updateById(jwtdFfxcLlls));
 	}
 

+ 2 - 0
src/main/java/org/springblade/modules/ffxcLlls/mapper/JwtdFfxcLllsMapper.java

@@ -63,4 +63,6 @@ public interface JwtdFfxcLllsMapper extends BaseMapper<JwtdFfxcLllsEntity> {
     List<JwtdFfxcEntity> getFfxcLljl(Long id);
 
 	List<JwtdFfxcLllsEntity> selectLllsByUserIdAndFfxcId(JwtdFfxcLllsEntity jwtdFfxcLlls);
+
+	Long selectNewId(JwtdFfxcLllsEntity jwtdFfxcLlls);
 }

+ 4 - 0
src/main/java/org/springblade/modules/ffxcLlls/mapper/JwtdFfxcLllsMapper.xml

@@ -31,4 +31,8 @@
     <select id="selectLllsByUserIdAndFfxcId" resultMap="jwtdFfxcLllsResultMap">
         select * from jwtd_ffxc_llls where is_deleted = 0 and user_id = #{userId} and ffxc_id = #{ffxcId}
     </select>
+
+    <select id="selectNewId" resultType="java.lang.Long">
+        select id from jwtd_ffxc_llls where is_deleted = 0 and user_id = #{userId} and ffxc_id = #{ffxcId} order by create_time desc limit 1
+    </select>
 </mapper>

+ 2 - 0
src/main/java/org/springblade/modules/ffxcLlls/service/IJwtdFfxcLllsService.java

@@ -61,4 +61,6 @@ public interface IJwtdFfxcLllsService extends BaseService<JwtdFfxcLllsEntity> {
     List<JwtdFfxcEntity> getFfxcLljl(Long id);
 
 	List<JwtdFfxcLllsEntity> selectLllsByUserIdAndFfxcId(JwtdFfxcLllsEntity jwtdFfxcLlls);
+
+	Long selectNewId(JwtdFfxcLllsEntity jwtdFfxcLlls);
 }

+ 5 - 0
src/main/java/org/springblade/modules/ffxcLlls/service/impl/JwtdFfxcLllsServiceImpl.java

@@ -70,4 +70,9 @@ public class JwtdFfxcLllsServiceImpl extends BaseServiceImpl<JwtdFfxcLllsMapper,
 		return baseMapper.selectLllsByUserIdAndFfxcId(jwtdFfxcLlls);
 	}
 
+	@Override
+	public Long selectNewId(JwtdFfxcLllsEntity jwtdFfxcLlls) {
+		return baseMapper.selectNewId(jwtdFfxcLlls);
+	}
+
 }

+ 170 - 0
src/main/java/org/springblade/modules/jwtdGwc/controller/JwtdGwcController.java

@@ -0,0 +1,170 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.jwtdGwc.controller;
+
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import jakarta.validation.Valid;
+
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.annotation.PreAuth;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.jwtdGwc.pojo.entity.JwtdGwcEntity;
+import org.springblade.modules.jwtdGwc.pojo.vo.JwtdGwcVO;
+import org.springblade.modules.jwtdGwc.excel.JwtdGwcExcel;
+import org.springblade.modules.jwtdGwc.wrapper.JwtdGwcWrapper;
+import org.springblade.modules.jwtdGwc.service.IJwtdGwcService;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.tool.constant.BladeConstant;
+import org.springblade.core.tool.constant.RoleConstant;
+import java.util.Map;
+import java.util.List;
+import jakarta.servlet.http.HttpServletResponse;
+
+/**
+ * 警务团队_购物车 控制器
+ *
+ * @author BladeX
+ * @since 2024-11-19
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/jwtdGwc")
+@Tag(name = "警务团队_购物车", description = "警务团队_购物车接口")
+public class JwtdGwcController extends BladeController {
+
+	private final IJwtdGwcService jwtdGwcService;
+
+	/**
+	 * 警务团队_购物车 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@Operation(summary = "详情", description  = "传入jwtdGwc")
+	public R<JwtdGwcVO> detail(JwtdGwcEntity jwtdGwc) {
+		JwtdGwcEntity detail = jwtdGwcService.getOne(Condition.getQueryWrapper(jwtdGwc));
+		return R.data(JwtdGwcWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 警务团队_购物车 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@Operation(summary = "分页", description  = "传入jwtdGwc")
+	public R<IPage<JwtdGwcVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> jwtdGwc, Query query) {
+		IPage<JwtdGwcEntity> pages = jwtdGwcService.page(Condition.getPage(query), Condition.getQueryWrapper(jwtdGwc, JwtdGwcEntity.class));
+		return R.data(JwtdGwcWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 警务团队_购物车 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@Operation(summary = "分页", description  = "传入jwtdGwc")
+	public R<IPage<JwtdGwcVO>> page(JwtdGwcVO jwtdGwc, Query query) {
+		IPage<JwtdGwcVO> pages = jwtdGwcService.selectJwtdGwcPage(Condition.getPage(query), jwtdGwc);
+		return R.data(pages);
+	}
+
+	/**
+	 * 警务团队_购物车 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@Operation(summary = "新增", description  = "传入jwtdGwc")
+	public R save(@Valid @RequestBody JwtdGwcEntity jwtdGwc) {
+		List<JwtdGwcEntity> list = jwtdGwcService.selectSp(jwtdGwc);
+		if (list.size() > 0) {
+			return R.data("购物车已有此物品");
+		}
+		return R.status(jwtdGwcService.save(jwtdGwc));
+	}
+
+	/**
+	 * 警务团队_购物车 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@Operation(summary = "修改", description  = "传入jwtdGwc")
+	public R update(@Valid @RequestBody JwtdGwcEntity jwtdGwc) {
+		return R.status(jwtdGwcService.updateById(jwtdGwc));
+	}
+
+	/**
+	 * 警务团队_购物车 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@Operation(summary = "新增或修改", description  = "传入jwtdGwc")
+	public R submit(@Valid @RequestBody JwtdGwcEntity jwtdGwc) {
+		return R.status(jwtdGwcService.saveOrUpdate(jwtdGwc));
+	}
+
+	/**
+	 * 警务团队_购物车 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@Operation(summary = "逻辑删除", description  = "传入ids")
+	public R remove(@RequestParam List<JwtdGwcEntity> jwtdGwc) {
+		for (JwtdGwcEntity gwc : jwtdGwc) {
+			jwtdGwcService.updateIsDeleted(gwc);
+		}
+		return R.data("操作成功");
+	}
+
+	/**
+	 * 导出数据
+	 */
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
+	@GetMapping("/export-jwtdGwc")
+	@ApiOperationSupport(order = 8)
+	@Operation(summary = "导出数据", description  = "传入jwtdGwc")
+	public void exportJwtdGwc(@Parameter(hidden = true) @RequestParam Map<String, Object> jwtdGwc, BladeUser bladeUser, HttpServletResponse response) {
+		QueryWrapper<JwtdGwcEntity> queryWrapper = Condition.getQueryWrapper(jwtdGwc, JwtdGwcEntity.class);
+		//if (!AuthUtil.isAdministrator()) {
+		//	queryWrapper.lambda().eq(JwtdGwcEntity::getTenantId, bladeUser.getTenantId());
+		//}
+		//queryWrapper.lambda().eq(JwtdGwcEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
+		List<JwtdGwcExcel> list = jwtdGwcService.exportJwtdGwc(queryWrapper);
+		ExcelUtil.export(response, "警务团队_购物车数据" + DateUtil.time(), "警务团队_购物车数据表", list, JwtdGwcExcel.class);
+	}
+
+}

+ 67 - 0
src/main/java/org/springblade/modules/jwtdGwc/excel/JwtdGwcExcel.java

@@ -0,0 +1,67 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.jwtdGwc.excel;
+
+
+import lombok.Data;
+
+import java.io.Serializable;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import java.io.Serial;
+
+
+/**
+ * 警务团队_购物车 Excel实体类
+ *
+ * @author BladeX
+ * @since 2024-11-19
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class JwtdGwcExcel implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 用户id
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("用户id")
+	private Long userId;
+	/**
+	 * 商品id
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("商品id")
+	private Long spId;
+
+}

+ 65 - 0
src/main/java/org/springblade/modules/jwtdGwc/mapper/JwtdGwcMapper.java

@@ -0,0 +1,65 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.jwtdGwc.mapper;
+
+import org.springblade.modules.jwtdGwc.pojo.entity.JwtdGwcEntity;
+import org.springblade.modules.jwtdGwc.pojo.vo.JwtdGwcVO;
+import org.springblade.modules.jwtdGwc.excel.JwtdGwcExcel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
+/**
+ * 警务团队_购物车 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-11-19
+ */
+public interface JwtdGwcMapper extends BaseMapper<JwtdGwcEntity> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page 分页参数
+	 * @param jwtdGwc 查询参数
+	 * @return List<JwtdGwcVO>
+	 */
+	List<JwtdGwcVO> selectJwtdGwcPage(IPage page, JwtdGwcVO jwtdGwc);
+
+	/**
+	 * 获取导出数据
+	 *
+	 * @param queryWrapper 查询条件
+	 * @return List<JwtdGwcExcel>
+	 */
+	List<JwtdGwcExcel> exportJwtdGwc(@Param("ew") Wrapper<JwtdGwcEntity> queryWrapper);
+
+	void updateIsDeleted(JwtdGwcEntity jwtdGwc);
+
+	List<JwtdGwcEntity> selectSp(JwtdGwcEntity jwtdGwc);
+}

+ 34 - 0
src/main/java/org/springblade/modules/jwtdGwc/mapper/JwtdGwcMapper.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.jwtdGwc.mapper.JwtdGwcMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="jwtdGwcResultMap" type="org.springblade.modules.jwtdGwc.pojo.entity.JwtdGwcEntity">
+        <result column="user_id" property="userId"/>
+        <result column="sp_id" property="spId"/>
+    </resultMap>
+
+    <select id="selectJwtdGwcPage" resultMap="jwtdGwcResultMap">
+        select
+            jg.sp_id,
+            js.spmc,
+            js.spkcl,
+            js.spzp,
+            js.dhsxjf
+        from jwtd_gwc jg
+        left join jwtd_spgl js on jg.sp_id = js.id
+        where js.is_deleted = 0 and jg.is_deleted = 0 and js.spzt = '1' and jg.user_id = #{jwtdGwc.userId}
+    </select>
+
+    <select id="exportJwtdGwc" resultType="org.springblade.modules.jwtdGwc.excel.JwtdGwcExcel">
+        SELECT * FROM jwtd_gwc ${ew.customSqlSegment}
+    </select>
+
+    <update id="updateIsDeleted">
+        update jwtd_gwc set is_deleted = 1 where user_id = #{userId} and sp_id = #{spId}
+    </update>
+
+    <select id="selectSp" resultMap="jwtdGwcResultMap">
+        select * from jwtd_gwc where is_deleted = 0 and user_id = #{userId} and sp_id = #{spId}
+    </select>
+</mapper>

+ 45 - 0
src/main/java/org/springblade/modules/jwtdGwc/pojo/dto/JwtdGwcDTO.java

@@ -0,0 +1,45 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.jwtdGwc.pojo.dto;
+
+import org.springblade.modules.jwtdGwc.pojo.entity.JwtdGwcEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.io.Serial;
+
+/**
+ * 警务团队_购物车 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2024-11-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class JwtdGwcDTO extends JwtdGwcEntity {
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+}

+ 70 - 0
src/main/java/org/springblade/modules/jwtdGwc/pojo/entity/JwtdGwcEntity.java

@@ -0,0 +1,70 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.jwtdGwc.pojo.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import io.swagger.v3.oas.annotations.media.Schema;
+import org.springblade.core.mp.base.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.tenant.mp.TenantEntity;
+import lombok.EqualsAndHashCode;
+import java.io.Serial;
+
+/**
+ * 警务团队_购物车 实体类
+ *
+ * @author BladeX
+ * @since 2024-11-19
+ */
+@Data
+@TableName("jwtd_gwc")
+@Schema(description = "JwtdGwcEntity对象")
+@EqualsAndHashCode(callSuper = true)
+public class JwtdGwcEntity extends BaseEntity {
+
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 用户id
+	 */
+	@Schema(description = "用户id")
+	private Long userId;
+	/**
+	 * 商品id
+	 */
+	@Schema(description = "商品id")
+	private Long spId;
+	@TableField(exist = false)
+	private String spmc;
+	@TableField(exist = false)
+	private Integer spkcl;
+	@TableField(exist = false)
+	private String spzp;
+	@TableField(exist = false)
+	private Integer dhsxjf;
+}

+ 45 - 0
src/main/java/org/springblade/modules/jwtdGwc/pojo/vo/JwtdGwcVO.java

@@ -0,0 +1,45 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.jwtdGwc.pojo.vo;
+
+import org.springblade.modules.jwtdGwc.pojo.entity.JwtdGwcEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.io.Serial;
+
+/**
+ * 警务团队_购物车 视图实体类
+ *
+ * @author BladeX
+ * @since 2024-11-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class JwtdGwcVO extends JwtdGwcEntity {
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+}

+ 63 - 0
src/main/java/org/springblade/modules/jwtdGwc/service/IJwtdGwcService.java

@@ -0,0 +1,63 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.jwtdGwc.service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import org.springblade.modules.jwtdGwc.pojo.entity.JwtdGwcEntity;
+import org.springblade.modules.jwtdGwc.pojo.vo.JwtdGwcVO;
+import org.springblade.modules.jwtdGwc.excel.JwtdGwcExcel;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import java.util.List;
+
+/**
+ * 警务团队_购物车 服务类
+ *
+ * @author BladeX
+ * @since 2024-11-19
+ */
+public interface IJwtdGwcService extends BaseService<JwtdGwcEntity> {
+	/**
+	 * 自定义分页
+	 *
+	 * @param page 分页参数
+	 * @param jwtdGwc 查询参数
+	 * @return IPage<JwtdGwcVO>
+	 */
+	IPage<JwtdGwcVO> selectJwtdGwcPage(IPage<JwtdGwcVO> page, JwtdGwcVO jwtdGwc);
+
+	/**
+	 * 导出数据
+	 *
+	 * @param queryWrapper 查询条件
+	 * @return List<JwtdGwcExcel>
+	 */
+	List<JwtdGwcExcel> exportJwtdGwc(Wrapper<JwtdGwcEntity> queryWrapper);
+
+	void updateIsDeleted(JwtdGwcEntity jwtdGwc);
+
+	List<JwtdGwcEntity> selectSp(JwtdGwcEntity jwtdGwc);
+}

+ 72 - 0
src/main/java/org/springblade/modules/jwtdGwc/service/impl/JwtdGwcServiceImpl.java

@@ -0,0 +1,72 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.jwtdGwc.service.impl;
+
+import org.springblade.modules.jwtdGwc.pojo.entity.JwtdGwcEntity;
+import org.springblade.modules.jwtdGwc.pojo.vo.JwtdGwcVO;
+import org.springblade.modules.jwtdGwc.excel.JwtdGwcExcel;
+import org.springblade.modules.jwtdGwc.mapper.JwtdGwcMapper;
+import org.springblade.modules.jwtdGwc.service.IJwtdGwcService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import java.util.List;
+
+/**
+ * 警务团队_购物车 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-11-19
+ */
+@Service
+public class JwtdGwcServiceImpl extends BaseServiceImpl<JwtdGwcMapper, JwtdGwcEntity> implements IJwtdGwcService {
+
+	@Override
+	public IPage<JwtdGwcVO> selectJwtdGwcPage(IPage<JwtdGwcVO> page, JwtdGwcVO jwtdGwc) {
+		return page.setRecords(baseMapper.selectJwtdGwcPage(page, jwtdGwc));
+	}
+
+	@Override
+	public List<JwtdGwcExcel> exportJwtdGwc(Wrapper<JwtdGwcEntity> queryWrapper) {
+		List<JwtdGwcExcel> jwtdGwcList = baseMapper.exportJwtdGwc(queryWrapper);
+		//jwtdGwcList.forEach(jwtdGwc -> {
+		//	jwtdGwc.setTypeName(DictCache.getValue(DictEnum.YES_NO, JwtdGwcEntity.getType()));
+		//});
+		return jwtdGwcList;
+	}
+
+	@Override
+	public void updateIsDeleted(JwtdGwcEntity jwtdGwc) {
+		baseMapper.updateIsDeleted(jwtdGwc);
+	}
+
+	@Override
+	public List<JwtdGwcEntity> selectSp(JwtdGwcEntity jwtdGwc) {
+		return baseMapper.selectSp(jwtdGwc);
+	}
+
+}

+ 58 - 0
src/main/java/org/springblade/modules/jwtdGwc/wrapper/JwtdGwcWrapper.java

@@ -0,0 +1,58 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.jwtdGwc.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.jwtdGwc.pojo.entity.JwtdGwcEntity;
+import org.springblade.modules.jwtdGwc.pojo.vo.JwtdGwcVO;
+import java.util.Objects;
+
+/**
+ * 警务团队_购物车 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2024-11-19
+ */
+public class JwtdGwcWrapper extends BaseEntityWrapper<JwtdGwcEntity, JwtdGwcVO>  {
+
+	public static JwtdGwcWrapper build() {
+		return new JwtdGwcWrapper();
+ 	}
+
+	@Override
+	public JwtdGwcVO entityVO(JwtdGwcEntity jwtdGwc) {
+		JwtdGwcVO jwtdGwcVO = Objects.requireNonNull(BeanUtil.copyProperties(jwtdGwc, JwtdGwcVO.class));
+
+		//User createUser = UserCache.getUser(jwtdGwc.getCreateUser());
+		//User updateUser = UserCache.getUser(jwtdGwc.getUpdateUser());
+		//jwtdGwcVO.setCreateUserName(createUser.getName());
+		//jwtdGwcVO.setUpdateUserName(updateUser.getName());
+
+		return jwtdGwcVO;
+	}
+
+}

+ 18 - 1
src/main/java/org/springblade/modules/jwtdJfjl/controller/JwtdJfjlController.java

@@ -39,6 +39,7 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.jwtdSpglDhjl.pojo.vo.JfVO;
 import org.springblade.modules.system.pojo.entity.User;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -167,7 +168,7 @@ public class JwtdJfjlController extends BladeController {
 	 */
 	@GetMapping("getJlList")
 	public R getJlList(String type) {
-		return R.data(jwtdJfjlService.getJlList(type, AuthUtil.getUserId()));
+		return R.data(jwtdJfjlService.getJlList(type, Long.valueOf("1123598821738675201")));
 	}
 
 	/**
@@ -185,4 +186,20 @@ public class JwtdJfjlController extends BladeController {
 	public R getDhjl(Long userId) {
 		return R.data(jwtdJfjlService.getDhjl(userId));
 	}
+
+	/**
+	 * 积分面板
+	 */
+	@GetMapping("getJfmb")
+	public R getJfmb(Long deptId) {
+		JfVO jfVO = new JfVO();
+		Integer dhjf = jwtdJfjlService.getDhjf(deptId);
+		Integer jf = jwtdJfjlService.getJf(deptId);
+		if (dhjf != null) {
+			jfVO.setZjf(dhjf + jf);
+			jfVO.setDhjf(dhjf);
+		}
+		jfVO.setJf(jf);
+		return R.data(jfVO);
+	}
 }

+ 4 - 0
src/main/java/org/springblade/modules/jwtdJfjl/mapper/JwtdJfjlMapper.java

@@ -64,4 +64,8 @@ public interface JwtdJfjlMapper extends BaseMapper<JwtdJfjlEntity> {
 	List<JwtdJfjlEntity> getHqjl(Long userId);
 
 	List<JwtdJfjlEntity> getDhjl(Long userId);
+
+	Integer getDhjf(Long deptId);
+
+	Integer getJf(Long deptId);
 }

+ 29 - 1
src/main/java/org/springblade/modules/jwtdJfjl/mapper/JwtdJfjlMapper.xml

@@ -22,9 +22,18 @@
             bu.jf
         FROM
             blade_user bu
-        LEFT JOIN jwtd_jfjl jj ON bu.id = jj.user_id AND jj.type = '2'
+        LEFT JOIN jwtd_jfjl jj ON bu.id = jj.user_id
         WHERE
             bu.is_deleted = 0
+        <if test="jwtdJfjl.name != null and jwtdJfjl.name != ''">
+            and bu.name = #{jwtdJfjl.name}
+        </if>
+        <if test="jwtdJfjl.sfzh != null and jwtdJfjl.sfzh != ''">
+            and bu.sfzh = #{jwtdJfjl.sfzh}
+        </if>
+        <if test="jwtdJfjl.phone != null and jwtdJfjl.phone != ''">
+            and bu.phone = #{jwtdJfjl.phone}
+        </if>
         GROUP BY
             bu.id,
             bu.name,
@@ -42,6 +51,7 @@
         select
             case when jf.xcbt is null then js.spmc when js.spmc is null then jf.xcbt end as name,
             jj.create_time,
+            jj.type,
             jj.jf,
             jsd.ddbh
         from jwtd_jfjl jj
@@ -89,4 +99,22 @@
             jsd.update_time,
             bu.name
     </select>
+
+    <select id="getDhjf" resultType="java.lang.Integer">
+        SELECT
+            sum(jj.jf) as dhjf
+        FROM
+            jwtd_jfjl jj
+        LEFT JOIN blade_dept bd ON jj.create_dept = bd.ID
+        LEFT JOIN blade_user bu ON jj.create_user = bu.ID
+        WHERE jj.is_deleted = 0 and bu.is_deleted = 0 and bd.ancestors like '%' || #{deptId} || '%' and jj.type = '2'
+    </select>
+
+    <select id="getJf" resultType="java.lang.Integer">
+        select
+            sum(bu.jf) as jf
+        from blade_user bu
+        left join blade_dept bd on bu.dept_id :: int8 = bd.id
+        where bu.is_deleted = 0 and bd.ancestors like '%' || #{deptId} || '%'
+    </select>
 </mapper>

+ 4 - 0
src/main/java/org/springblade/modules/jwtdJfjl/service/IJwtdJfjlService.java

@@ -62,4 +62,8 @@ public interface IJwtdJfjlService extends BaseService<JwtdJfjlEntity> {
 	List<JwtdJfjlEntity> getHqjl(Long userId);
 
 	List<JwtdJfjlEntity> getDhjl(Long userId);
+
+	Integer getDhjf(Long deptId);
+
+	Integer getJf(Long deptId);
 }

+ 10 - 0
src/main/java/org/springblade/modules/jwtdJfjl/service/impl/JwtdJfjlServiceImpl.java

@@ -74,4 +74,14 @@ public class JwtdJfjlServiceImpl extends BaseServiceImpl<JwtdJfjlMapper, JwtdJfj
 		return baseMapper.getDhjl(userId);
 	}
 
+	@Override
+	public Integer getDhjf(Long deptId) {
+		return baseMapper.getDhjf(deptId);
+	}
+
+	@Override
+	public Integer getJf(Long deptId) {
+		return baseMapper.getJf(deptId);
+	}
+
 }

+ 15 - 7
src/main/java/org/springblade/modules/jwtdJwgk/mapper/JwtdJwgkMapper.xml

@@ -18,6 +18,7 @@
 
     <select id="selectJwtdJwgkPage" resultMap="jwtdJwgkResultMap">
         select
+            bu.id,
             bu.name,
             bu.sex,
             bu.jh,
@@ -25,30 +26,37 @@
             bu.gxsq_id,
             bu.jws_id,
             bu.pcs_id,
+            bu.zp,
+            bu.zwlb,
+            bu.gzzz,
             bd.dept_name as ssdwMc,
             gxsq.dept_name as gxsqMc,
-            jj.jwsmc
+            jj.jwsmc,
+            zwbdb.dict_value as zwlbmc,
+            gzbdb.dict_value as gzzzmc
         from jwtd_jwgk bu
         left join blade_dept bd on bd.id = bu.pcs_id
         left join blade_dept gxsq on gxsq.id = bu.gxsq_id
         left join jdrh.jlrh_jws jj on jj.id = bu.jws_id
+        left join blade_dict_biz zwbdb on bu.zwlb = zwbdb.dict_key and zwbdb.code = 'zwlb'
+        left join blade_dict_biz gzbdb on bu.gzzz = gzbdb.dict_key and gzbdb.code = 'gwzz'
         where bu.is_deleted = 0
         <if test="jwtdJwgk.name != null and jwtdJwgk.name != ''">
-            and bu.name = #{jwtdJwgk.name}
+            and bu.name like '%' || #{jwtdJwgk.name} || '%'
         </if>
-        <if test="jwtdJwgk.sex != null and jwtdJwgk.sex = ''">
+        <if test="jwtdJwgk.sex != null and jwtdJwgk.sex != ''">
             and bu.sex = #{jwtdJwgk.sex}
         </if>
-        <if test="jwtdJwgk.phone != null and jwtdJwgk.phone = ''">
+        <if test="jwtdJwgk.phone != null and jwtdJwgk.phone != ''">
             and bu.phone = #{jwtdJwgk.phone}
         </if>
-        <if test="jwtdJwgk.pcsId != null and jwtdJwgk.pcsId = ''">
+        <if test="jwtdJwgk.pcsId != null and jwtdJwgk.pcsId != ''">
             and bu.pcs_id = #{jwtdJwgk.pcsId}
         </if>
-        <if test="jwtdJwgk.jwsId != null and jwtdJwgk.jwsId = ''">
+        <if test="jwtdJwgk.jwsId != null and jwtdJwgk.jwsId != ''">
             and bu.jws_id = #{jwtdJwgk.jwsId}
         </if>
-        <if test="jwtdJwgk.gxsqId != null and jwtdJwgk.gxsqId = ''">
+        <if test="jwtdJwgk.gxsqId != null and jwtdJwgk.gxsqId != ''">
             and bu.gxsq_id = #{jwtdJwgk.gxsqId}
         </if>
     </select>

+ 4 - 0
src/main/java/org/springblade/modules/jwtdJwgk/pojo/entity/JwtdJwgkEntity.java

@@ -107,4 +107,8 @@ public class JwtdJwgkEntity extends BaseEntity {
 	private String gxsqMc;
 	@TableField(exist = false)
 	private String jwsmc;
+	@TableField(exist = false)
+	private String zwlbmc;
+	@TableField(exist = false)
+	private String gzzzmc;
 }

+ 34 - 4
src/main/java/org/springblade/modules/jwtdSpgl/controller/JwtdSpglController.java

@@ -80,7 +80,9 @@ public class JwtdSpglController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	@Operation(summary = "详情", description  = "传入jwtdSpgl")
 	public R<JwtdSpglVO> detail(JwtdSpglEntity jwtdSpgl) {
-		JwtdSpglEntity detail = jwtdSpglService.getOne(Condition.getQueryWrapper(jwtdSpgl));
+		JwtdSpglEntity detail = jwtdSpglService.getById(jwtdSpgl.getId());
+		String xz = jwtdSpglService.selectXz(detail.getLqdd());
+		detail.setXz(xz);
 		List<JwtdSpglBhjlEntity> bhjlList = jwtdSpglBhjlService.selectBhjl(jwtdSpgl.getId());
 		detail.setBhjlList(bhjlList);
 		return R.data(JwtdSpglWrapper.build().entityVO(detail));
@@ -104,8 +106,27 @@ public class JwtdSpglController extends BladeController {
 	@GetMapping("/page")
 	@ApiOperationSupport(order = 3)
 	@Operation(summary = "分页", description  = "传入jwtdSpgl")
-	public R<IPage<JwtdSpglVO>> page(JwtdSpglVO jwtdSpgl, Query query) {
-		IPage<JwtdSpglVO> pages = jwtdSpglService.selectJwtdSpglPage(Condition.getPage(query), jwtdSpgl);
+	public R<IPage<JwtdSpglEntity>> page(JwtdSpglEntity jwtdSpgl, Query query) {
+		IPage<JwtdSpglEntity> pages = jwtdSpglService.selectJwtdSpglPage(Condition.getPage(query), jwtdSpgl);
+		for (JwtdSpglEntity spgl : pages.getRecords()) {
+			List<JwtdSpglBhjlEntity> bhjl = jwtdSpglBhjlService.selectBhjl(spgl.getId());
+			spgl.setBhjlList(bhjl);
+		}
+		return R.data(pages);
+	}
+
+	/**
+	 * 警务团队_商品管理 自定义分页
+	 */
+	@GetMapping("/pageApp")
+	@ApiOperationSupport(order = 3)
+	@Operation(summary = "分页", description  = "传入jwtdSpgl")
+	public R<IPage<JwtdSpglEntity>> pageApp(JwtdSpglEntity jwtdSpgl, Query query) {
+		IPage<JwtdSpglEntity> pages = jwtdSpglService.selectJwtdSpglPageApp(Condition.getPage(query), jwtdSpgl);
+		for (JwtdSpglEntity spgl : pages.getRecords()) {
+			List<JwtdSpglBhjlEntity> bhjl = jwtdSpglBhjlService.selectBhjl(spgl.getId());
+			spgl.setBhjlList(bhjl);
+		}
 		return R.data(pages);
 	}
 
@@ -180,6 +201,15 @@ public class JwtdSpglController extends BladeController {
 		jwtdSpglBhjl.setKcl(jwtdSpgl.getSpkcl() + jwtdSpgl.getBhl());
 		jwtdSpglBhjl.setBhl(jwtdSpgl.getBhl());
 		jwtdSpglBhjlService.save(jwtdSpglBhjl);
-		return R.status(jwtdSpglService.updateById(jwtdSpgl));
+		jwtdSpgl.setSpkcl(jwtdSpgl.getSpkcl() + jwtdSpgl.getBhl());
+		return R.status(jwtdSpglService.updateSpbh(jwtdSpgl));
+	}
+
+	/**
+	 * 商品下架
+	 */
+	@PostMapping("spxj")
+	public R spxj(@RequestBody JwtdSpglEntity jwtdSpgl) {
+		return R.data(jwtdSpglService.updateSpxj(jwtdSpgl));
 	}
 }

+ 10 - 1
src/main/java/org/springblade/modules/jwtdSpgl/mapper/JwtdSpglMapper.java

@@ -49,7 +49,7 @@ public interface JwtdSpglMapper extends BaseMapper<JwtdSpglEntity> {
 	 * @param jwtdSpgl 查询参数
 	 * @return List<JwtdSpglVO>
 	 */
-	List<JwtdSpglVO> selectJwtdSpglPage(IPage page, JwtdSpglVO jwtdSpgl);
+	List<JwtdSpglEntity> selectJwtdSpglPage(IPage page, JwtdSpglEntity jwtdSpgl);
 
 	/**
 	 * 获取导出数据
@@ -59,4 +59,13 @@ public interface JwtdSpglMapper extends BaseMapper<JwtdSpglEntity> {
 	 */
 	List<JwtdSpglExcel> exportJwtdSpgl(@Param("ew") Wrapper<JwtdSpglEntity> queryWrapper);
 
+	boolean updateSpxj(JwtdSpglEntity jwtdSpgl);
+
+	boolean updateSpbh(JwtdSpglEntity jwtdSpgl);
+
+	IPage<JwtdSpglEntity> selectJwtdSpglPageApp(IPage<Object> page, JwtdSpglEntity jwtdSpgl);
+
+	void updateSpzt(Long id);
+
+	String selectXz(String lqdd);
 }

+ 42 - 7
src/main/java/org/springblade/modules/jwtdSpgl/mapper/JwtdSpglMapper.xml

@@ -16,17 +16,19 @@
 
     <select id="selectJwtdSpglPage" resultMap="jwtdSpglResultMap">
         select
-            *
-        from jwtd_spgl
-        where is_deleted = 0
+            js.*,
+            rd.xz
+        from jwtd_spgl js
+        left join sspt.rk_dzxx rd on js.lqdd = rd.dzbm
+        where js.is_deleted = 0
         <if test="jwtdSpgl.spmc != null and jwtdSpgl.spmc != ''">
-            and (spmc like '%' || #{jwtdSpgl.spmc} || '%' or id :: text = #{jwtdSpgl.spmc})
+            and (js.spmc like '%' || #{jwtdSpgl.spmc} || '%' or js.id :: text = #{jwtdSpgl.spmc})
         </if>
-        <if test="jwtdSpgl.dhsxjf != null and jwtdSpgl.dhsxjf != ''">
-            and dhsxjf between #{jwtdSpgl.minJf} and #{jwtdSpgl.maxJf}
+        <if test="jwtdSpgl.minJf != null and jwtdSpgl.minJf != '' and jwtdSpgl.maxJf != null and jwtdSpgl.maxJf != ''">
+            and js.dhsxjf :: int8  between #{jwtdSpgl.minJf} :: int8  and #{jwtdSpgl.maxJf} :: int8
         </if>
         <if test="jwtdSpgl.spzt != null and jwtdSpgl.spzt != ''">
-            and spzt = #{jwtdSpgl.spzt}
+            and js.spzt = #{jwtdSpgl.spzt}
         </if>
     </select>
 
@@ -34,4 +36,37 @@
         SELECT * FROM jwtd_spgl ${ew.customSqlSegment}
     </select>
 
+    <update id="updateSpxj">
+        update jwtd_spgl set spzt = '3' where id = #{id}
+    </update>
+
+    <update id="updateSpbh">
+        update jwtd_spgl set spzt = '1', spkcl = #{spkcl} where id = #{id}
+    </update>
+
+    <select id="selectJwtdSpglPageApp" resultMap="jwtdSpglResultMap">
+        select
+            js.*,
+            rd.xz
+        from jwtd_spgl js
+        left join sspt.rk_dzxx rd on js.lqdd = rd.dzbm
+        where js.is_deleted = 0 and js.spzt = '1'
+        <if test="jwtdSpgl.spmc != null and jwtdSpgl.spmc != ''">
+            and (js.spmc like '%' || #{jwtdSpgl.spmc} || '%' or js.id :: text = #{jwtdSpgl.spmc})
+        </if>
+        <if test="jwtdSpgl.minJf != null and jwtdSpgl.minJf != '' and jwtdSpgl.maxJf != null and jwtdSpgl.maxJf != ''">
+            and js.dhsxjf :: int8  between #{jwtdSpgl.minJf} :: int8  and #{jwtdSpgl.maxJf} :: int8
+        </if>
+        <if test="jwtdSpgl.spzt != null and jwtdSpgl.spzt != ''">
+            and js.spzt = #{jwtdSpgl.spzt}
+        </if>
+    </select>
+
+    <update id="updateSpzt">
+        update jwtd_spgl set spzt = '2' where id = #{id}
+    </update>
+
+    <select id="selectXz" resultType="java.lang.String">
+        select xz from sspt.rk_dzxx where dzbm = #{lqdd}
+    </select>
 </mapper>

+ 2 - 0
src/main/java/org/springblade/modules/jwtdSpgl/pojo/entity/JwtdSpglEntity.java

@@ -107,4 +107,6 @@ public class JwtdSpglEntity extends BaseEntity {
 	private Integer minJf;
 	@TableField(exist = false)
 	private Integer maxJf;
+	@TableField(exist = false)
+	private String xz;
 }

+ 10 - 1
src/main/java/org/springblade/modules/jwtdSpgl/service/IJwtdSpglService.java

@@ -47,7 +47,7 @@ public interface IJwtdSpglService extends BaseService<JwtdSpglEntity> {
 	 * @param jwtdSpgl 查询参数
 	 * @return IPage<JwtdSpglVO>
 	 */
-	IPage<JwtdSpglVO> selectJwtdSpglPage(IPage<JwtdSpglVO> page, JwtdSpglVO jwtdSpgl);
+	IPage<JwtdSpglEntity> selectJwtdSpglPage(IPage<JwtdSpglEntity> page, JwtdSpglEntity jwtdSpgl);
 
 	/**
 	 * 导出数据
@@ -57,4 +57,13 @@ public interface IJwtdSpglService extends BaseService<JwtdSpglEntity> {
 	 */
 	List<JwtdSpglExcel> exportJwtdSpgl(Wrapper<JwtdSpglEntity> queryWrapper);
 
+	boolean updateSpxj(JwtdSpglEntity jwtdSpgl);
+
+	boolean updateSpbh(JwtdSpglEntity jwtdSpgl);
+
+	IPage<JwtdSpglEntity> selectJwtdSpglPageApp(IPage<Object> page, JwtdSpglEntity jwtdSpgl);
+
+	void updateSpzt(Long id);
+
+	String selectXz(String lqdd);
 }

+ 25 - 1
src/main/java/org/springblade/modules/jwtdSpgl/service/impl/JwtdSpglServiceImpl.java

@@ -46,7 +46,7 @@ import java.util.List;
 public class JwtdSpglServiceImpl extends BaseServiceImpl<JwtdSpglMapper, JwtdSpglEntity> implements IJwtdSpglService {
 
 	@Override
-	public IPage<JwtdSpglVO> selectJwtdSpglPage(IPage<JwtdSpglVO> page, JwtdSpglVO jwtdSpgl) {
+	public IPage<JwtdSpglEntity> selectJwtdSpglPage(IPage<JwtdSpglEntity> page, JwtdSpglEntity jwtdSpgl) {
 		return page.setRecords(baseMapper.selectJwtdSpglPage(page, jwtdSpgl));
 	}
 
@@ -59,4 +59,28 @@ public class JwtdSpglServiceImpl extends BaseServiceImpl<JwtdSpglMapper, JwtdSpg
 		return jwtdSpglList;
 	}
 
+	@Override
+	public boolean updateSpxj(JwtdSpglEntity jwtdSpgl) {
+		return baseMapper.updateSpxj(jwtdSpgl);
+	}
+
+	@Override
+	public boolean updateSpbh(JwtdSpglEntity jwtdSpgl) {
+		return baseMapper.updateSpbh(jwtdSpgl);
+	}
+
+	@Override
+	public IPage<JwtdSpglEntity> selectJwtdSpglPageApp(IPage<Object> page, JwtdSpglEntity jwtdSpgl) {
+		return baseMapper.selectJwtdSpglPageApp(page, jwtdSpgl);
+	}
+
+	@Override
+	public void updateSpzt(Long id) {
+		baseMapper.updateSpzt(id);
+	}
+
+	@Override
+	public String selectXz(String lqdd) {
+		return baseMapper.selectXz(lqdd);
+	}
 }

+ 44 - 13
src/main/java/org/springblade/modules/jwtdSpglDhjl/controller/JwtdSpglDhjlController.java

@@ -39,6 +39,8 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.jwtdGwc.pojo.entity.JwtdGwcEntity;
+import org.springblade.modules.jwtdGwc.service.IJwtdGwcService;
 import org.springblade.modules.jwtdJfjl.pojo.entity.JwtdJfjlEntity;
 import org.springblade.modules.jwtdJfjl.service.IJwtdJfjlService;
 import org.springblade.modules.jwtdSpgl.pojo.entity.JwtdSpglEntity;
@@ -83,6 +85,8 @@ public class JwtdSpglDhjlController extends BladeController {
 
 	private final IJwtdJfjlService jwtdJfjlService;
 
+	private final IJwtdGwcService jwtdGwcService;
+
 	/**
 	 * 警务团队_商品管理_兑换记录 详情
 	 */
@@ -92,6 +96,7 @@ public class JwtdSpglDhjlController extends BladeController {
 	public R detail(JwtdSpglDhjlEntity jwtdSpglDhjl) {
 		JwtdSpglDhjlEntity detail = jwtdSpglDhjlService.detailByDdbh(jwtdSpglDhjl);
 		List<JwtdSpglDhjlVO> spList = jwtdSpglDhjlService.detailListByDdbh(jwtdSpglDhjl);
+		detail.setSpList(spList);
 		return R.data(detail);
 	}
 
@@ -104,6 +109,10 @@ public class JwtdSpglDhjlController extends BladeController {
 	@Operation(summary = "分页", description  = "传入jwtdSpglDhjl")
 	public R<IPage<JwtdSpglDhjlEntity>> page(JwtdSpglDhjlEntity jwtdSpglDhjl, Query query) {
 		IPage<JwtdSpglDhjlEntity> pages = jwtdSpglDhjlService.selectJwtdSpglDhjlPage(Condition.getPage(query), jwtdSpglDhjl);
+		for (JwtdSpglDhjlEntity dhjl : pages.getRecords()) {
+			List<JwtdSpglDhjlVO> spList = jwtdSpglDhjlService.detailListByDdbh(dhjl);
+			dhjl.setSpList(spList);
+		}
 		return R.data(pages);
 	}
 
@@ -169,35 +178,49 @@ public class JwtdSpglDhjlController extends BladeController {
 	 */
 	@PostMapping("gwcjs")
 	public R gwcjs(@RequestBody List<JwtdSpglDhjlEntity> gwc) {
-		String orderCode = OrderCodeFactory.getOrderCode(AuthUtil.getUserId());
+		String orderCode = OrderCodeFactory.getOrderCode(Long.valueOf("1123598821738675201"));
 		Date date = new Date();
 		for (JwtdSpglDhjlEntity jwtdSpglDhjl : gwc) {
 			JwtdSpglEntity byId = jwtdSpglService.getById(jwtdSpglDhjl.getSpId());
-			if (byId.getSpkcl() < jwtdSpglDhjl.getCount()) {
+			if (byId.getSpkcl() < jwtdSpglDhjl.getSpsl()) {
 				return R.fail("库存量不足");
 			}
 			JwtdSpglEntity spgl = new JwtdSpglEntity();
 			spgl.setId(byId.getId());
-			spgl.setSpkcl(byId.getSpkcl() - jwtdSpglDhjl.getCount());
-			spgl.setSpydhsl(byId.getSpydhsl() + jwtdSpglDhjl.getCount());
+			spgl.setSpkcl(byId.getSpkcl() - jwtdSpglDhjl.getSpsl());
+			spgl.setSpydhsl(byId.getSpydhsl() + jwtdSpglDhjl.getSpsl());
 			jwtdSpglService.updateById(spgl);
-			User user = userService.getById(AuthUtil.getUserId());
+			JwtdSpglEntity kcl = jwtdSpglService.getById(jwtdSpglDhjl.getSpId());
+			if (kcl.getSpkcl() == 0) {
+				jwtdSpglService.updateSpzt(kcl.getId());
+			}
+			User user = userService.getById(Long.valueOf("1123598821738675201"));
 			User jf = new User();
 			jf.setId(user.getId());
-			jf.setJf(user.getJf() - jwtdSpglDhjl.getJf());
+			jf.setJf(user.getJf() - jwtdSpglDhjl.getXhjf());
+			if (jf.getJf() < 0) {
+				return R.fail("积分不足");
+			}
 			userService.updateById(jf);
+			JwtdGwcEntity jwtdGwc = new JwtdGwcEntity();
+			jwtdGwc.setUserId(Long.valueOf("1123598821738675201"));
+			jwtdGwc.setSpId(jwtdSpglDhjl.getSpId());
+			jwtdGwcService.updateIsDeleted(jwtdGwc);
 			JwtdSpglDhjlEntity dh = new JwtdSpglDhjlEntity();
 			dh.setDdbh(orderCode);
-			dh.setUserId(AuthUtil.getUserId());
+			dh.setUserId(Long.valueOf("1123598821738675201"));
 			dh.setSpId(byId.getId());
 			dh.setSpsl(jwtdSpglDhjl.getSpsl());
 			dh.setXhjf(jwtdSpglDhjl.getXhjf());
-			dh.setLqzt("0");
+			dh.setLqzt("1");
+			dh.setCreateUser(Long.valueOf("1123598821738675201"));
+			dh.setCreateDept(Long.valueOf("220407010000"));
 			dh.setCreateTime(date);
+			dh.setUpdateUser(Long.valueOf("1123598821738675201"));
 			dh.setUpdateTime(date);
-			jwtdSpglDhjlService.save(dh);
+			jwtdSpglDhjlService.saveDhjl(dh);
 			JwtdJfjlEntity jwtdJfjl = new JwtdJfjlEntity();
-			jwtdJfjl.setUserId(AuthUtil.getUserId());
+			jwtdJfjl.setUserId(Long.valueOf("1123598821738675201"));
 			jwtdJfjl.setType("2");
 			jwtdJfjl.setJfId(dh.getId());
 			jwtdJfjl.setJf(dh.getXhjf());
@@ -210,8 +233,8 @@ public class JwtdSpglDhjlController extends BladeController {
 	 * 商品发货
 	 */
 	@PostMapping("spfh")
-	public R spfh(@RequestBody String ddbh) {
-		return R.data(jwtdSpglDhjlService.updateLqzt(ddbh, AuthUtil.getUserId(), AuthUtil.getDeptId()));
+	public R spfh(String ddbh) {
+		return R.data(jwtdSpglDhjlService.updateLqzt(ddbh, AuthUtil.getUserId(), Long.valueOf(AuthUtil.getDeptId())));
 	}
 
 	/**
@@ -219,6 +242,14 @@ public class JwtdSpglDhjlController extends BladeController {
 	 */
 	@GetMapping("getDdList")
 	public R getDdList(String type, String spmc) {
-		return R.data(jwtdSpglDhjlService.getDdList(type, AuthUtil.getUserId(), spmc));
+		return R.data(jwtdSpglDhjlService.getDdList(type, Long.valueOf("1123598821738675201"), spmc));
+	}
+
+	/**
+	 * 领取商品
+	 */
+	@PostMapping("lqsp")
+	public R lqsp(@RequestBody String ddbh) {
+		return R.data(jwtdSpglDhjlService.updateLqsp(ddbh));
 	}
 }

+ 5 - 1
src/main/java/org/springblade/modules/jwtdSpglDhjl/mapper/JwtdSpglDhjlMapper.java

@@ -63,7 +63,11 @@ public interface JwtdSpglDhjlMapper extends BaseMapper<JwtdSpglDhjlEntity> {
 
 	List<JwtdSpglDhjlVO> detailListByDdbh(JwtdSpglDhjlEntity jwtdSpglDhjl);
 
-	boolean updateLqzt(String ddbh, Long useerId, String deptId);
+	boolean updateLqzt(String ddbh, Long userId, Long deptId);
 
 	List<JwtdSpglDhjlEntity> getDdList(String type, Long userId, String spmc);
+
+	boolean updateLqsp(String ddbh);
+
+	void saveDhjl(JwtdSpglDhjlEntity dh);
 }

+ 34 - 3
src/main/java/org/springblade/modules/jwtdSpglDhjl/mapper/JwtdSpglDhjlMapper.xml

@@ -18,19 +18,40 @@
             bu.name,
             bu.sfzh,
             bu.phone,
+            bu.dz,
             SUM ( jsd.spsl ) AS spsl,
             SUM ( jsd.xhjf ) AS xhjf,
-            jsd.lqzt
+            jsd.lqzt,
+            jsd.create_time,
+            jsd.update_time,
+            fh.name as fhrname,
+            bd.dept_name as fhdept
         FROM
             jwtd_spgl_dhjl jsd
         LEFT JOIN blade_user bu ON bu.id = jsd.user_id
+        LEFT JOIN blade_user fh ON fh.id = jsd.fhr
+        LEFT JOIN blade_dept bd ON bd.id = jsd.update_dept
         WHERE jsd.is_deleted = 0
+        <if test="jwtdSpglDhjl.ddbh != null and jwtdSpglDhjl.ddbh != ''">
+            and jsd.ddbh = #{jwtdSpglDhjl.ddbh}
+        </if>
+        <if test="jwtdSpglDhjl.name != null and jwtdSpglDhjl.name != ''">
+            and bu.name = #{jwtdSpglDhjl.name}
+        </if>
+        <if test="jwtdSpglDhjl.sfzh != null and jwtdSpglDhjl.sfzh != ''">
+            and bu.sfzh = #{jwtdSpglDhjl.sfzh}
+        </if>
         GROUP BY
             jsd.ddbh,
             bu.name,
             bu.sfzh,
             bu.phone,
-            jsd.lqzt
+            bu.dz,
+            jsd.lqzt,
+            jsd.create_time,
+            jsd.update_time,
+            fh.name,
+            bd.dept_name
     </select>
 
     <select id="exportJwtdSpglDhjl" resultType="org.springblade.modules.jwtdSpglDhjl.excel.JwtdSpglDhjlExcel">
@@ -79,7 +100,8 @@
             jsd.xhjf,
             js.lqdd,
             jsd.create_time,
-            jsd.lqzt
+            jsd.lqzt,
+            jsd.ddbh
         from jwtd_spgl_dhjl jsd
         left join jwtd_spgl js on js.id = jsd.sp_id
         where jsd.user_id = #{userId}
@@ -93,4 +115,13 @@
             and jsd.spmc like '%' || #{spmc} || '%'
         </if>
     </select>
+
+    <update id="updateLqsp">
+        update jwtd_spgl_dhjl set lqzt = 3, update_time = now() where ddbh = #{ddbh}
+    </update>
+
+    <insert id="saveDhjl">
+        insert into jwtd_spgl_dhjl(id, ddbh, user_id, sp_id, spsl, xhjf, lqzt, create_user, create_dept, create_time, update_user, update_time)
+        values (#{id}, #{ddbh}, #{userId}, #{spId}, #{xhjf}, #{lqzt}, #{createUser}, #{createDept}, #{createTime}, #{updateUser}, #{updateTime})
+    </insert>
 </mapper>

+ 11 - 1
src/main/java/org/springblade/modules/jwtdSpglDhjl/pojo/entity/JwtdSpglDhjlEntity.java

@@ -92,7 +92,7 @@ public class JwtdSpglDhjlEntity extends BaseEntity {
 	 * 发货人
 	 */
 	@Schema(description = "发货人")
-	private Integer fhr;
+	private Long fhr;
 	/**
 	 * 数量
 	 */
@@ -112,5 +112,15 @@ public class JwtdSpglDhjlEntity extends BaseEntity {
 	@TableField(exist = false)
 	private String fhName;
 	@TableField(exist = false)
+	private String spmc;
+	@TableField(exist = false)
+	private String spms;
+	@TableField(exist = false)
+	private String dz;
+	@TableField(exist = false)
+	private String fhrname;
+	@TableField(exist = false)
+	private String fhdept;
+	@TableField(exist = false)
 	private List<JwtdSpglDhjlVO> spList;
 }

+ 10 - 0
src/main/java/org/springblade/modules/jwtdSpglDhjl/pojo/vo/JfVO.java

@@ -0,0 +1,10 @@
+package org.springblade.modules.jwtdSpglDhjl.pojo.vo;
+
+import lombok.Data;
+
+@Data
+public class JfVO {
+	public Integer zjf;
+	public Integer dhjf;
+	public Integer jf;
+}

+ 5 - 1
src/main/java/org/springblade/modules/jwtdSpglDhjl/service/IJwtdSpglDhjlService.java

@@ -61,7 +61,11 @@ public interface IJwtdSpglDhjlService extends BaseService<JwtdSpglDhjlEntity> {
 
 	List<JwtdSpglDhjlVO> detailListByDdbh(JwtdSpglDhjlEntity jwtdSpglDhjl);
 
-	boolean updateLqzt(String ddbh, Long useerId, String deptId);
+	boolean updateLqzt(String ddbh, Long userId, Long deptId);
 
 	List<JwtdSpglDhjlEntity> getDdList(String type, Long userId, String spmc);
+
+	boolean updateLqsp(String ddbh);
+
+	void saveDhjl(JwtdSpglDhjlEntity dh);
 }

+ 12 - 2
src/main/java/org/springblade/modules/jwtdSpglDhjl/service/impl/JwtdSpglDhjlServiceImpl.java

@@ -70,8 +70,8 @@ public class JwtdSpglDhjlServiceImpl extends BaseServiceImpl<JwtdSpglDhjlMapper,
 	}
 
 	@Override
-	public boolean updateLqzt(String ddbh, Long useerId, String deptId) {
-		return baseMapper.updateLqzt(ddbh, useerId, deptId);
+	public boolean updateLqzt(String ddbh, Long userId, Long deptId) {
+		return baseMapper.updateLqzt(ddbh, userId, deptId);
 	}
 
 	@Override
@@ -79,4 +79,14 @@ public class JwtdSpglDhjlServiceImpl extends BaseServiceImpl<JwtdSpglDhjlMapper,
 		return baseMapper.getDdList(type, userId, spmc);
 	}
 
+	@Override
+	public boolean updateLqsp(String ddbh) {
+		return baseMapper.updateLqsp(ddbh);
+	}
+
+	@Override
+	public void saveDhjl(JwtdSpglDhjlEntity dh) {
+		baseMapper.saveDhjl(dh);
+	}
+
 }

+ 1 - 1
src/main/java/org/springblade/modules/resource/builder/OssBuilder.java

@@ -102,7 +102,7 @@ public class OssBuilder {
 	 * @return OssTemplate
 	 */
 	public OssTemplate template(String tenantId, String code) {
-		Oss oss = getOss(tenantId, code);
+		Oss oss = getOss("000000", code);
 
 		OssContext ossContext = new OssContext();
 		ossContext.setOss(oss);

+ 33 - 2
src/main/java/org/springblade/modules/system/controller/DeptController.java

@@ -54,6 +54,7 @@ import org.springblade.core.tool.support.Kv;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.system.pojo.entity.Dept;
 import org.springblade.modules.system.pojo.entity.User;
+import org.springblade.modules.system.pojo.vo.DeptListVO;
 import org.springblade.modules.system.pojo.vo.ListVO;
 import org.springblade.modules.system.pojo.vo.ZdVO;
 import org.springblade.modules.system.service.IDeptService;
@@ -197,7 +198,7 @@ public class DeptController extends BladeController {
 	 */
 	@GetMapping("getDeptList")
 	public R getDeptList(Long id) {
-		return R.data(deptService.getDeptList(id, AuthUtil.getDeptId()));
+		return R.data(deptService.getDeptList(id, "220407010000"));
 	}
 
 	/**
@@ -217,7 +218,7 @@ public class DeptController extends BladeController {
 	}
 
 	/**
-	 * 获取警务室列表
+	 * 获取防范宣传列表
 	 */
 	@GetMapping("getFfxcList")
 	public R getFfxcList() {
@@ -243,6 +244,36 @@ public class DeptController extends BladeController {
 		code = "ffxclx";
 		List<ListVO> ffxclx = deptService.getDictList(code);
 		dict.setFfxclx(ffxclx);
+		List<ListVO> lqdd = deptService.getLqddList(code);
+		dict.setLqdd(lqdd);
 		return R.data(dict);
 	}
+
+	/**
+	 * 积分看板区县
+	 */
+	@GetMapping("getJfkb")
+	public R getJfkb() {
+		Dept byId = deptService.getById(Long.valueOf(AuthUtil.getDeptId()));
+		List<ListVO> listVO = new ArrayList<>();
+		if (byId.getDeptCategory() == 5) {
+			listVO = deptService.selectDeptByQx(AuthUtil.getDeptId().substring(0, 6));
+		} else if (byId.getDeptCategory() == 4) {
+			listVO = deptService.selectDeptBySj(AuthUtil.getDeptId().substring(0, 4));
+		}
+		return R.data(listVO);
+	}
+
+	/**
+	 * 获取部门列表App
+	 */
+	@GetMapping("getDeptListApp")
+	public R getDeptListApp() {
+		List<DeptListVO> list = deptService.getDeptListPcs(Long.valueOf("220407010000"));
+		for (DeptListVO deptListVO : list) {
+			List<ListVO> sq = deptService.getDeptListSq(deptListVO.getValue());
+			deptListVO.setChildren(sq);
+		}
+		return R.data(list);
+	}
 }

+ 50 - 1
src/main/java/org/springblade/modules/system/controller/UserController.java

@@ -26,8 +26,10 @@
 package org.springblade.modules.system.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
@@ -38,6 +40,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import lombok.AllArgsConstructor;
+import org.springblade.common.utils.WechatQsUtil;
 import org.springblade.core.cache.utils.CacheUtil;
 import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.launch.constant.AppConstant;
@@ -50,6 +53,7 @@ import org.springblade.core.tenant.annotation.NonDS;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.constant.BladeConstant;
 import org.springblade.core.tool.constant.RoleConstant;
+import org.springblade.core.tool.support.Kv;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.StringPool;
 import org.springblade.modules.system.excel.UserExcel;
@@ -164,7 +168,8 @@ public class UserController {
 	@ApiOperationSupport(order = 5)
 	@Operation(summary = "修改", description = "传入User")
 	public R update(@Valid @RequestBody User user) {
-		CacheUtil.clear(USER_CACHE);
+		//CacheUtil.clear(USER_CACHE);
+		user.setId(Long.valueOf("1123598821738675201"));
 		return R.status(userService.updateUser(user));
 	}
 
@@ -354,4 +359,48 @@ public class UserController {
 	public R selectRyxxBySfzh(String sfzh) {
 		return R.data(userService.selectRyxxBySfzh(sfzh));
 	}
+
+	/**
+	 * 微信登陆后获取存在数据库里的信息
+	 */
+	@GetMapping("getUser")
+	public R getUser(User user) {
+		User yh = new User();
+		User code = userService.getCodeByOpenId(user.getCode());
+		if (code == null) {
+			yh.setCode(user.getCode());
+			userService.save(yh);
+		}
+		return R.data(userService.getCodeByOpenId(user.getCode()));
+	}
+
+	@PostMapping("/wxlogi_qs")
+	@ResponseBody
+	public R user_loginQs(String code) {
+
+		//----------测试begin------------
+//		User user = userService.getOne(Wrappers.<User>lambdaQuery().eq(User::getAccount, code));
+//		Kv token = userService.getToken(user);
+//		return R.data(token);
+		//----------测试end--------------
+
+		JSONObject SessionKeyOpenId = JSONObject.parseObject(WechatQsUtil.getOpenid(code));
+		//String openid = SessionKeyOpenId.getString("openid");
+		String openid = "1";
+		String sessionKey = SessionKeyOpenId.getString("session_key");
+		User user = userService.getOne(Wrappers.<User>lambdaQuery().eq(User::getCode, openid));
+
+		if (user == null) {
+			return R.data(100, openid, "用户未注册!");
+		} else {
+			if(user.getStatus() == 0){
+				return R.data(101, openid, "用户注册正在审核中,请稍后再试!");
+			}
+			if(user.getStatus() == 2){
+				return R.data(102, openid, "用户注册申请已驳回,请联系管理员!");
+			}
+			Kv token = userService.getToken(user);
+			return R.data(token);
+		}
+	}
 }

+ 11 - 0
src/main/java/org/springblade/modules/system/mapper/DeptMapper.java

@@ -27,6 +27,7 @@ package org.springblade.modules.system.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.springblade.modules.system.pojo.entity.Dept;
+import org.springblade.modules.system.pojo.vo.DeptListVO;
 import org.springblade.modules.system.pojo.vo.DeptVO;
 import org.springblade.modules.system.pojo.vo.ListVO;
 
@@ -92,4 +93,14 @@ public interface DeptMapper extends BaseMapper<Dept> {
 	Dept selectSspcsBm(String sspcs);
 
 	Dept selectSssqBm(String sssq, Long id);
+
+    List<ListVO> getLqddList(String code);
+
+	List<ListVO> selectDeptByQx(String deptId);
+
+	List<ListVO> selectDeptBySj(String deptId);
+
+    List<DeptListVO> getDeptListPcs(Long deptId);
+
+	List<ListVO> getDeptListSq(String value);
 }

+ 44 - 4
src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml

@@ -128,10 +128,10 @@
 
     <select id="getQxList" resultType="org.springblade.modules.system.pojo.vo.ListVO">
         select
-            "" as value,
+            code as value,
             br.city_name || br.name as label
-        from blade_region
-        where parent_code = #{deptId} and is_deleted = 0
+        from blade_region br
+        where br.parent_code = #{deptId}
     </select>
 
     <select id="getJwsList" resultType="org.springblade.modules.system.pojo.vo.ListVO">
@@ -144,7 +144,7 @@
 
     <select id="getDictList" resultType="org.springblade.modules.system.pojo.vo.ListVO">
         select
-            id as value,
+            dict_key as value,
             dict_value as label
         from blade_dict_biz
         where code = #{code} and parent_id > 0 and is_sealed = 0 and is_deleted = 0
@@ -179,4 +179,44 @@
     <select id="selectSssqBm" resultMap="deptResultMap">
         select id from blade_dept where dept_name = #{sssq} and parent_id = #{id}
     </select>
+
+    <select id="getLqddList" resultType="org.springblade.modules.system.pojo.vo.ListVO">
+        select
+            dzbm as value,
+            xz as label
+        from sspt.rk_dzxx
+    </select>
+
+    <select id="selectDeptByQx" resultType="org.springblade.modules.system.pojo.vo.ListVO">
+        select
+            code || '000000' as value,
+            br.province_name || br.city_name || br.name as label
+        from blade_region br
+        where br.code = #{deptId}
+    </select>
+
+    <select id="selectDeptBySj" resultType="org.springblade.modules.system.pojo.vo.ListVO">
+        select
+            code || '000000' as value,
+            br.province_name || br.city_name || br.name as label
+        from blade_region br
+        where br.parent_code = #{deptId}
+    </select>
+
+
+    <select id="getDeptListPcs" resultType="org.springblade.modules.system.pojo.vo.DeptListVO">
+        select
+            id as value,
+            dept_name as label
+        from blade_dept
+        where id = #{deptId}
+    </select>
+
+    <select id="getDeptListSq" resultType="org.springblade.modules.system.pojo.vo.ListVO">
+        select
+            id as value,
+            dept_name as label
+        from blade_dept
+        where parent_id :: text = #{value}
+    </select>
 </mapper>

+ 2 - 0
src/main/java/org/springblade/modules/system/mapper/DictBizMapper.java

@@ -74,4 +74,6 @@ public interface DictBizMapper extends BaseMapper<DictBiz> {
 	 * @return
 	 */
 	List<DictBizVO> parentTree();
+
+    DictBiz selectFfxc(String xclx);
 }

+ 4 - 0
src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml

@@ -47,4 +47,8 @@
     <select id="parentTree" resultMap="treeNodeResultMap">
         select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0 and parent_id = 0
     </select>
+
+    <select id="selectFfxc" resultMap="dictResultMap">
+        select * from blade_dict_biz where code = 'ffxclx' and dict_key = #{xclx}
+    </select>
 </mapper>

+ 2 - 0
src/main/java/org/springblade/modules/system/mapper/UserMapper.java

@@ -80,4 +80,6 @@ public interface UserMapper extends BaseMapper<User> {
 	List<UserExcel> exportUser(@Param("ew") Wrapper<User> queryWrapper);
 
     RyVO selectRyxxBySfzh(String sfzh);
+
+    User getCodeByOpenId(String code);
 }

+ 4 - 0
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml

@@ -88,4 +88,8 @@
     <select id="selectRyxxBySfzh" resultType="org.springblade.modules.system.pojo.vo.RyVO">
         select ryxm,rydh from sspt.ybss_xx where rysfzh = #{sfzh}
     </select>
+
+    <select id="getCodeByOpenId" resultMap="userResultMap">
+        select * from blade_user where is_deleted = 0 and code = #{code}
+    </select>
 </mapper>

+ 0 - 20
src/main/java/org/springblade/modules/system/pojo/entity/User.java

@@ -104,26 +104,6 @@ public class User extends TenantEntity {
 	 */
 	private String postId;
 	/**
-	 * 警务室id
-	 */
-	private Long jwsId;
-	/**
-	 * 管辖社区id
-	 */
-	private Long gxsqId;
-	/**
-	 * 职务类别
-	 */
-	private String zwlb;
-	/**
-	 * 工作职责
-	 */
-	private String gzzz;
-	/**
-	 * 工作职责
-	 */
-	private String zp;
-	/**
 	 * 积分
 	 */
 	private Integer jf;

+ 12 - 0
src/main/java/org/springblade/modules/system/pojo/vo/DeptListVO.java

@@ -0,0 +1,12 @@
+package org.springblade.modules.system.pojo.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class DeptListVO {
+	private String value;
+	private String label;
+	private List<ListVO> children;
+}

+ 1 - 0
src/main/java/org/springblade/modules/system/pojo/vo/ZdVO.java

@@ -9,4 +9,5 @@ public class ZdVO {
 	private List<ListVO> zwlb;
 	private List<ListVO> gzzz;
 	private List<ListVO> ffxclx;
+	private List<ListVO> lqdd;
 }

+ 11 - 0
src/main/java/org/springblade/modules/system/service/IDeptService.java

@@ -27,6 +27,7 @@ package org.springblade.modules.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.springblade.modules.system.pojo.entity.Dept;
+import org.springblade.modules.system.pojo.vo.DeptListVO;
 import org.springblade.modules.system.pojo.vo.DeptVO;
 import org.springblade.modules.system.pojo.vo.ListVO;
 
@@ -143,4 +144,14 @@ public interface IDeptService extends IService<Dept> {
 	Dept selectSspcsBm(String sspcs);
 
 	Dept selectSssqBm(String sssq, Long id);
+
+	List<ListVO> getLqddList(String code);
+
+	List<ListVO> selectDeptByQx(String deptId);
+
+	List<ListVO> selectDeptBySj(String deptId);
+
+    List<DeptListVO> getDeptListPcs(Long deptId);
+
+	List<ListVO> getDeptListSq(String value);
 }

+ 2 - 0
src/main/java/org/springblade/modules/system/service/IDictBizService.java

@@ -125,4 +125,6 @@ public interface IDictBizService extends IService<DictBiz> {
 	 * @return
 	 */
 	List<DictBizVO> childList(Map<String, Object> dict, Long parentId);
+
+    DictBiz selectFfxc(String xclx);
 }

+ 8 - 0
src/main/java/org/springblade/modules/system/service/IUserService.java

@@ -30,6 +30,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.support.Kv;
+import org.springblade.modules.auth.enums.UserEnum;
 import org.springblade.modules.auth.provider.UserType;
 import org.springblade.modules.system.pojo.entity.User;
 import org.springblade.modules.system.pojo.entity.UserInfo;
@@ -276,4 +278,10 @@ public interface IUserService extends BaseService<User> {
 	boolean auditRefuse(String userIds);
 
     RyVO selectRyxxBySfzh(String sfzh);
+
+    User getCodeByOpenId(String code);
+
+	Kv getToken(User user);
+
+	UserInfo userInfo(String tenantId, String account, String password, UserEnum userEnum);
 }

+ 26 - 0
src/main/java/org/springblade/modules/system/service/impl/DeptServiceImpl.java

@@ -37,6 +37,7 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringPool;
 import org.springblade.modules.system.pojo.entity.Dept;
 import org.springblade.modules.system.mapper.DeptMapper;
+import org.springblade.modules.system.pojo.vo.DeptListVO;
 import org.springblade.modules.system.pojo.vo.ListVO;
 import org.springblade.modules.system.service.IDeptService;
 import org.springblade.modules.system.pojo.vo.DeptVO;
@@ -238,4 +239,29 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
 	public Dept selectSssqBm(String sssq, Long id) {
 		return baseMapper.selectSssqBm(sssq, id);
 	}
+
+	@Override
+	public List<ListVO> getLqddList(String code) {
+		return baseMapper.getLqddList(code);
+	}
+
+	@Override
+	public List<ListVO> selectDeptByQx(String deptId) {
+		return baseMapper.selectDeptByQx(deptId);
+	}
+
+	@Override
+	public List<ListVO> selectDeptBySj(String deptId) {
+		return baseMapper.selectDeptBySj(deptId);
+	}
+
+	@Override
+	public List<DeptListVO> getDeptListPcs(Long deptId) {
+		return baseMapper.getDeptListPcs(deptId);
+	}
+
+	@Override
+	public List<ListVO> getDeptListSq(String value) {
+		return baseMapper.getDeptListSq(value);
+	}
 }

+ 5 - 0
src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java

@@ -143,4 +143,9 @@ public class DictBizServiceImpl extends ServiceImpl<DictBizMapper, DictBiz> impl
 		List<DictBiz> list = this.list(Condition.getQueryWrapper(dict, DictBiz.class).lambda().ne(DictBiz::getId, parentId).eq(DictBiz::getCode, parentDict.getCode()).orderByAsc(DictBiz::getSort));
 		return DictBizWrapper.build().listNodeVO(list);
 	}
+
+	@Override
+	public DictBiz selectFfxc(String xclx) {
+		return baseMapper.selectFfxc(xclx);
+	}
 }

+ 47 - 0
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java

@@ -36,6 +36,7 @@ import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.constant.TenantConstant;
 import org.springblade.common.enums.DictEnum;
 import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.log.logger.BladeLogger;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.mp.enums.StatusType;
 import org.springblade.core.mp.support.Condition;
@@ -48,7 +49,9 @@ import org.springblade.core.tool.constant.BladeConstant;
 import org.springblade.core.tool.jackson.JsonUtil;
 import org.springblade.core.tool.support.Kv;
 import org.springblade.core.tool.utils.*;
+import org.springblade.modules.auth.enums.UserEnum;
 import org.springblade.modules.auth.provider.UserType;
+import org.springblade.modules.auth.utils.TokenUtil;
 import org.springblade.modules.system.excel.UserExcel;
 import org.springblade.modules.system.mapper.UserMapper;
 import org.springblade.modules.system.pojo.entity.*;
@@ -84,6 +87,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 	private final IRoleService roleService;
 	private final BladeTenantProperties tenantProperties;
 	private final BladeRedis bladeRedis;
+	private final BladeLogger logger;
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
@@ -547,4 +551,47 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 	public RyVO selectRyxxBySfzh(String sfzh) {
 		return baseMapper.selectRyxxBySfzh(sfzh);
 	}
+
+	@Override
+	public User getCodeByOpenId(String code) {
+		return baseMapper.getCodeByOpenId(code);
+	}
+
+	@Override
+	public Kv getToken(User user) {
+		// 获取用户信息
+		String tenantId = user.getTenantId();
+		String username = user.getAccount();
+		String password = user.getPassword();
+
+		UserInfo userInfo = null;
+		if (Func.isNoneBlank(user.getAccount(), user.getPassword())) {
+			// 获取租户信息
+//			Tenant tenant = tenantService.getByTenantId(tenantId);
+//			if (TokenUtil.judgeTenant(tenant)) {
+//				throw new ServiceException(TokenUtil.USER_HAS_NO_TENANT_PERMISSION);
+//			}
+			// 获取用户类型
+			String userType = "WEB";
+			// 根据不同用户类型调用对应的接口返回数据,用户可自行拓展
+			if (userType.equals(UserEnum.WEB.getName())) {
+				userInfo = userInfo(tenantId, username, password, UserEnum.WEB);
+			} else if (userType.equals(UserEnum.APP.getName())) {
+				userInfo = userInfo(tenantId, username, password, UserEnum.APP);
+			} else {
+				userInfo = userInfo(tenantId, username, password, UserEnum.OTHER);
+			}
+		}
+		Kv authInfo = TokenUtil.createAuthInfo(userInfo);
+		if(authInfo != null){
+			logger.info("小程序登陆", username);
+		}
+		return authInfo;
+	}
+
+	@Override
+	public UserInfo userInfo(String tenantId, String account, String password, UserEnum userEnum) {
+		User user = baseMapper.getUser(tenantId, account);
+		return buildUserInfo(user);
+	}
 }

+ 17 - 4
src/main/java/org/springblade/modules/szqyCsjl/mapper/JwtdSzqyCsjlMapper.xml

@@ -25,9 +25,22 @@
             jsj.jyzmc,
             jsj.ssqx,
             jsj.sspcs,
-            jsj.sssq
+            jsj.sssq,
+            jsj.jyzzp,
+            jsj.jyzxz,
+            jsj.fzrxm,
+            jsj.zjhm,
+            jsj.fzrdh,
+            jsj.zrmj,
+            jsj.jh,
+            pcs.dept_name as sspcsMc,
+            sq.dept_name as sssqMc,
+            br.city_name || br.name as ssqxMc
         from jwtd_szqy_csjl jsc
-        left join jwtd_szqy_jyz jsj on jsc.jyz_id = jsj.shtyxydm
+        left join jwtd_szqy_jyz jsj on jsc.shtyxydm = jsj.shtyxydm
+        left join blade_dept pcs on jsj.sspcs = pcs.id
+        left join blade_dept sq on jsj.sssq = sq.id
+        left join blade_region br on jsj.ssqx :: text = br.code
         where jsc.is_deleted = 0
         <if test="jwtdSzqyCsjl.gmfmc != null and jwtdSzqyCsjl.gmfmc != ''">
             and jsc.gmfmc like '%' || #{jwtdSzqyCsjl.gmfmc} || '%'
@@ -53,7 +66,7 @@
         <if test="jwtdSzqyCsjl.sspcs != null and jwtdSzqyCsjl.sspcs != ''">
             and jsj.sspcs = #{jwtdSzqyCsjl.sspcs}
         </if>
-        <if test="jwtdSzqyCsjl.sssq != null and jwtdSzqyCsjl.sssq ''">
+        <if test="jwtdSzqyCsjl.sssq != null and jwtdSzqyCsjl.sssq != ''">
             and jsj.sssq = #{jwtdSzqyCsjl.sssq}
         </if>
     </select>
@@ -66,7 +79,7 @@
         select
             *
         from jwtd_szqy_csjl jsc
-        left join jwtd_szqy_jyz jsj on jsc.jyz_id = jsj.shtyxydm
+        left join jwtd_szqy_jyz jsj on jsc.shtyxydm = jsj.shtyxydm
         where jsc.is_deleted = 0 and jsc.id = #{id}
     </select>
 </mapper>

+ 23 - 3
src/main/java/org/springblade/modules/szqyCsjl/pojo/entity/JwtdSzqyCsjlEntity.java

@@ -118,7 +118,7 @@ public class JwtdSzqyCsjlEntity extends BaseEntity {
 	 * 社会统一编码
 	 */
 	@Schema(description = "社会统一编码")
-	private String shtybm;
+	private String shtyxydm;
 	/**
 	 * 经办人姓名
 	 */
@@ -148,10 +148,30 @@ public class JwtdSzqyCsjlEntity extends BaseEntity {
 	 * 开始时间
 	 */
 	@TableField(exist = false)
-	private String start_time;
+	private String startTime;
 	/**
 	 * 结束时间
 	 */
 	@TableField(exist = false)
-	private String end_time;
+	private String endTime;
+	@TableField(exist = false)
+	private String sspcsMc;
+	@TableField(exist = false)
+	private String sssqMc;
+	@TableField(exist = false)
+	private String ssqxMc;
+	@TableField(exist = false)
+	private String jyzzp;
+	@TableField(exist = false)
+	private String jyzxz;
+	@TableField(exist = false)
+	private String fzrxm;
+	@TableField(exist = false)
+	private String zjhm;
+	@TableField(exist = false)
+	private String fzrdh;
+	@TableField(exist = false)
+	private String zrmj;
+	@TableField(exist = false)
+	private String jh;
 }

+ 32 - 1
src/main/java/org/springblade/modules/szqyJyz/controller/JwtdSzqyJyzController.java

@@ -42,7 +42,9 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.system.pojo.entity.Dept;
+import org.springblade.modules.system.pojo.entity.User;
 import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.service.IUserService;
 import org.springblade.modules.szqyCsjl.pojo.entity.JwtdSzqyCsjlEntity;
 import org.springblade.modules.szqyJyz.utils.ExcelUtils;
 import org.springframework.web.bind.annotation.*;
@@ -80,6 +82,8 @@ public class JwtdSzqyJyzController extends BladeController {
 
 	private final IDeptService deptService;
 
+	private final IUserService userService;
+
 	/**
 	 * 警务团队_散装汽油_加油站详情 详情
 	 */
@@ -88,7 +92,7 @@ public class JwtdSzqyJyzController extends BladeController {
 	@Operation(summary = "详情", description  = "传入jwtdSzqyJyz")
 	public R detail(JwtdSzqyJyzEntity jwtdSzqyJyz) {
 		JwtdSzqyJyzEntity detail = jwtdSzqyJyzService.getById(jwtdSzqyJyz.getId());
-		List<JwtdSzqyCsjlEntity> csjlList = jwtdSzqyJyzService.selectCsjlById(jwtdSzqyJyz.getShtyxydm());
+		List<JwtdSzqyCsjlEntity> csjlList = jwtdSzqyJyzService.selectCsjlById(detail.getShtyxydm());
 		detail.setCsjlList(csjlList);
 		return R.data(detail);
 	}
@@ -123,6 +127,25 @@ public class JwtdSzqyJyzController extends BladeController {
 	@ApiOperationSupport(order = 4)
 	@Operation(summary = "新增", description  = "传入jwtdSzqyJyz")
 	public R save(@Valid @RequestBody JwtdSzqyJyzEntity jwtdSzqyJyz) {
+		List<String> list = jwtdSzqyJyzService.selectShtyxydm(jwtdSzqyJyz.getShtyxydm());
+		if (list.size() > 0) {
+			return R.fail("已有此加油站");
+		}
+		User user = new User();
+		user.setId(AuthUtil.getUserId());
+		user.setDeptId(jwtdSzqyJyz.getShtyxydm());
+		userService.updateById(user);
+		return R.status(jwtdSzqyJyzService.save(jwtdSzqyJyz));
+	}
+
+	@PostMapping("/save2")
+	@ApiOperationSupport(order = 4)
+	@Operation(summary = "新增", description  = "传入jwtdSzqyJyz")
+	public R save2(@Valid @RequestBody JwtdSzqyJyzEntity jwtdSzqyJyz) {
+		List<String> list = jwtdSzqyJyzService.selectShtyxydm(jwtdSzqyJyz.getShtyxydm());
+		if (list.size() > 0) {
+			return R.fail("已有此加油站");
+		}
 		return R.status(jwtdSzqyJyzService.save(jwtdSzqyJyz));
 	}
 
@@ -209,4 +232,12 @@ public class JwtdSzqyJyzController extends BladeController {
 		}
 		return R.data(jwtdSzqyJyzService.saveBatch(jyzList));
 	}
+
+	/**
+	 * 根据登陆人部门获取加油站
+	 */
+	@GetMapping("getJyzByDeptId")
+	public R getJyzByDeptId() {
+		return R.data(jwtdSzqyJyzService.getJyzByDeptId(AuthUtil.getDeptId()));
+	}
 }

+ 4 - 0
src/main/java/org/springblade/modules/szqyJyz/mapper/JwtdSzqyJyzMapper.java

@@ -61,4 +61,8 @@ public interface JwtdSzqyJyzMapper extends BaseMapper<JwtdSzqyJyzEntity> {
 	List<JwtdSzqyJyzExcel> exportJwtdSzqyJyz(@Param("ew") Wrapper<JwtdSzqyJyzEntity> queryWrapper);
 
     List<JwtdSzqyCsjlEntity> selectCsjlById(String shtyxydm);
+
+	List<String> selectShtyxydm(String shtyxydm);
+
+	JwtdSzqyJyzEntity getJyzByDeptId(String deptId);
 }

+ 16 - 7
src/main/java/org/springblade/modules/szqyJyz/mapper/JwtdSzqyJyzMapper.xml

@@ -9,7 +9,6 @@
         <result column="jyzzp" property="jyzzp"/>
         <result column="fzrxm" property="fzrxm"/>
         <result column="zjhm" property="zjhm"/>
-        <result column="lxdh" property="lxdh"/>
         <result column="zrmj" property="zrmj"/>
         <result column="jh" property="jh"/>
         <result column="ssqx" property="ssqx"/>
@@ -21,11 +20,13 @@
         select
             jsj.*,
             pcs.dept_name as sspcsMc,
-            sq.dept_name as sssqMc
+            sq.dept_name as sssqMc,
+            br.city_name || br.name as ssqxMc
         from jwtd_szqy_jyz jsj
         left join blade_dept pcs on jsj.sspcs = pcs.id
         left join blade_dept sq on jsj.sssq = sq.id
-        where is_deleted = 0
+        left join blade_region br on jsj.ssqx :: text = br.code
+        where jsj.is_deleted = 0
         <if test="jwtdSzqyJyz.jyzmc != null and jwtdSzqyJyz.jyzmc != ''">
             and jsj.jyzmc like '%' || #{jwtdSzqyJyz.jyzmc} || '%'
         </if>
@@ -38,8 +39,8 @@
         <if test="jwtdSzqyJyz.zjhm != null and jwtdSzqyJyz.zjhm != ''">
             and jsj.zjhm = #{jwtdSzqyJyz.zjhm}
         </if>
-        <if test="jwtdSzqyJyz.lxdh != null and jwtdSzqyJyz.lxdh != ''">
-            and jsj.zjhm = #{jwtdSzqyJyz.lxdh}
+        <if test="jwtdSzqyJyz.fzrdh != null and jwtdSzqyJyz.fzrdh != ''">
+            and jsj.zjhm = #{jwtdSzqyJyz.fzrdh}
         </if>
         <if test="jwtdSzqyJyz.ssqx != null and jwtdSzqyJyz.ssqx != ''">
             and jsj.ssqx = #{jwtdSzqyJyz.ssqx}
@@ -47,7 +48,7 @@
         <if test="jwtdSzqyJyz.sspcs != null and jwtdSzqyJyz.sspcs != ''">
             and jsj.sspcs = #{jwtdSzqyJyz.sspcs}
         </if>
-        <if test="jwtdSzqyJyz.sssq != null and jwtdSzqyJyz.sssq ''">
+        <if test="jwtdSzqyJyz.sssq != null and jwtdSzqyJyz.sssq != ''">
             and jsj.sssq = #{jwtdSzqyJyz.sssq}
         </if>
     </select>
@@ -57,6 +58,14 @@
     </select>
 
     <select id="selectCsjlById" resultType="org.springblade.modules.szqyCsjl.pojo.entity.JwtdSzqyCsjlEntity">
-        select * from jwtd.jwtd_szqy_csjl jsc where is_deleted = 0 and jyz_id = #{shtyxydm}
+        select * from jwpt.jwtd_szqy_csjl jsc where jsc.is_deleted = 0 and jsc.shtyxydm = #{shtyxydm}
+    </select>
+
+    <select id="selectShtyxydm" resultType="java.lang.String">
+        select shtyxydm from jwpt.jwtd_szqy_jyz jsj where jsj.is_deleted = 0 and jsj.shtyxydm = #{shtyxydm}
+    </select>
+
+    <select id="getJyzByDeptId" resultMap="jwtdSzqyJyzResultMap">
+        select * from jwtd_szqy_jyz where is_deleted = 0 and shtyxydm = #{deptId}
     </select>
 </mapper>

+ 2 - 5
src/main/java/org/springblade/modules/szqyJyz/pojo/entity/JwtdSzqyJyzEntity.java

@@ -77,11 +77,6 @@ public class JwtdSzqyJyzEntity extends BaseEntity {
 	@Schema(description = "证件号码")
 	private String zjhm;
 	/**
-	 * 联系电话
-	 */
-	@Schema(description = "联系电话")
-	private String lxdh;
-	/**
 	 * 责任民警
 	 */
 	@Schema(description = "责任民警")
@@ -132,4 +127,6 @@ public class JwtdSzqyJyzEntity extends BaseEntity {
 	private String sspcsMc;
 	@TableField(exist = false)
 	private String sssqMc;
+	@TableField(exist = false)
+	private String ssqxMc;
 }

+ 4 - 0
src/main/java/org/springblade/modules/szqyJyz/service/IJwtdSzqyJyzService.java

@@ -59,4 +59,8 @@ public interface IJwtdSzqyJyzService extends BaseService<JwtdSzqyJyzEntity> {
 	List<JwtdSzqyJyzExcel> exportJwtdSzqyJyz(Wrapper<JwtdSzqyJyzEntity> queryWrapper);
 
     List<JwtdSzqyCsjlEntity> selectCsjlById(String shtyxydm);
+
+	List<String> selectShtyxydm(String shtyxydm);
+
+	JwtdSzqyJyzEntity getJyzByDeptId(String deptId);
 }

+ 10 - 0
src/main/java/org/springblade/modules/szqyJyz/service/impl/JwtdSzqyJyzServiceImpl.java

@@ -64,4 +64,14 @@ public class JwtdSzqyJyzServiceImpl extends BaseServiceImpl<JwtdSzqyJyzMapper, J
 	public List<JwtdSzqyCsjlEntity> selectCsjlById(String shtyxydm) {
 		return baseMapper.selectCsjlById(shtyxydm);
 	}
+
+	@Override
+	public List<String> selectShtyxydm(String shtyxydm) {
+		return baseMapper.selectShtyxydm(shtyxydm);
+	}
+
+	@Override
+	public JwtdSzqyJyzEntity getJyzByDeptId(String deptId) {
+		return baseMapper.getJyzByDeptId(deptId);
+	}
 }

+ 2 - 0
src/main/resources/application.yml

@@ -245,6 +245,8 @@ blade:
       - /blade-desk/notice/submit
       - /blade-flow/model/submit
       - /blade-develop/datasource/submit
+      - /jwtdFfxc/save
+      - /jwtdFfxc/update
   #安全框架配置
   secure:
     #严格模式