Compare commits
5 Commits
631c4e914a
...
847fca16b3
Author | SHA1 | Date |
---|---|---|
|
847fca16b3 | |
|
b6bd78efd3 | |
|
d4d164ecbb | |
|
6b4933280b | |
|
3fae03a6e8 |
|
@ -59,6 +59,12 @@
|
|||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- 系统订单模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-payment-local-api</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -2,53 +2,58 @@ package com.nu.modules.wechart.controller;
|
|||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.nu.modules.bizEmployeesInfo.entity.BizEmployeesInfo;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.modules.systemorder.api.SystemOrderApi;
|
||||
import com.nu.modules.systemorder.entity.SystemOrderApiEntity;
|
||||
import com.nu.modules.wechart.entity.PayParam;
|
||||
import com.nu.modules.wechart.entity.WechatpayConfig;
|
||||
import com.wechat.pay.java.core.Config;
|
||||
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
|
||||
|
||||
import com.wechat.pay.java.core.exception.ServiceException;
|
||||
import com.wechat.pay.java.core.notification.NotificationConfig;
|
||||
import com.wechat.pay.java.core.notification.NotificationParser;
|
||||
import com.wechat.pay.java.core.notification.RequestParam;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiService;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
|
||||
import com.wechat.pay.java.service.payments.jsapi.model.*;
|
||||
import com.wechat.pay.java.service.payments.model.Transaction;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.wechat.pay.java.core.notification.RequestParam;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.security.MessageDigest;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/weiXinPay")
|
||||
|
@ -56,104 +61,161 @@ import com.google.gson.JsonParser;
|
|||
public class WechatPayController {
|
||||
@Autowired
|
||||
public WechatpayConfig wechatpayConfig;
|
||||
|
||||
@Autowired
|
||||
private SystemOrderApi systemOrderApi;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
/**
|
||||
* Native下单
|
||||
* 调用统一下单API,生成支付二维码
|
||||
* 调用统一下单API,生成支付二维码
|
||||
*/
|
||||
@PostMapping("/native")
|
||||
public Map<String,String> nativePay(@RequestBody Map<String,String> params) throws Exception {
|
||||
public Map<String, String> nativePay(@Valid @RequestBody PayParam params) throws Exception {
|
||||
//验证支付是否可用
|
||||
{
|
||||
com.alibaba.fastjson.JSONObject sysParams = sysConfigApi.getByKey("wechat_pay_enabled");
|
||||
Boolean wechatPayEnabled = sysParams.getBoolean("configValue");
|
||||
if (!wechatPayEnabled) {
|
||||
throw new RuntimeException("微信支付已关闭");
|
||||
}
|
||||
}
|
||||
|
||||
Config config =
|
||||
new RSAAutoCertificateConfig.Builder()
|
||||
.merchantId(wechatpayConfig.getMchId())
|
||||
.privateKeyFromPath(wechatpayConfig.getPrivateKeyPath())
|
||||
.merchantSerialNumber(wechatpayConfig.getMchSerialNo())
|
||||
.apiV3Key(wechatpayConfig.getApiV3Key())
|
||||
.build();
|
||||
Config config = new RSAAutoCertificateConfig.Builder().merchantId(wechatpayConfig.getMchId()).privateKeyFromPath(wechatpayConfig.getPrivateKeyPath()).merchantSerialNumber(wechatpayConfig.getMchSerialNo()).apiV3Key(wechatpayConfig.getApiV3Key()).build();
|
||||
// 构建service
|
||||
JsapiService service = new JsapiService.Builder().config(config).build();
|
||||
PrepayRequest request = new PrepayRequest();
|
||||
String title = params.get("title");
|
||||
String openId = params.get("openId");
|
||||
String amountPrice = params.get("amountPrice");
|
||||
String title = params.getTitle();//订单名称
|
||||
String openId = params.getOpenId();//客户openId
|
||||
BigDecimal amountPrice = params.getAmountPrice();//总价(支付金额)
|
||||
String orgCode = params.getOrgCode();//机构编码
|
||||
String nursingUnit = params.getNursingUnit();//护理单元
|
||||
String customerId = params.getCustomerId();//客户ID
|
||||
String orderType = params.getOrderType();//订单类型
|
||||
BigDecimal price = params.getPrice();//单价
|
||||
Integer count = params.getCount();//数量
|
||||
String unit = params.getUnit();//单位
|
||||
String seniorId = params.getSeniorId();//长者ID
|
||||
String orderDesc = params.getOrderDesc();//订单描述
|
||||
|
||||
String outTradeNo = IdUtil.simpleUUID();//商户订单号
|
||||
Amount amount = new Amount();
|
||||
amount.setTotal(Integer.parseInt(amountPrice));
|
||||
amount.setTotal(Integer.parseInt(amountPrice.toString()));
|
||||
request.setAmount(amount);
|
||||
request.setAppid(wechatpayConfig.getAppid());
|
||||
request.setMchid(wechatpayConfig.getMchId());
|
||||
request.setDescription(title);
|
||||
request.setNotifyUrl(wechatpayConfig.getNotifyDomain());
|
||||
request.setOutTradeNo(IdUtil.simpleUUID());
|
||||
request.setOutTradeNo(outTradeNo);
|
||||
Payer payer = new Payer();
|
||||
payer.setOpenid(openId);
|
||||
request.setPayer(payer);
|
||||
// 调用下单方法,得到应答
|
||||
PrepayResponse response = service.prepay(request);
|
||||
log.info("prepayId:" + response.getPrepayId());
|
||||
Map map = prepayWithRequestPayment(request,config);
|
||||
//存储订单数据
|
||||
{
|
||||
SystemOrderApiEntity systemOrderApiEntity = new SystemOrderApiEntity();
|
||||
systemOrderApiEntity.setOrgCode(orgCode);//机构编码(必传)
|
||||
systemOrderApiEntity.setNursingUnit(nursingUnit);//护理单元(必传)
|
||||
systemOrderApiEntity.setCustomerId(customerId);//客户ID(必传)
|
||||
systemOrderApiEntity.setOrderType(orderType);//订单类型(必传)
|
||||
systemOrderApiEntity.setPrice(price);//单价(必传)
|
||||
systemOrderApiEntity.setCount(count);//数量(必传)
|
||||
systemOrderApiEntity.setUnit(unit);//单位(必传)
|
||||
systemOrderApiEntity.setAmount(amountPrice);//总价(支付金额)(必传)
|
||||
systemOrderApiEntity.setSeniorId(seniorId);//长者ID(非必传)
|
||||
systemOrderApiEntity.setOpenId(openId);//客户openId(必传)
|
||||
systemOrderApiEntity.setOrderName(title);//订单名称(必传)
|
||||
systemOrderApiEntity.setOrderDescription(orderDesc);//订单描述(非必传)
|
||||
systemOrderApiEntity.setOutTradeNo(outTradeNo);//商户订单号
|
||||
systemOrderApiEntity.setOrderTime(new Date());//下单时间
|
||||
systemOrderApiEntity.setOrderStatus("created");//订单状态
|
||||
systemOrderApi.save(systemOrderApiEntity);
|
||||
}
|
||||
Map map = prepayWithRequestPayment(request, config);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回调起支付的参数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private Map<String,String> prepayWithRequestPayment(PrepayRequest request,Config config){
|
||||
Map<String,String> map = new HashMap<>();
|
||||
private Map<String, String> prepayWithRequestPayment(PrepayRequest request, Config config) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
JsapiServiceExtension jse = new JsapiServiceExtension.Builder().config(config).build();
|
||||
PrepayWithRequestPaymentResponse response = jse.prepayWithRequestPayment(request);
|
||||
map.put("appId",response.getAppId());
|
||||
map.put("timeStamp",response.getTimeStamp());
|
||||
map.put("nonceStr",response.getNonceStr());
|
||||
map.put("package",response.getPackageVal());
|
||||
map.put("signType",response.getSignType());
|
||||
map.put("paySign",response.getPaySign());
|
||||
map.put("appId", response.getAppId());
|
||||
map.put("timeStamp", response.getTimeStamp());
|
||||
map.put("nonceStr", response.getNonceStr());
|
||||
map.put("package", response.getPackageVal());
|
||||
map.put("signType", response.getSignType());
|
||||
map.put("paySign", response.getPaySign());
|
||||
return map;
|
||||
}
|
||||
|
||||
@PostMapping("/callback")
|
||||
public String courseNative(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
System.out.println("11111111111111");
|
||||
NotificationConfig config =
|
||||
new RSAAutoCertificateConfig.Builder()
|
||||
.merchantId(wechatpayConfig.getMchId())
|
||||
.apiV3Key(wechatpayConfig.getApiV3Key())
|
||||
.merchantSerialNumber(wechatpayConfig.getMchSerialNo())
|
||||
.privateKeyFromPath(wechatpayConfig.getPrivateKeyPath())
|
||||
.build();
|
||||
System.out.println("222222222222222"+config);
|
||||
NotificationConfig config = new RSAAutoCertificateConfig.Builder().merchantId(wechatpayConfig.getMchId()).apiV3Key(wechatpayConfig.getApiV3Key()).merchantSerialNumber(wechatpayConfig.getMchSerialNo()).privateKeyFromPath(wechatpayConfig.getPrivateKeyPath()).build();
|
||||
System.out.println("222222222222222" + config);
|
||||
// 从请求头中获取信息
|
||||
String timestamp = request.getHeader("Wechatpay-Timestamp");
|
||||
String nonce = request.getHeader("Wechatpay-Nonce");
|
||||
String signature = request.getHeader("Wechatpay-Signature");
|
||||
String singType = request.getHeader("Wechatpay-Signature-Type");
|
||||
String timestamp = request.getHeader("Wechatpay-Timestamp");
|
||||
String nonce = request.getHeader("Wechatpay-Nonce");
|
||||
String signature = request.getHeader("Wechatpay-Signature");
|
||||
String singType = request.getHeader("Wechatpay-Signature-Type");
|
||||
String wechatPayCertificateSerialNumber = request.getHeader("Wechatpay-Serial");
|
||||
|
||||
System.out.println("333333333333333");
|
||||
String requestBody = getRequestBody(request);
|
||||
|
||||
System.out.println("333333333333333"+requestBody);
|
||||
System.out.println("333333333333333" + requestBody);
|
||||
// 初始化解析器 NotificationParser
|
||||
NotificationParser parser = new NotificationParser(config);
|
||||
System.out.println("444444444444444444444" + parser);
|
||||
RequestParam requestParam = new RequestParam.Builder()
|
||||
.serialNumber(wechatPayCertificateSerialNumber)
|
||||
.nonce(nonce)
|
||||
.signature(signature)
|
||||
.timestamp(timestamp)
|
||||
.signType(singType)
|
||||
.body(requestBody)
|
||||
.build();
|
||||
RequestParam requestParam = new RequestParam.Builder().serialNumber(wechatPayCertificateSerialNumber).nonce(nonce).signature(signature).timestamp(timestamp).signType(singType).body(requestBody).build();
|
||||
System.out.println("555555555555555555555" + requestParam);
|
||||
try {
|
||||
// 这个Transaction是微信包里面的
|
||||
Transaction decryptObject = parser.parse( requestParam, Transaction.class);
|
||||
Transaction decryptObject = parser.parse(requestParam, Transaction.class);
|
||||
|
||||
System.out.println("666666666666666666:"+decryptObject);
|
||||
System.out.println("666666666666666666:" + decryptObject);
|
||||
|
||||
// 获取各项信息
|
||||
String openId = decryptObject.getPayer().getOpenid(); // 用户openId
|
||||
Integer amount = decryptObject.getAmount().getTotal(); // 订单金额(分)
|
||||
String successTime = decryptObject.getSuccessTime(); // 支付成功时间
|
||||
String tradeState = decryptObject.getTradeState().toString(); // 订单状态
|
||||
String tradeStateDesc = decryptObject.getTradeStateDesc(); // 交易状态描述
|
||||
String rawData = requestBody; // 回执报文(原始请求体)
|
||||
|
||||
// 打印获取的信息
|
||||
System.out.println("OpenID: " + openId);
|
||||
System.out.println("金额(分): " + amount);
|
||||
System.out.println("支付成功时间: " + successTime);
|
||||
System.out.println("订单状态: " + tradeState);
|
||||
System.out.println("状态描述: " + tradeStateDesc);
|
||||
System.out.println("原始报文: " + rawData);
|
||||
//系统订单表状态更新
|
||||
{
|
||||
SystemOrderApiEntity systemOrderApiEntity = new SystemOrderApiEntity();
|
||||
systemOrderApiEntity.setOutTradeNo(decryptObject.getOutTradeNo());//商户订单号
|
||||
systemOrderApiEntity.setTransactionId(decryptObject.getTransactionId());//微信支付订单号
|
||||
systemOrderApiEntity.setOrderStatus(decryptObject.getTradeState().name());//支付状态
|
||||
systemOrderApiEntity.setReceiptDescription(decryptObject.getTradeStateDesc());//回执描述
|
||||
systemOrderApiEntity.setReceiptMessage(new ObjectMapper().writeValueAsString(decryptObject));//回执报文
|
||||
systemOrderApiEntity.setReceiptTime(new Date());
|
||||
systemOrderApi.updateByOutTradeNo(systemOrderApiEntity);
|
||||
|
||||
//如果订单支付成功则向表中插入定时任务
|
||||
if ("SUCCESS".equals(decryptObject.getTradeState().name())) {
|
||||
SystemOrderApiEntity systemOrder = systemOrderApi.selectByOutTradeNo(decryptObject.getOutTradeNo());
|
||||
|
||||
}
|
||||
}
|
||||
return decryptObject.getTradeState().toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -161,44 +223,37 @@ public class WechatPayController {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
// 获取请求头里的数据
|
||||
private String getRequestBody(HttpServletRequest request) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
try (
|
||||
ServletInputStream inputStream = request.getInputStream();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
|
||||
) {
|
||||
try (ServletInputStream inputStream = request.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println("读取数据流异常:"+e);
|
||||
System.out.println("读取数据流异常:" + e);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/queryOrderById")
|
||||
public Map<String,Object> queryOrderById(@RequestBody Map<String,String> params) throws Exception {
|
||||
public Map<String, Object> queryOrderById(@RequestBody Map<String, String> params) throws Exception {
|
||||
|
||||
|
||||
|
||||
Config config =
|
||||
new RSAAutoCertificateConfig.Builder()
|
||||
.merchantId(wechatpayConfig.getMchId())
|
||||
.privateKeyFromPath(wechatpayConfig.getPrivateKeyPath())
|
||||
.merchantSerialNumber(wechatpayConfig.getMchSerialNo())
|
||||
.apiV3Key(wechatpayConfig.getApiV3Key())
|
||||
.build();
|
||||
Config config = new RSAAutoCertificateConfig.Builder().merchantId(wechatpayConfig.getMchId()).privateKeyFromPath(wechatpayConfig.getPrivateKeyPath()).merchantSerialNumber(wechatpayConfig.getMchSerialNo()).apiV3Key(wechatpayConfig.getApiV3Key()).build();
|
||||
String prepay_id = params.get("prepay_id");
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
if(StringUtils.isEmpty(prepay_id)){
|
||||
map.put("code","400");
|
||||
map.put("msg","参数错误,prepay_id为空!");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (StringUtils.isEmpty(prepay_id)) {
|
||||
map.put("code", "400");
|
||||
map.put("msg", "参数错误,prepay_id为空!");
|
||||
return map;
|
||||
}
|
||||
// 构建service
|
||||
|
@ -210,8 +265,8 @@ public class WechatPayController {
|
|||
try {
|
||||
Transaction result = service.queryOrderById(queryRequest);
|
||||
System.out.println(result.getTradeState());
|
||||
map.put("code","200");
|
||||
map.put("msg",result);
|
||||
map.put("code", "200");
|
||||
map.put("msg", result);
|
||||
} catch (ServiceException e) {
|
||||
// API返回失败, 例如ORDER_NOT_EXISTS
|
||||
System.out.printf("code=[%s], message=[%s]\n", e.getErrorCode(), e.getErrorMessage());
|
||||
|
@ -221,50 +276,36 @@ public class WechatPayController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
public static final String GET_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token";// 获取access
|
||||
|
||||
// 获取token
|
||||
public static String getToken(String apiurl, String appid, String secret)
|
||||
{
|
||||
String turl = String.format(
|
||||
"%s?grant_type=client_credential&appid=%s&secret=%s", apiurl,
|
||||
appid, secret);
|
||||
public static String getToken(String apiurl, String appid, String secret) {
|
||||
String turl = String.format("%s?grant_type=client_credential&appid=%s&secret=%s", apiurl, appid, secret);
|
||||
System.out.println("turl:" + turl);
|
||||
HttpClient client = new DefaultHttpClient();
|
||||
HttpGet get = new HttpGet(turl);
|
||||
System.out.println("get:" + get);
|
||||
JsonParser jsonparer = new JsonParser();// 初始化解析json格式的对象
|
||||
String result = null;
|
||||
try
|
||||
{
|
||||
try {
|
||||
HttpResponse res = client.execute(get);
|
||||
System.out.println("res:" + res);
|
||||
String responseContent = null; // 响应内容
|
||||
HttpEntity entity = res.getEntity();
|
||||
System.out.println("entity:" + entity);
|
||||
responseContent = EntityUtils.toString(entity, "UTF-8");
|
||||
JsonObject json = jsonparer.parse(responseContent)
|
||||
.getAsJsonObject();
|
||||
JsonObject json = jsonparer.parse(responseContent).getAsJsonObject();
|
||||
System.out.println("json:" + json);
|
||||
// 将json字符串转换为json对象
|
||||
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK)
|
||||
{
|
||||
if (json.get("errcode") != null)
|
||||
{// 错误时微信会返回错误码等信息,{"errcode":40013,"errmsg":"invalid appid"}
|
||||
}
|
||||
else
|
||||
{// 正常情况下{"access_token":"ACCESS_TOKEN","expires_in":7200}
|
||||
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
|
||||
if (json.get("errcode") != null) {// 错误时微信会返回错误码等信息,{"errcode":40013,"errmsg":"invalid appid"}
|
||||
} else {// 正常情况下{"access_token":"ACCESS_TOKEN","expires_in":7200}
|
||||
result = json.get("access_token").getAsString();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
} finally {
|
||||
// 关闭连接 ,释放资源
|
||||
client.getConnectionManager().shutdown();
|
||||
return result;
|
||||
|
@ -273,27 +314,27 @@ public class WechatPayController {
|
|||
|
||||
|
||||
@PostMapping("/getUserInfo")
|
||||
public JSONObject getWxUserInfo(@RequestBody Map<String,String> params) throws Exception {
|
||||
public JSONObject getWxUserInfo(@RequestBody Map<String, String> params) throws Exception {
|
||||
String accessToken = params.get("access_token");
|
||||
String openid = params.get("openid");
|
||||
System.out.println("---------token-------"+accessToken);
|
||||
System.out.println("---------token-------" + accessToken);
|
||||
// 构造请求URL
|
||||
String requestUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=" + accessToken + "&openid=" + openid + "&lang=zh_CN";
|
||||
|
||||
// 发送HTTP请求,并获取返回结果
|
||||
HttpGet httpGet = new HttpGet(requestUrl);
|
||||
System.out.println("---------httpGet-------"+httpGet);
|
||||
System.out.println("---------httpGet-------" + httpGet);
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
System.out.println("---------httpClient-------"+httpClient);
|
||||
System.out.println("---------httpClient-------" + httpClient);
|
||||
CloseableHttpResponse httpResponse = httpClient.execute(httpGet);
|
||||
System.out.println("---------httpResponse-------"+httpResponse);
|
||||
System.out.println("---------httpResponse-------" + httpResponse);
|
||||
HttpEntity httpEntity = httpResponse.getEntity();
|
||||
System.out.println("---------httpEntity-------"+httpEntity);
|
||||
System.out.println("---------httpEntity-------" + httpEntity);
|
||||
String responseJson = EntityUtils.toString(httpEntity, "UTF-8");
|
||||
System.out.println("---------responseJson-------"+responseJson);
|
||||
System.out.println("---------responseJson-------" + responseJson);
|
||||
// 解析返回结果,获取手机号
|
||||
JSONObject jsonObject = new JSONObject(responseJson);
|
||||
System.out.println("---------jsonObject-------"+jsonObject);
|
||||
System.out.println("---------jsonObject-------" + jsonObject);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
@ -303,21 +344,21 @@ public class WechatPayController {
|
|||
String accessToken = getToken(GET_TOKEN_URL, wechatpayConfig.getAppid(), wechatpayConfig.getAppsecret());// 获取token
|
||||
String firstUrl = params.get("url");
|
||||
System.out.println("---------firstUrl-------"+firstUrl);
|
||||
System.out.println("---------token-------"+accessToken);
|
||||
System.out.println("---------token-------" + accessToken);
|
||||
// 构造请求URL
|
||||
String requestUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi";
|
||||
|
||||
// 发送HTTP请求,并获取返回结果
|
||||
HttpGet httpGet = new HttpGet(requestUrl);
|
||||
System.out.println("---------httpGet-------"+httpGet);
|
||||
System.out.println("---------httpGet-------" + httpGet);
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
System.out.println("---------httpClient-------"+httpClient);
|
||||
System.out.println("---------httpClient-------" + httpClient);
|
||||
CloseableHttpResponse httpResponse = httpClient.execute(httpGet);
|
||||
System.out.println("---------httpResponse-------"+httpResponse);
|
||||
System.out.println("---------httpResponse-------" + httpResponse);
|
||||
HttpEntity httpEntity = httpResponse.getEntity();
|
||||
System.out.println("---------httpEntity-------"+httpEntity);
|
||||
System.out.println("---------httpEntity-------" + httpEntity);
|
||||
String responseJson = EntityUtils.toString(httpEntity, "UTF-8");
|
||||
System.out.println("---------responseJson-------"+responseJson);
|
||||
System.out.println("---------responseJson-------" + responseJson);
|
||||
// 解析返回结果,获取手机号
|
||||
JSONObject jsonObject = new JSONObject(responseJson);
|
||||
String ticket = String.valueOf(jsonObject.get("ticket"));
|
||||
|
@ -333,16 +374,19 @@ public class WechatPayController {
|
|||
.toString();// 得到签名
|
||||
String signature = encryptSHA(string1);
|
||||
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
map.put("signature", signature);
|
||||
map.put("timestamp", timestamp);
|
||||
map.put("nonceStr", nonceStr);
|
||||
map.put("firstUrl", firstUrl);
|
||||
|
||||
System.out.println("---------jsonObject-------"+signature);
|
||||
System.out.println("---------jsonObject-------" + signature);
|
||||
return map;
|
||||
}
|
||||
/** * sha */
|
||||
|
||||
/**
|
||||
* sha
|
||||
*/
|
||||
private static String encryptSHA(String signStr) {
|
||||
StringBuffer hexValue = new StringBuffer();
|
||||
try {
|
||||
|
@ -357,8 +401,10 @@ public class WechatPayController {
|
|||
hexValue.append(Integer.toHexString(val));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(); return "";
|
||||
} return hexValue.toString();
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
return hexValue.toString();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
package com.nu.modules.wechart.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 支付参数实体类(系统需要用到的)
|
||||
*/
|
||||
@Data
|
||||
public class PayParam {
|
||||
|
||||
// 机构编码
|
||||
@NotBlank(message = "机构编码不能为空")
|
||||
private String orgCode;
|
||||
|
||||
// 护理单元编码
|
||||
@NotBlank(message = "护理单元编码不能为空")
|
||||
private String nursingUnit;
|
||||
|
||||
// 客户ID
|
||||
@NotBlank(message = "客户ID不能为空")
|
||||
private String customerId;
|
||||
|
||||
// 微信的openId
|
||||
@NotBlank(message = "微信openId不能为空")
|
||||
private String openId;
|
||||
|
||||
// 长者ID(非必填)
|
||||
private String seniorId;
|
||||
|
||||
// 订单类型
|
||||
@NotBlank(message = "订单类型不能为空")
|
||||
private String orderType;
|
||||
|
||||
// 单价
|
||||
@NotNull(message = "单价不能为空")
|
||||
private BigDecimal price;
|
||||
|
||||
// 数量
|
||||
@NotNull(message = "数量不能为空")
|
||||
private Integer count;
|
||||
|
||||
// 单位
|
||||
@NotBlank(message = "单位不能为空")
|
||||
private String unit;
|
||||
|
||||
// 总价
|
||||
@NotNull(message = "总价不能为空")
|
||||
private BigDecimal amountPrice;
|
||||
|
||||
// 订单名称
|
||||
@NotBlank(message = "订单名称不能为空")
|
||||
private String title;
|
||||
|
||||
// 订单描述(非必填)
|
||||
private String orderDesc;
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.nu.modules.commonutils;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.nu.modules.documentrecognition;
|
||||
|
||||
import com.aliyun.sdk.service.ocr_api20210707.models.*;
|
||||
import com.nu.modules.aliyun.documentrecognition.DocumentRecognitionUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -26,12 +28,12 @@ public class DocumentRecognitionApi {
|
|||
* @param file 图片文件
|
||||
*/
|
||||
@PostMapping("/idCard")
|
||||
public Result<String> recognizeIdCard(
|
||||
public Result<RecognizeIdcardResponseBody> recognizeIdCard(
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
|
||||
DocumentRecognitionUtils utils = new DocumentRecognitionUtils(accessKeyId, accessKeySecret);
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
String result = utils.recognizeIdCard(inputStream);
|
||||
RecognizeIdcardResponseBody result = utils.recognizeIdCard(inputStream);
|
||||
return Result.ok(result);
|
||||
} catch (Exception e) {
|
||||
return Result.error("身份证识别失败: " + e.getMessage());
|
||||
|
@ -45,12 +47,12 @@ public class DocumentRecognitionApi {
|
|||
* @param file 图片文件
|
||||
*/
|
||||
@PostMapping("/household")
|
||||
public Result<String> recognizeHousehold(
|
||||
public Result<RecognizeHouseholdResponseBody> recognizeHousehold(
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
|
||||
DocumentRecognitionUtils utils = new DocumentRecognitionUtils(accessKeyId, accessKeySecret);
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
String result = utils.recognizeHouseholdRegister(inputStream);
|
||||
RecognizeHouseholdResponseBody result = utils.recognizeHouseholdRegister(inputStream);
|
||||
return Result.ok(result);
|
||||
} catch (Exception e) {
|
||||
return Result.error("户口本识别失败: " + e.getMessage());
|
||||
|
@ -64,12 +66,12 @@ public class DocumentRecognitionApi {
|
|||
* @param file 图片文件
|
||||
*/
|
||||
@PostMapping("/bankCard")
|
||||
public Result<String> recognizeBankCard(
|
||||
public Result<RecognizeBankCardResponseBody> recognizeBankCard(
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
|
||||
DocumentRecognitionUtils utils = new DocumentRecognitionUtils(accessKeyId, accessKeySecret);
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
String result = utils.recognizeBankCard(inputStream);
|
||||
RecognizeBankCardResponseBody result = utils.recognizeBankCard(inputStream);
|
||||
return Result.ok(result);
|
||||
} catch (Exception e) {
|
||||
return Result.error("银行卡识别失败: " + e.getMessage());
|
||||
|
@ -83,12 +85,12 @@ public class DocumentRecognitionApi {
|
|||
* @param file 图片文件
|
||||
*/
|
||||
@PostMapping("/medicalCard")
|
||||
public Result<String> recognizeMedicalCard(
|
||||
public Result<RecognizeSocialSecurityCardVersionIIResponseBody> recognizeMedicalCard(
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
|
||||
DocumentRecognitionUtils utils = new DocumentRecognitionUtils(accessKeyId, accessKeySecret);
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
String result = utils.recognizeMedicalCard(inputStream);
|
||||
RecognizeSocialSecurityCardVersionIIResponseBody result = utils.recognizeMedicalCard(inputStream);
|
||||
return Result.ok(result);
|
||||
} catch (Exception e) {
|
||||
return Result.error("医保卡识别失败: " + e.getMessage());
|
||||
|
@ -97,4 +99,22 @@ public class DocumentRecognitionApi {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 营业执照识别
|
||||
* @param file 图片文件
|
||||
*/
|
||||
@PostMapping("/businessLicense")
|
||||
public Result<RecognizeBusinessLicenseResponseBody> recognizeBusinessLicense(
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
|
||||
DocumentRecognitionUtils utils = new DocumentRecognitionUtils(accessKeyId, accessKeySecret);
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
RecognizeBusinessLicenseResponseBody result = utils.recognizeBusinessLicense(inputStream);
|
||||
return Result.ok(result);
|
||||
} catch (Exception e) {
|
||||
return Result.error("营业执照识别失败: " + e.getMessage());
|
||||
} finally {
|
||||
utils.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import io.swagger.annotations.Api;
|
|||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -40,7 +41,6 @@ public class AppCameraInfoController extends JeecgController<AppCameraInfo, IApp
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "护理单元-物联管理-摄像头信息-分页列表查询")
|
||||
@ApiOperation(value="护理单元-物联管理-摄像头信息-分页列表查询", notes="护理单元-物联管理-摄像头信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<AppCameraInfo>> queryPageList(AppCameraInfo CameraInfo,
|
||||
|
|
|
@ -13,8 +13,8 @@ public class YouBianCodeUtil {
|
|||
|
||||
// 数字位数(默认生成3位的数字)
|
||||
|
||||
/**代表数字位数*/
|
||||
private static final int NUM_LENGTH = 2;
|
||||
/**代表数字位数*/
|
||||
private static final int NUM_LENGTH = 3;
|
||||
|
||||
public static final int ZHANWEI_LENGTH = 1+ NUM_LENGTH;
|
||||
|
||||
|
@ -34,6 +34,9 @@ public class YouBianCodeUtil {
|
|||
String num = getStrNum(1);
|
||||
newcode = zimu + num;
|
||||
} else {
|
||||
if(!code.startsWith("A")){
|
||||
code = "A"+code;
|
||||
}
|
||||
String beforeCode = code.substring(0, code.length() - 1- NUM_LENGTH);
|
||||
String afterCode = code.substring(code.length() - 1 - NUM_LENGTH,code.length());
|
||||
char afterCodeZimu = afterCode.substring(0, 1).charAt(0);
|
||||
|
@ -83,10 +86,11 @@ public class YouBianCodeUtil {
|
|||
if(localCode!=null && localCode!=""){
|
||||
|
||||
// return parentCode + getNextYouBianCode(localCode);
|
||||
return getNextYouBianCode(localCode);
|
||||
return getNextYouBianCode(localCode).replace("A","");
|
||||
|
||||
}else{
|
||||
parentCode = parentCode + "A"+ getNextStrNum(0);
|
||||
// parentCode = parentCode + "A"+ getNextStrNum(0);
|
||||
parentCode = parentCode + getNextStrNum(0);
|
||||
}
|
||||
return parentCode;
|
||||
}
|
||||
|
@ -148,9 +152,9 @@ public class YouBianCodeUtil {
|
|||
if(length==0){
|
||||
return 0;
|
||||
}
|
||||
StringBuilder maxNum = new StringBuilder();
|
||||
StringBuilder maxNum = new StringBuilder();
|
||||
for (int i=0;i<length;i++){
|
||||
maxNum.append("9");
|
||||
maxNum.append("9");
|
||||
}
|
||||
return Integer.parseInt(maxNum.toString());
|
||||
}
|
||||
|
|
|
@ -2,9 +2,8 @@ package com.nu.modules.aliyun.documentrecognition;
|
|||
|
||||
import com.aliyun.auth.credentials.Credential;
|
||||
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
|
||||
import com.aliyun.sdk.service.ocr_api20210707.*;
|
||||
import com.aliyun.sdk.service.ocr_api20210707.AsyncClient;
|
||||
import com.aliyun.sdk.service.ocr_api20210707.models.*;
|
||||
import com.google.gson.Gson;
|
||||
import darabonba.core.client.ClientOverrideConfiguration;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
@ -45,58 +44,77 @@ public class DocumentRecognitionUtils {
|
|||
* @param inputStream 图片输入流
|
||||
* @return 识别结果JSON字符串
|
||||
*/
|
||||
public String recognizeIdCard(InputStream inputStream) throws Exception {
|
||||
public RecognizeIdcardResponseBody recognizeIdCard(InputStream inputStream) throws Exception {
|
||||
RecognizeIdcardRequest request = RecognizeIdcardRequest.builder()
|
||||
.body(inputStream)
|
||||
.build();
|
||||
|
||||
CompletableFuture<RecognizeIdcardResponse> future = client.recognizeIdcard(request);
|
||||
RecognizeIdcardResponse response = future.get();
|
||||
return new Gson().toJson(response.getBody());
|
||||
return response.getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* 识别户口本首页
|
||||
*
|
||||
* @param inputStream 图片输入流
|
||||
* @return 识别结果JSON字符串
|
||||
*/
|
||||
public String recognizeHouseholdRegister(InputStream inputStream) throws Exception {
|
||||
public RecognizeHouseholdResponseBody recognizeHouseholdRegister(InputStream inputStream) throws Exception {
|
||||
RecognizeHouseholdRequest request = RecognizeHouseholdRequest.builder()
|
||||
.body(inputStream)
|
||||
.build();
|
||||
|
||||
CompletableFuture<RecognizeHouseholdResponse> future = client.recognizeHousehold(request);
|
||||
RecognizeHouseholdResponse response = future.get();
|
||||
return new Gson().toJson(response.getBody());
|
||||
return response.getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* 识别银行卡
|
||||
*
|
||||
* @param inputStream 图片输入流
|
||||
* @return 识别结果JSON字符串
|
||||
*/
|
||||
public String recognizeBankCard(InputStream inputStream) throws Exception {
|
||||
public RecognizeBankCardResponseBody recognizeBankCard(InputStream inputStream) throws Exception {
|
||||
RecognizeBankCardRequest request = RecognizeBankCardRequest.builder()
|
||||
.body(inputStream)
|
||||
.build();
|
||||
|
||||
CompletableFuture<RecognizeBankCardResponse> future = client.recognizeBankCard(request);
|
||||
RecognizeBankCardResponse response = future.get();
|
||||
return new Gson().toJson(response.getBody());
|
||||
return response.getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* 识别医保卡
|
||||
*
|
||||
* @param inputStream 图片输入流
|
||||
* @return 识别结果JSON字符串
|
||||
*/
|
||||
public String recognizeMedicalCard(InputStream inputStream) throws Exception {
|
||||
public RecognizeSocialSecurityCardVersionIIResponseBody recognizeMedicalCard(InputStream inputStream) throws Exception {
|
||||
RecognizeSocialSecurityCardVersionIIRequest request = RecognizeSocialSecurityCardVersionIIRequest.builder()
|
||||
.body(inputStream)
|
||||
.build();
|
||||
|
||||
CompletableFuture<RecognizeSocialSecurityCardVersionIIResponse> future = client.recognizeSocialSecurityCardVersionII(request);
|
||||
RecognizeSocialSecurityCardVersionIIResponse response = future.get();
|
||||
return new Gson().toJson(response.getBody());
|
||||
return response.getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* 识别营业执照
|
||||
*
|
||||
* @param inputStream 图片输入流
|
||||
* @return 识别结果JSON字符串
|
||||
*/
|
||||
public RecognizeBusinessLicenseResponseBody recognizeBusinessLicense(InputStream inputStream) throws Exception {
|
||||
RecognizeBusinessLicenseRequest request = RecognizeBusinessLicenseRequest.builder()
|
||||
.body(inputStream)
|
||||
.build();
|
||||
|
||||
CompletableFuture<RecognizeBusinessLicenseResponse> future = client.recognizeBusinessLicense(request);
|
||||
RecognizeBusinessLicenseResponse response = future.get();
|
||||
return response.getBody();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.nu.modules.systemorder.api;
|
||||
|
||||
import com.nu.modules.systemorder.entity.SystemOrderApiEntity;
|
||||
|
||||
public interface SystemOrderApi {
|
||||
|
||||
|
||||
int save(SystemOrderApiEntity systemOrder);
|
||||
|
||||
/**
|
||||
* 通过transaction_id更新数据
|
||||
* @param systemOrder
|
||||
* @return
|
||||
*/
|
||||
int updateByOutTradeNo(SystemOrderApiEntity systemOrder);
|
||||
|
||||
/**
|
||||
* 根据商户订单号查询数据
|
||||
* @param outTradeNo
|
||||
* @return
|
||||
*/
|
||||
SystemOrderApiEntity selectByOutTradeNo(String outTradeNo);
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package com.nu.modules.systemorder.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 系统订单
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-06-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class SystemOrderApiEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键ID*/
|
||||
private String id;
|
||||
/**机构编码*/
|
||||
private String orgCode;
|
||||
/**护理单元*/
|
||||
private String nursingUnit;
|
||||
/**支付人的openId*/
|
||||
private String openId;
|
||||
/**客户id(系统中的)*/
|
||||
private String customerId;
|
||||
/**订单类型(字典order_type)*/
|
||||
private String orderType;
|
||||
/**下单时间*/
|
||||
private Date orderTime;
|
||||
/**回执时间*/
|
||||
private Date receiptTime;
|
||||
/**订单状态*/
|
||||
private String orderStatus;
|
||||
/**订单名称*/
|
||||
private String orderName;
|
||||
/**订单描述(咱们自己说明的跟微信支付回执没关系)*/
|
||||
private String orderDescription;
|
||||
/**回执描述*/
|
||||
private String receiptDescription;
|
||||
/**回执报文*/
|
||||
private String receiptMessage;
|
||||
/**单价*/
|
||||
private BigDecimal price;
|
||||
/**数量*/
|
||||
private Integer count;
|
||||
/**单位*/
|
||||
private String unit;
|
||||
/**支付金额(总价)*/
|
||||
private BigDecimal amount;
|
||||
/**商户订单号*/
|
||||
private String outTradeNo;
|
||||
/**微信支付订单号*/
|
||||
private String transactionId;
|
||||
/**长者Id*/
|
||||
private String seniorId;
|
||||
}
|
|
@ -40,12 +40,12 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
|||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 系统订单表
|
||||
* @Description: 系统订单
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-05-30
|
||||
* @Date: 2025-06-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="系统订单表")
|
||||
@Api(tags="系统订单")
|
||||
@RestController
|
||||
@RequestMapping("/systemorder/systemOrder")
|
||||
@Slf4j
|
||||
|
@ -62,8 +62,8 @@ public class SystemOrderController extends JeecgController<SystemOrder, ISystemO
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "系统订单表-分页列表查询")
|
||||
@ApiOperation(value="系统订单表-分页列表查询", notes="系统订单表-分页列表查询")
|
||||
//@AutoLog(value = "系统订单-分页列表查询")
|
||||
@ApiOperation(value="系统订单-分页列表查询", notes="系统订单-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<SystemOrder>> queryPageList(SystemOrder systemOrder,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
@ -73,8 +73,8 @@ public class SystemOrderController extends JeecgController<SystemOrder, ISystemO
|
|||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("nursingUnit", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("customerId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("orderType", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("orderStatus", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<SystemOrder> queryWrapper = QueryGenerator.initQueryWrapper(systemOrder, req.getParameterMap(),customeRuleMap);
|
||||
Page<SystemOrder> page = new Page<SystemOrder>(pageNo, pageSize);
|
||||
IPage<SystemOrder> pageList = systemOrderService.page(page, queryWrapper);
|
||||
|
@ -87,8 +87,8 @@ public class SystemOrderController extends JeecgController<SystemOrder, ISystemO
|
|||
* @param systemOrder
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "系统订单表-添加")
|
||||
@ApiOperation(value="系统订单表-添加", notes="系统订单表-添加")
|
||||
@AutoLog(value = "系统订单-添加")
|
||||
@ApiOperation(value="系统订单-添加", notes="系统订单-添加")
|
||||
@RequiresPermissions("systemorder:nu_system_order:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody SystemOrder systemOrder) {
|
||||
|
@ -102,8 +102,8 @@ public class SystemOrderController extends JeecgController<SystemOrder, ISystemO
|
|||
* @param systemOrder
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "系统订单表-编辑")
|
||||
@ApiOperation(value="系统订单表-编辑", notes="系统订单表-编辑")
|
||||
@AutoLog(value = "系统订单-编辑")
|
||||
@ApiOperation(value="系统订单-编辑", notes="系统订单-编辑")
|
||||
@RequiresPermissions("systemorder:nu_system_order:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody SystemOrder systemOrder) {
|
||||
|
@ -117,8 +117,8 @@ public class SystemOrderController extends JeecgController<SystemOrder, ISystemO
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "系统订单表-通过id删除")
|
||||
@ApiOperation(value="系统订单表-通过id删除", notes="系统订单表-通过id删除")
|
||||
@AutoLog(value = "系统订单-通过id删除")
|
||||
@ApiOperation(value="系统订单-通过id删除", notes="系统订单-通过id删除")
|
||||
@RequiresPermissions("systemorder:nu_system_order:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
|
@ -132,8 +132,8 @@ public class SystemOrderController extends JeecgController<SystemOrder, ISystemO
|
|||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "系统订单表-批量删除")
|
||||
@ApiOperation(value="系统订单表-批量删除", notes="系统订单表-批量删除")
|
||||
@AutoLog(value = "系统订单-批量删除")
|
||||
@ApiOperation(value="系统订单-批量删除", notes="系统订单-批量删除")
|
||||
@RequiresPermissions("systemorder:nu_system_order:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
|
@ -147,8 +147,8 @@ public class SystemOrderController extends JeecgController<SystemOrder, ISystemO
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "系统订单表-通过id查询")
|
||||
@ApiOperation(value="系统订单表-通过id查询", notes="系统订单表-通过id查询")
|
||||
//@AutoLog(value = "系统订单-通过id查询")
|
||||
@ApiOperation(value="系统订单-通过id查询", notes="系统订单-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<SystemOrder> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
SystemOrder systemOrder = systemOrderService.getById(id);
|
||||
|
@ -167,7 +167,7 @@ public class SystemOrderController extends JeecgController<SystemOrder, ISystemO
|
|||
@RequiresPermissions("systemorder:nu_system_order:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SystemOrder systemOrder) {
|
||||
return super.exportXls(request, systemOrder, SystemOrder.class, "系统订单表");
|
||||
return super.exportXls(request, systemOrder, SystemOrder.class, "系统订单");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,16 +21,16 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 系统订单表
|
||||
* @Description: 系统订单
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-05-30
|
||||
* @Date: 2025-06-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_system_order")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_system_order对象", description="系统订单表")
|
||||
@ApiModel(value="nu_system_order对象", description="系统订单")
|
||||
public class SystemOrder implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -59,10 +59,6 @@ public class SystemOrder implements Serializable {
|
|||
@Dict(dicCode = "order_type")
|
||||
@ApiModelProperty(value = "订单类型(字典order_type)")
|
||||
private java.lang.String orderType;
|
||||
/**金额*/
|
||||
@Excel(name = "金额", width = 15)
|
||||
@ApiModelProperty(value = "金额")
|
||||
private java.math.BigDecimal amount;
|
||||
/**下单时间*/
|
||||
@Excel(name = "下单时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
@ -95,4 +91,32 @@ public class SystemOrder implements Serializable {
|
|||
@Excel(name = "回执报文", width = 15)
|
||||
@ApiModelProperty(value = "回执报文")
|
||||
private java.lang.String receiptMessage;
|
||||
/**单价*/
|
||||
@Excel(name = "单价", width = 15)
|
||||
@ApiModelProperty(value = "单价")
|
||||
private java.math.BigDecimal price;
|
||||
/**数量*/
|
||||
@Excel(name = "数量", width = 15)
|
||||
@ApiModelProperty(value = "数量")
|
||||
private java.lang.Integer count;
|
||||
/**单位*/
|
||||
@Excel(name = "单位", width = 15)
|
||||
@ApiModelProperty(value = "单位")
|
||||
private java.lang.String unit;
|
||||
/**支付金额(总价)*/
|
||||
@Excel(name = "支付金额(总价)", width = 15)
|
||||
@ApiModelProperty(value = "支付金额(总价)")
|
||||
private java.math.BigDecimal amount;
|
||||
/**商户订单号*/
|
||||
@Excel(name = "商户订单号", width = 15)
|
||||
@ApiModelProperty(value = "商户订单号")
|
||||
private java.lang.String outTradeNo;
|
||||
/**微信支付订单号*/
|
||||
@Excel(name = "微信支付订单号", width = 15)
|
||||
@ApiModelProperty(value = "微信支付订单号")
|
||||
private java.lang.String transactionId;
|
||||
/**长者Id*/
|
||||
@Excel(name = "长者Id", width = 15)
|
||||
@ApiModelProperty(value = "长者Id")
|
||||
private java.lang.String seniorId;
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@ import com.nu.modules.systemorder.entity.SystemOrder;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 系统订单表
|
||||
* @Description: 系统订单
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-05-30
|
||||
* @Date: 2025-06-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SystemOrderMapper extends BaseMapper<SystemOrder> {
|
||||
|
|
|
@ -4,9 +4,9 @@ import com.nu.modules.systemorder.entity.SystemOrder;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 系统订单表
|
||||
* @Description: 系统订单
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-05-30
|
||||
* @Date: 2025-06-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISystemOrderService extends IService<SystemOrder> {
|
||||
|
|
|
@ -1,19 +1,44 @@
|
|||
package com.nu.modules.systemorder.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.modules.systemorder.api.SystemOrderApi;
|
||||
import com.nu.modules.systemorder.entity.SystemOrder;
|
||||
import com.nu.modules.systemorder.entity.SystemOrderApiEntity;
|
||||
import com.nu.modules.systemorder.mapper.SystemOrderMapper;
|
||||
import com.nu.modules.systemorder.service.ISystemOrderService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 系统订单表
|
||||
* @Description: 系统订单
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-05-30
|
||||
* @Date: 2025-06-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SystemOrderServiceImpl extends ServiceImpl<SystemOrderMapper, SystemOrder> implements ISystemOrderService {
|
||||
public class SystemOrderServiceImpl extends ServiceImpl<SystemOrderMapper, SystemOrder> implements ISystemOrderService, SystemOrderApi {
|
||||
|
||||
@Override
|
||||
public int save(SystemOrderApiEntity systemOrderApiEntity) {
|
||||
SystemOrder systemOrder = new SystemOrder();
|
||||
BeanUtils.copyProperties(systemOrderApiEntity,systemOrder);
|
||||
return baseMapper.insert(systemOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByOutTradeNo(SystemOrderApiEntity systemOrderApiEntity) {
|
||||
SystemOrder systemOrder = new SystemOrder();
|
||||
BeanUtils.copyProperties(systemOrderApiEntity,systemOrder);
|
||||
return baseMapper.update(systemOrder,new QueryWrapper<SystemOrder>().eq("out_trade_no",systemOrderApiEntity.getOutTradeNo()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SystemOrderApiEntity selectByOutTradeNo(String outTradeNo) {
|
||||
SystemOrder systemOrder = baseMapper.selectOne(new QueryWrapper<SystemOrder>().eq("out_trade_no", outTradeNo));
|
||||
SystemOrderApiEntity systemOrderApiEntity = new SystemOrderApiEntity();
|
||||
BeanUtils.copyProperties(systemOrder,systemOrderApiEntity);
|
||||
return systemOrderApiEntity;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.apache.commons.lang.StringUtils;
|
|||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -62,16 +63,18 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
{
|
||||
List<String> meidsIds = list.stream().flatMap(directive -> Stream.of(directive.getMp3File(), directive.getMp4File(), directive.getPreviewFile(), directive.getImmediateFile())).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||
|
||||
List<JSONObject> mediaObjs = mediaManageApi.queryByIds(meidsIds);
|
||||
if (!CollectionUtils.isEmpty(meidsIds)) {
|
||||
List<JSONObject> mediaObjs = mediaManageApi.queryByIds(meidsIds);
|
||||
|
||||
Map<String, String> idToFilePathMap = mediaObjs.stream().collect(Collectors.toMap(media -> media.getStr("id"), media -> media.getStr("filePath")));
|
||||
Map<String, String> idToFilePathMap = mediaObjs.stream().collect(Collectors.toMap(media -> media.getStr("id"), media -> media.getStr("filePath")));
|
||||
|
||||
list.stream().forEach(record -> {
|
||||
record.setPreviewFileMedia(idToFilePathMap.get(record.getPreviewFile()));
|
||||
record.setImmediateFileMedia(idToFilePathMap.get(record.getImmediateFile()));
|
||||
record.setMp3FileMedia(idToFilePathMap.get(record.getMp3File()));
|
||||
record.setMp4FileMedia(idToFilePathMap.get(record.getMp4File()));
|
||||
});
|
||||
list.stream().forEach(record -> {
|
||||
record.setPreviewFileMedia(idToFilePathMap.get(record.getPreviewFile()));
|
||||
record.setImmediateFileMedia(idToFilePathMap.get(record.getImmediateFile()));
|
||||
record.setMp3FileMedia(idToFilePathMap.get(record.getMp3File()));
|
||||
record.setMp4FileMedia(idToFilePathMap.get(record.getMp4File()));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
//处理单元格合并所需数据
|
||||
|
@ -334,7 +337,7 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
|
||||
@Override
|
||||
public List<JSONObject> selectMediaList(String dataSourceCode, List<String> idList) {
|
||||
return mediaManageApi.selectByDirectiveIds(dataSourceCode,idList);
|
||||
return mediaManageApi.selectByDirectiveIds(dataSourceCode, idList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -79,6 +80,30 @@ public class SysDepart implements Serializable {
|
|||
*/
|
||||
@Excel(name = "协议+域名", width = 30)
|
||||
private String url;
|
||||
/**
|
||||
* 运营开始时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date operationStartTime;
|
||||
/**
|
||||
* 运营到期时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date operationEndTime;
|
||||
/**
|
||||
* 合同开始时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date contractStartTime;
|
||||
/**
|
||||
* 合同到期时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date contractEndTime;
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
|
@ -124,6 +149,11 @@ public class SysDepart implements Serializable {
|
|||
*/
|
||||
@Dict(dicCode = "del_flag")
|
||||
private String delFlag;
|
||||
/**
|
||||
* 应缴金额
|
||||
*/
|
||||
@Excel(name = "应缴金额", width = 15)
|
||||
private BigDecimal payableAmount;
|
||||
/**
|
||||
* 对接企业微信的ID
|
||||
*/
|
||||
|
@ -206,6 +236,10 @@ public class SysDepart implements Serializable {
|
|||
Objects.equals(orgType, depart.orgType) &&
|
||||
Objects.equals(orgCode, depart.orgCode) &&
|
||||
Objects.equals(url, depart.url) &&
|
||||
Objects.equals(operationStartTime, depart.operationStartTime) &&
|
||||
Objects.equals(operationEndTime, depart.operationEndTime) &&
|
||||
Objects.equals(contractStartTime, depart.contractStartTime) &&
|
||||
Objects.equals(contractEndTime, depart.contractEndTime) &&
|
||||
Objects.equals(province, depart.province) &&
|
||||
Objects.equals(city, depart.city) &&
|
||||
Objects.equals(district, depart.district) &&
|
||||
|
@ -219,6 +253,7 @@ public class SysDepart implements Serializable {
|
|||
Objects.equals(createTime, depart.createTime) &&
|
||||
Objects.equals(updateBy, depart.updateBy) &&
|
||||
Objects.equals(tenantId, depart.tenantId) &&
|
||||
Objects.equals(payableAmount, depart.payableAmount) &&
|
||||
Objects.equals(updateTime, depart.updateTime);
|
||||
}
|
||||
|
||||
|
@ -229,7 +264,8 @@ public class SysDepart implements Serializable {
|
|||
public int hashCode() {
|
||||
return Objects.hash(super.hashCode(), id, parentId, departName,
|
||||
departNameEn, departNameAbbr, departOrder, description, orgCategory,
|
||||
orgType, orgCode, url, province, city, district, mobile, fax, address, memo, status,
|
||||
delFlag, createBy, createTime, updateBy, updateTime, tenantId);
|
||||
orgType, orgCode, url, operationStartTime, operationEndTime, contractStartTime,
|
||||
contractEndTime, province, city, district, mobile, fax, address, memo, status,
|
||||
delFlag, createBy, createTime, updateBy, updateTime, tenantId, payableAmount);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.system.model;
|
|||
import org.jeecg.modules.system.entity.SysDepart;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -61,6 +62,14 @@ public class SysDepartTreeModel implements Serializable {
|
|||
|
||||
private String url;
|
||||
|
||||
private Date operationStartTime;
|
||||
|
||||
private Date operationEndTime;
|
||||
|
||||
private Date contractStartTime;
|
||||
|
||||
private Date contractEndTime;
|
||||
|
||||
private String province;
|
||||
|
||||
private String city;
|
||||
|
@ -81,6 +90,8 @@ public class SysDepartTreeModel implements Serializable {
|
|||
|
||||
private String qywxIdentifier;
|
||||
|
||||
private BigDecimal payableAmount;
|
||||
|
||||
private String createBy;
|
||||
|
||||
private Date createTime;
|
||||
|
@ -119,6 +130,10 @@ public class SysDepartTreeModel implements Serializable {
|
|||
this.orgType = sysDepart.getOrgType();
|
||||
this.orgCode = sysDepart.getOrgCode();
|
||||
this.url = sysDepart.getUrl();
|
||||
this.operationStartTime = sysDepart.getOperationStartTime();
|
||||
this.operationEndTime = sysDepart.getOperationEndTime();
|
||||
this.contractStartTime = sysDepart.getContractStartTime();
|
||||
this.contractEndTime = sysDepart.getContractEndTime();
|
||||
this.province = sysDepart.getProvince();
|
||||
this.city = sysDepart.getCity();
|
||||
this.district = sysDepart.getDistrict();
|
||||
|
@ -134,6 +149,7 @@ public class SysDepartTreeModel implements Serializable {
|
|||
this.updateBy = sysDepart.getUpdateBy();
|
||||
this.updateTime = sysDepart.getUpdateTime();
|
||||
this.directorUserIds = sysDepart.getDirectorUserIds();
|
||||
this.payableAmount = sysDepart.getPayableAmount();
|
||||
if (0 == sysDepart.getIzLeaf()) {
|
||||
this.isLeaf = false;
|
||||
} else {
|
||||
|
@ -405,6 +421,46 @@ public class SysDepartTreeModel implements Serializable {
|
|||
this.district = district;
|
||||
}
|
||||
|
||||
public BigDecimal getPayableAmount() {
|
||||
return payableAmount;
|
||||
}
|
||||
|
||||
public void setPayableAmount(BigDecimal payableAmount) {
|
||||
this.payableAmount = payableAmount;
|
||||
}
|
||||
|
||||
public Date getOperationStartTime() {
|
||||
return operationStartTime;
|
||||
}
|
||||
|
||||
public void setOperationStartTime(Date operationStartTime) {
|
||||
this.operationStartTime = operationStartTime;
|
||||
}
|
||||
|
||||
public Date getOperationEndTime() {
|
||||
return operationEndTime;
|
||||
}
|
||||
|
||||
public void setOperationEndTime(Date operationEndTime) {
|
||||
this.operationEndTime = operationEndTime;
|
||||
}
|
||||
|
||||
public Date getContractStartTime() {
|
||||
return contractStartTime;
|
||||
}
|
||||
|
||||
public void setContractStartTime(Date contractStartTime) {
|
||||
this.contractStartTime = contractStartTime;
|
||||
}
|
||||
|
||||
public Date getContractEndTime() {
|
||||
return contractEndTime;
|
||||
}
|
||||
|
||||
public void setContractEndTime(Date contractEndTime) {
|
||||
this.contractEndTime = contractEndTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重写equals方法
|
||||
*/
|
||||
|
@ -428,6 +484,10 @@ public class SysDepartTreeModel implements Serializable {
|
|||
Objects.equals(orgType, model.orgType) &&
|
||||
Objects.equals(orgCode, model.orgCode) &&
|
||||
Objects.equals(url, model.url) &&
|
||||
Objects.equals(operationStartTime, model.operationStartTime) &&
|
||||
Objects.equals(operationEndTime, model.operationEndTime) &&
|
||||
Objects.equals(contractStartTime, model.contractStartTime) &&
|
||||
Objects.equals(contractEndTime, model.contractEndTime) &&
|
||||
Objects.equals(province, model.province) &&
|
||||
Objects.equals(city, model.city) &&
|
||||
Objects.equals(district, model.district) &&
|
||||
|
@ -443,6 +503,7 @@ public class SysDepartTreeModel implements Serializable {
|
|||
Objects.equals(updateBy, model.updateBy) &&
|
||||
Objects.equals(updateTime, model.updateTime) &&
|
||||
Objects.equals(directorUserIds, model.directorUserIds) &&
|
||||
Objects.equals(payableAmount, model.payableAmount) &&
|
||||
Objects.equals(children, model.children);
|
||||
}
|
||||
|
||||
|
@ -453,9 +514,10 @@ public class SysDepartTreeModel implements Serializable {
|
|||
public int hashCode() {
|
||||
|
||||
return Objects.hash(id, parentId, departName, departNameEn, departNameAbbr,
|
||||
departOrder, description, orgCategory, orgType, orgCode, url, province, city, district, mobile, fax, address,
|
||||
memo, status, delFlag, qywxIdentifier, createBy, createTime, updateBy, updateTime,
|
||||
children, directorUserIds);
|
||||
departOrder, description, orgCategory, orgType, orgCode, operationStartTime,
|
||||
operationEndTime, contractStartTime, contractEndTime, url, province, city, district,
|
||||
mobile, fax, address, memo, status, delFlag, qywxIdentifier, createBy, createTime,
|
||||
updateBy, updateTime, children, directorUserIds, payableAmount);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class OrgCodeRule implements IFillRuleHandler {
|
|||
IPage<SysDepart> pageList = sysDepartService.getMaxCodeDepart(page,"");
|
||||
List<SysDepart> records = pageList.getRecords();
|
||||
if (null==records || records.size()==0) {
|
||||
//update-end---author:wangshuai ---date:20230211 for:[QQYUN-4209]租户隔离下部门新建不了------------
|
||||
//update-end---author:wangshuai ---date:20230211 for:[QQYUN-4209]租户隔离下部门新建不了------------
|
||||
strArray[0] = YouBianCodeUtil.getNextYouBianCode(null);
|
||||
strArray[1] = "1";
|
||||
return strArray;
|
||||
|
@ -70,6 +70,7 @@ public class OrgCodeRule implements IFillRuleHandler {
|
|||
oldOrgCode = depart.getOrgCode();
|
||||
orgType = depart.getOrgType();
|
||||
newOrgCode = YouBianCodeUtil.getNextYouBianCode(oldOrgCode);
|
||||
newOrgCode = newOrgCode.substring(1);
|
||||
}
|
||||
} else {//反之则查询出所有同级的部门,获取结果后有两种情况,有同级和没有同级
|
||||
//获取自己部门最大值orgCode部门信息
|
||||
|
|
|
@ -42,6 +42,7 @@ public class DictMQListener {
|
|||
|
||||
/**
|
||||
* fanout类型 发给所有人统一处理的
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
|
@ -62,6 +63,7 @@ public class DictMQListener {
|
|||
|
||||
/**
|
||||
* direct直连 只发给我的
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
|
@ -98,6 +100,7 @@ public class DictMQListener {
|
|||
}
|
||||
|
||||
try {
|
||||
//TODO 主键重复问题
|
||||
SysDict dict = dictService.getById(dto.getId());
|
||||
//如果是标识删除 查到的也是null 这里要处理的是只要在回收站就删除 重建
|
||||
if (dict == null || (dict != null && dict.getDelFlag() == 1)) {
|
||||
|
|
|
@ -54,6 +54,18 @@
|
|||
<artifactId>nu-services-biz</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<!-- 系统订单 模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-payment-biz</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<!-- 任务 模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-task-biz</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<!-- 接口 模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
|
|
|
@ -255,11 +255,11 @@ jeecg:
|
|||
app: http://localhost:8051
|
||||
path:
|
||||
#服务指令上传目录
|
||||
directivepath: /opt/upFiles002/directive
|
||||
directivepath: /cache/nu/opt/upFiles002/directive
|
||||
#文件上传根目录 设置
|
||||
upload: /opt/upFiles002
|
||||
upload: /cache/nu/opt/upFiles002
|
||||
#webapp文件路径
|
||||
webapp: /opt/webapp002
|
||||
webapp: /cache/nu/opt/webapp002
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储和大鱼短信秘钥配置
|
||||
|
|
|
@ -0,0 +1,407 @@
|
|||
server:
|
||||
port: 8083
|
||||
tomcat:
|
||||
max-swallow-size: -1
|
||||
error:
|
||||
include-exception: true
|
||||
include-stacktrace: ALWAYS
|
||||
include-message: ALWAYS
|
||||
servlet:
|
||||
context-path: /nursing-unit_003
|
||||
compression:
|
||||
enabled: true
|
||||
min-response-size: 1024
|
||||
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: metrics,jeecghttptrace
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: nursing-unit-003
|
||||
config:
|
||||
import:
|
||||
- optional:nacos:${spring.application.name}.yaml # 你的服务专属配置
|
||||
- optional:nacos:common-db.yaml
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 192.168.2.199:8848 # 直接写死IP(或保留${config.server-addr})
|
||||
namespace: public
|
||||
group: DEFAULT_GROUP
|
||||
config:
|
||||
server-addr: 192.168.2.199:8848
|
||||
namespace: public
|
||||
group: DEFAULT_GROUP
|
||||
file-extension: yaml
|
||||
# flyway配置
|
||||
flyway:
|
||||
# 是否启用flyway
|
||||
enabled: false
|
||||
# 编码格式,默认UTF-8
|
||||
encoding: UTF-8
|
||||
# 迁移sql脚本文件存放路径,官方默认db/migration
|
||||
locations: classpath:flyway/sql/mysql
|
||||
# 迁移sql脚本文件名称的前缀,默认V
|
||||
sql-migration-prefix: V
|
||||
# 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||
sql-migration-separator: __
|
||||
# 避免带${}sql执行失败
|
||||
placeholder-prefix: '#('
|
||||
placeholder-suffix: )
|
||||
# 迁移sql脚本文件名称的后缀
|
||||
sql-migration-suffixes: .sql
|
||||
# 迁移时是否进行校验,默认true
|
||||
validate-on-migrate: true
|
||||
# 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||
baseline-on-migrate: true
|
||||
# 是否关闭要清除已有库下的表功能,生产环境必须为true,否则会删库,非常重要!!!
|
||||
clean-disabled: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
mail:
|
||||
# 定时任务发送邮件
|
||||
timeJobSend: false
|
||||
host: smtp.163.com
|
||||
username: jeecgos@163.com
|
||||
password: ??
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
auth: true
|
||||
starttls:
|
||||
enable: true
|
||||
required: true
|
||||
## quartz定时任务,采用数据库方式
|
||||
quartz:
|
||||
job-store-type: jdbc
|
||||
initialize-schema: embedded
|
||||
#定时任务启动开关,true-开 false-关
|
||||
auto-startup: true
|
||||
#延迟1秒启动定时任务
|
||||
startup-delay: 1s
|
||||
#启动时更新己存在的Job
|
||||
overwrite-existing-jobs: true
|
||||
properties:
|
||||
org:
|
||||
quartz:
|
||||
scheduler:
|
||||
instanceName: MyScheduler
|
||||
instanceId: AUTO
|
||||
jobStore:
|
||||
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
|
||||
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
tablePrefix: QRTZ_
|
||||
isClustered: false
|
||||
misfireThreshold: 12000
|
||||
clusterCheckinInterval: 0 #心跳检查 之前是15000
|
||||
acquireTriggersWithinLock: false # 减少锁竞争
|
||||
threadPool:
|
||||
class: org.quartz.simpl.SimpleThreadPool
|
||||
threadCount: 10
|
||||
threadPriority: 5
|
||||
threadsInheritContextClassLoaderOfInitializingThread: true
|
||||
#json 时间戳统一转换
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
jpa:
|
||||
open-in-view: false
|
||||
aop:
|
||||
proxy-target-class: true
|
||||
#配置freemarker
|
||||
freemarker:
|
||||
# 设置模板后缀名
|
||||
suffix: .ftl
|
||||
# 设置文档类型
|
||||
content-type: text/html
|
||||
# 设置页面编码格式
|
||||
charset: UTF-8
|
||||
# 设置页面缓存
|
||||
cache: false
|
||||
prefer-file-system-access: false
|
||||
# 设置ftl文件路径
|
||||
template-loader-path:
|
||||
- classpath:/templates
|
||||
template_update_delay: 0
|
||||
# 设置静态文件路径,js,css等
|
||||
mvc:
|
||||
static-path-pattern: /**
|
||||
#Spring Boot 2.6+后映射匹配的默认策略已从AntPathMatcher更改为PathPatternParser,需要手动指定为ant-path-matcher
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
resource:
|
||||
static-locations: classpath:/static/,classpath:/public/
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
- org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
|
||||
datasource:
|
||||
druid:
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
loginUsername: admin
|
||||
loginPassword: 123456
|
||||
allow:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
dynamic:
|
||||
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
|
||||
# 连接池的配置信息
|
||||
# 初始化大小,最小,最大
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
maxActive: 1000
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 3600000
|
||||
validationQuery: SELECT 1
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||||
poolPreparedStatements: true
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||
filters: stat,wall,slf4j
|
||||
# 允许SELECT语句的WHERE子句是一个永真条件
|
||||
wall:
|
||||
selectWhereAlwayTrueCheck: false
|
||||
# 打开mergeSql功能;慢SQL记录
|
||||
stat:
|
||||
merge-sql: true
|
||||
slow-sql-millis: 5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://192.168.2.199:3306/nursing_unit_003?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: nu003
|
||||
password: nu003
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置-运维系统
|
||||
multi-datasource1:
|
||||
url: jdbc:mysql://192.168.2.199:3306/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: nu_sys
|
||||
password: nu_sys
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置-试验田
|
||||
nuro:
|
||||
url: jdbc:mysql://192.168.2.199:3306/nursing_unit_001?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: nu_ro
|
||||
password: nu_ro
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#redis 配置
|
||||
redis:
|
||||
database: 0
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
#rabbitmq 配置
|
||||
rabbitmq:
|
||||
host: 192.168.2.199
|
||||
prot: 5672
|
||||
username: hldy
|
||||
password: hldy
|
||||
virtual-host: /hldy
|
||||
#mybatis plus 设置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:com/nu/**/xml/*Mapper.xml
|
||||
global-config:
|
||||
# 关闭MP3.0自带的banner
|
||||
banner: false
|
||||
db-config:
|
||||
#主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
|
||||
id-type: ASSIGN_ID
|
||||
# 默认数据库表下划线命名
|
||||
table-underline: true
|
||||
configuration:
|
||||
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# 返回类型为Map,显示null对应的字段
|
||||
call-setters-on-nulls: true
|
||||
#jeecg专用配置
|
||||
minidao:
|
||||
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
|
||||
jeecg:
|
||||
# AI集成
|
||||
ai-chat:
|
||||
enabled: true
|
||||
model: deepseek-chat
|
||||
apiKey: ??
|
||||
apiHost: https://api.deepseek.com
|
||||
timeout: 60
|
||||
# 平台上线安全配置
|
||||
firewall:
|
||||
# 数据源安全 (开启后,Online报表和图表的数据源为必填)
|
||||
dataSourceSafe: false
|
||||
# 低代码模式(dev:开发模式,prod:发布模式——关闭所有在线开发配置能力)
|
||||
lowCodeMode: dev
|
||||
# 签名密钥串(前后端要一致,正式发布请自行修改)
|
||||
signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
|
||||
#签名拦截接口
|
||||
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys,/sys/sendChangePwdSms,/sys/user/sendChangePhoneSms,/sys/sms,/desform/api/sendVerifyCode
|
||||
# 本地:local、Minio:minio、阿里云:alioss
|
||||
uploadType: local
|
||||
# 前端访问地址
|
||||
domainUrl:
|
||||
pc: http://localhost:3100
|
||||
app: http://localhost:8051
|
||||
path:
|
||||
#服务指令上传目录
|
||||
directivepath: /cache/nu/opt/upFiles003/directive
|
||||
#文件上传根目录 设置
|
||||
upload: /cache/nu/opt/upFiles003
|
||||
#webapp文件路径
|
||||
webapp: /cache/nu/opt/webapp003
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储和大鱼短信秘钥配置
|
||||
oss:
|
||||
accessKey: ??
|
||||
secretKey: ??
|
||||
endpoint: oss-cn-beijing.aliyuncs.com
|
||||
bucketName: jeecgdev
|
||||
# 短信模板
|
||||
sms-template:
|
||||
# 签名
|
||||
signature:
|
||||
# 模板code
|
||||
templateCode:
|
||||
# 登录短信、忘记密码模板编码
|
||||
SMS_175435174:
|
||||
# 修改密码短信模板编码
|
||||
SMS_465391221:
|
||||
# 注册账号短信模板编码
|
||||
SMS_175430166:
|
||||
# 在线预览文件服务器地址配置
|
||||
file-view-domain: http://fileview.jeecg.com
|
||||
# minio文件上传
|
||||
minio:
|
||||
minio_url: http://minio.jeecg.com
|
||||
minio_name: ??
|
||||
minio_pass: ??
|
||||
bucketName: otatest
|
||||
#大屏报表参数设置
|
||||
jmreport:
|
||||
#多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离) (v1.6.2+ 新增)
|
||||
saasMode:
|
||||
# 平台上线安全配置(v1.6.2+ 新增)
|
||||
firewall:
|
||||
# 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
|
||||
dataSourceSafe: false
|
||||
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
|
||||
lowCodeMode: dev
|
||||
#xxl-job配置
|
||||
xxljob:
|
||||
enabled: false
|
||||
adminAddresses: http://127.0.0.1:9080/xxl-job-admin
|
||||
appname: ${spring.application.name}
|
||||
accessToken: ''
|
||||
address: 127.0.0.1:30007
|
||||
ip: 127.0.0.1
|
||||
port: 30007
|
||||
logPath: logs/jeecg/job/jobhandler/
|
||||
logRetentionDays: 30
|
||||
#分布式锁配置
|
||||
redisson:
|
||||
address: 127.0.0.1:6379
|
||||
password:
|
||||
type: STANDALONE
|
||||
enabled: true
|
||||
# 百度开放API配置
|
||||
baidu-api:
|
||||
app-id: ??
|
||||
api-key: ??
|
||||
secret-key: ??
|
||||
# ElasticSearch 6设置
|
||||
elasticsearch:
|
||||
cluster-name: jeecg-ES
|
||||
cluster-nodes: 127.0.0.1:9200
|
||||
check-enabled: false
|
||||
#cas单点登录
|
||||
cas:
|
||||
prefixUrl: http://cas.example.org:8443/cas
|
||||
#Mybatis输出sql日志
|
||||
logging:
|
||||
level:
|
||||
org.flywaydb: debug
|
||||
org.jeecg.modules.system.mapper: info
|
||||
com.nu.modules.system.mapper: info
|
||||
#swagger
|
||||
knife4j:
|
||||
#开启增强配置
|
||||
enable: true
|
||||
#开启生产环境屏蔽
|
||||
production: false
|
||||
basic:
|
||||
enable: false
|
||||
username: jeecg
|
||||
password: jeecg1314
|
||||
#第三方登录
|
||||
justauth:
|
||||
enabled: true
|
||||
type:
|
||||
GITHUB:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
|
||||
WECHAT_ENTERPRISE:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
|
||||
agent-id: ??
|
||||
DINGTALK:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
|
||||
WECHAT_OPEN:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
|
||||
cache:
|
||||
type: default
|
||||
prefix: 'demo::'
|
||||
timeout: 1h
|
||||
#tplink登录信息
|
||||
tplink:
|
||||
tums:
|
||||
url: https://121.36.88.64:8888
|
||||
username: admin
|
||||
password: Bl20230518
|
||||
ftp:
|
||||
ip: 1.92.152.160
|
||||
port: 21
|
||||
username: administrator
|
||||
password: Root@123..
|
||||
uploadpath: /
|
||||
#zmy
|
||||
aliyun:
|
||||
ocr:
|
||||
accessKeyId: LTAI5tMoCTt4sb9VQrcnZFsb
|
||||
accessKeySecret: pQBMT6TlUWgRfvvDnOu0IKVYXCfKee
|
||||
#文件传输秘钥
|
||||
downloadkey: hP2K9Z!WLuj"M#8,
|
||||
|
||||
# 微信支付
|
||||
wxpay:
|
||||
# APIv3密钥
|
||||
api-v3-key: asdfiuzwe3534565478WETDSAFRWEq1E
|
||||
# APPID
|
||||
appid: wx8fc3e4305d2fbf0b
|
||||
# appsecret
|
||||
appsecret: 3bf3dd4ec72f591432db6b28c2c044e5
|
||||
# 商户ID
|
||||
mch-id: 1717618860
|
||||
# 商户API证书序列号
|
||||
mch-serial-no: 3E51C9D24F64CE50E9273E544561D29684AB21C7
|
||||
# 接收结果通知地址
|
||||
notify-domain: https://www.focusnu.com/nursing-unit_0010507/weiXinPay/callback
|
||||
# 商户私钥文件路径
|
||||
private-key-path: /opt/nu001/apiclient_key.pem
|
|
@ -250,11 +250,11 @@ jeecg:
|
|||
app: http://localhost:8051
|
||||
path:
|
||||
#服务指令上传目录
|
||||
directivepath: /opt/upFiles001/directive
|
||||
directivepath: /cache/nu/opt/upFiles001/directive
|
||||
#文件上传根目录 设置
|
||||
upload: /opt/upFiles001
|
||||
upload: /cache/nu/opt/upFiles001
|
||||
#webapp文件路径
|
||||
webapp: /opt/webapp
|
||||
webapp: /cache/nu/opt/webapp
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储和大鱼短信秘钥配置
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-task-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nu-task-local-api</artifactId>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,4 @@
|
|||
package com.nu.modules.scheduledtasks;
|
||||
|
||||
public interface ScheduledTasksApi {
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-task</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nu-task-api</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>nu-task-local-api</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-base-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,35 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-task</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nu-task-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-task-local-api</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>hibernate-re</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 企业微信/钉钉 api -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,180 @@
|
|||
package com.nu.modules.scheduledtasks.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.scheduledtasks.entity.ScheduledTasks;
|
||||
import com.nu.modules.scheduledtasks.service.IScheduledTasksService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 定时任务表
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-06-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="定时任务表")
|
||||
@RestController
|
||||
@RequestMapping("/scheduledtasks/scheduledTasks")
|
||||
@Slf4j
|
||||
public class ScheduledTasksController extends JeecgController<ScheduledTasks, IScheduledTasksService> {
|
||||
@Autowired
|
||||
private IScheduledTasksService scheduledTasksService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param scheduledTasks
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "定时任务表-分页列表查询")
|
||||
@ApiOperation(value="定时任务表-分页列表查询", notes="定时任务表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<ScheduledTasks>> queryPageList(ScheduledTasks scheduledTasks,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ScheduledTasks> queryWrapper = QueryGenerator.initQueryWrapper(scheduledTasks, req.getParameterMap());
|
||||
Page<ScheduledTasks> page = new Page<ScheduledTasks>(pageNo, pageSize);
|
||||
IPage<ScheduledTasks> pageList = scheduledTasksService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param scheduledTasks
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "定时任务表-添加")
|
||||
@ApiOperation(value="定时任务表-添加", notes="定时任务表-添加")
|
||||
@RequiresPermissions("scheduledtasks:nu_scheduled_tasks:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ScheduledTasks scheduledTasks) {
|
||||
scheduledTasksService.save(scheduledTasks);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param scheduledTasks
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "定时任务表-编辑")
|
||||
@ApiOperation(value="定时任务表-编辑", notes="定时任务表-编辑")
|
||||
@RequiresPermissions("scheduledtasks:nu_scheduled_tasks:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ScheduledTasks scheduledTasks) {
|
||||
scheduledTasksService.updateById(scheduledTasks);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "定时任务表-通过id删除")
|
||||
@ApiOperation(value="定时任务表-通过id删除", notes="定时任务表-通过id删除")
|
||||
@RequiresPermissions("scheduledtasks:nu_scheduled_tasks:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
scheduledTasksService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "定时任务表-批量删除")
|
||||
@ApiOperation(value="定时任务表-批量删除", notes="定时任务表-批量删除")
|
||||
@RequiresPermissions("scheduledtasks:nu_scheduled_tasks:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.scheduledTasksService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "定时任务表-通过id查询")
|
||||
@ApiOperation(value="定时任务表-通过id查询", notes="定时任务表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<ScheduledTasks> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ScheduledTasks scheduledTasks = scheduledTasksService.getById(id);
|
||||
if(scheduledTasks==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(scheduledTasks);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param scheduledTasks
|
||||
*/
|
||||
@RequiresPermissions("scheduledtasks:nu_scheduled_tasks:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ScheduledTasks scheduledTasks) {
|
||||
return super.exportXls(request, scheduledTasks, ScheduledTasks.class, "定时任务表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("scheduledtasks:nu_scheduled_tasks:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ScheduledTasks.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.nu.modules.scheduledtasks.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 定时任务表
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-06-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_scheduled_tasks")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_scheduled_tasks对象", description="定时任务表")
|
||||
public class ScheduledTasks implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键ID*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private java.lang.String id;
|
||||
/**service对应bean名称:方法名*/
|
||||
@Excel(name = "service对应bean名称:方法名", width = 15)
|
||||
@ApiModelProperty(value = "service对应bean名称:方法名")
|
||||
private java.lang.String tag;
|
||||
/**参数JSON字符串*/
|
||||
@Excel(name = "参数JSON字符串", width = 15)
|
||||
@ApiModelProperty(value = "参数JSON字符串")
|
||||
private java.lang.String params;
|
||||
/**状态 0待执行 1执行中 3执行成功*/
|
||||
@Excel(name = "状态 0待执行 1执行中 3执行成功", width = 15)
|
||||
@ApiModelProperty(value = "状态 0待执行 1执行中 3执行成功")
|
||||
private java.lang.String status;
|
||||
/**任务存入时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "任务存入时间")
|
||||
private java.util.Date createTime;
|
||||
/**更新状态时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新状态时间")
|
||||
private java.util.Date updateTime;
|
||||
/**失败次数*/
|
||||
@Excel(name = "失败次数", width = 15)
|
||||
@ApiModelProperty(value = "失败次数")
|
||||
private java.lang.Integer failureCount;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.scheduledtasks.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.scheduledtasks.entity.ScheduledTasks;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 定时任务表
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-06-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ScheduledTasksMapper extends BaseMapper<ScheduledTasks> {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?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="com.nu.modules.scheduledtasks.mapper.ScheduledTasksMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.scheduledtasks.service;
|
||||
|
||||
import com.nu.modules.scheduledtasks.entity.ScheduledTasks;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 定时任务表
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-06-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IScheduledTasksService extends IService<ScheduledTasks> {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.nu.modules.scheduledtasks.service.impl;
|
||||
|
||||
import com.nu.modules.scheduledtasks.ScheduledTasksApi;
|
||||
import com.nu.modules.scheduledtasks.entity.ScheduledTasks;
|
||||
import com.nu.modules.scheduledtasks.mapper.ScheduledTasksMapper;
|
||||
import com.nu.modules.scheduledtasks.service.IScheduledTasksService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 定时任务表
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-06-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ScheduledTasksServiceImpl extends ServiceImpl<ScheduledTasksMapper, ScheduledTasks> implements IScheduledTasksService, ScheduledTasksApi {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-parent</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<description>任务功能模块</description>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nursing-unit-task</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>nu-task-api</module>
|
||||
<module>nu-task-biz</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
Loading…
Reference in New Issue