diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/wechart/controller/WechatPayController.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/wechart/controller/WechatPayController.java index e3618f4..7aac29e 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/wechart/controller/WechatPayController.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/wechart/controller/WechatPayController.java @@ -3,33 +3,41 @@ package com.nu.modules.wechart.controller; import cn.hutool.core.util.IdUtil; import cn.hutool.json.JSONObject; import com.fasterxml.jackson.databind.ObjectMapper; -import com.nu.modules.bizEmployeesInfo.entity.BizEmployeesInfo; +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.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.jeecg.common.system.api.ISysBaseAPI; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +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 javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; @@ -39,23 +47,13 @@ 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 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.HttpGet; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; - -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; +import java.util.UUID; @RestController @RequestMapping("/weiXinPay") @@ -65,6 +63,8 @@ public class WechatPayController { public WechatpayConfig wechatpayConfig; @Autowired private SystemOrderApi systemOrderApi; + @Autowired + private ISysConfigApi sysConfigApi; /** * Native下单 @@ -72,14 +72,16 @@ public class WechatPayController { */ @PostMapping("/native") public Map 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(); @@ -127,7 +129,6 @@ public class WechatPayController { systemOrderApiEntity.setOrderName(title);//订单名称(必传) systemOrderApiEntity.setOrderDescription(orderDesc);//订单描述(非必传) systemOrderApiEntity.setOutTradeNo(outTradeNo);//商户订单号 - systemOrderApiEntity.setTransactionId(response.getPrepayId());//微信支付订单号 systemOrderApiEntity.setOrderTime(new Date());//下单时间 systemOrderApiEntity.setOrderStatus("created");//订单状态 systemOrderApi.save(systemOrderApiEntity); @@ -159,13 +160,7 @@ public class WechatPayController { 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(); + 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"); @@ -181,14 +176,7 @@ public class WechatPayController { // 初始化解析器 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是微信包里面的 @@ -214,12 +202,19 @@ public class WechatPayController { //系统订单表状态更新 { 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.updateByTransactionId(systemOrderApiEntity); + systemOrderApi.updateByOutTradeNo(systemOrderApiEntity); + + //如果订单支付成功则向表中插入定时任务 + if ("SUCCESS".equals(decryptObject.getTradeState().name())) { + SystemOrderApiEntity systemOrder = systemOrderApi.selectByOutTradeNo(decryptObject.getOutTradeNo()); + + } } return decryptObject.getTradeState().toString(); } catch (Exception e) { @@ -232,10 +227,7 @@ 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); @@ -256,13 +248,7 @@ public class WechatPayController { public Map queryOrderById(@RequestBody Map 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 map = new HashMap<>(); if (StringUtils.isEmpty(prepay_id)) { @@ -294,9 +280,7 @@ public class WechatPayController { // 获取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); + 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); @@ -310,8 +294,7 @@ public class WechatPayController { 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) { @@ -355,4 +338,66 @@ public class WechatPayController { System.out.println("---------jsonObject-------" + jsonObject); return jsonObject; } + + + @PostMapping("/getJsApiInfo") + public static Map getJsApiInfo(@RequestBody Map params) throws Exception { +// String accessToken = getToken(GET_TOKEN_URL, "wx8fc3e4305d2fbf0b", "3bf3dd4ec72f591432db6b28c2c044e5");// 获取token + String accessToken = params.get("access_token"); + 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); + CloseableHttpClient httpClient = HttpClients.createDefault(); + System.out.println("---------httpClient-------" + httpClient); + CloseableHttpResponse httpResponse = httpClient.execute(httpGet); + System.out.println("---------httpResponse-------" + httpResponse); + HttpEntity httpEntity = httpResponse.getEntity(); + System.out.println("---------httpEntity-------" + httpEntity); + String responseJson = EntityUtils.toString(httpEntity, "UTF-8"); + System.out.println("---------responseJson-------" + responseJson); + // 解析返回结果,获取手机号 + JSONObject jsonObject = new JSONObject(responseJson); + String ticket = String.valueOf(jsonObject.get("ticket")); + String nonceStr = UUID.randomUUID().toString(); + String timestamp = Long.toString(System.currentTimeMillis() / 1000); + String string1 = new StringBuilder("jsapi_ticket=").append(ticket).append("&noncestr=").append(nonceStr).append("×tamp=").append(timestamp).toString();// 得到签名 + String signature = encryptSHA(string1); + + Map map = new HashMap(); + map.put("signature", signature); + map.put("timestamp", timestamp); + map.put("nonceStr", nonceStr); + + System.out.println("---------jsonObject-------" + signature); + return map; + } + + /** + * sha + */ + private static String encryptSHA(String signStr) { + StringBuffer hexValue = new StringBuffer(); + try { + MessageDigest sha = MessageDigest.getInstance("SHA-1"); + byte[] byteArray = signStr.getBytes("UTF-8"); + byte[] md5Bytes = sha.digest(byteArray); + for (int i = 0; i < md5Bytes.length; i++) { + int val = ((int) md5Bytes[i]) & 0xff; + if (val < 16) { + hexValue.append("0"); + } + hexValue.append(Integer.toHexString(val)); + } + } catch (Exception e) { + e.printStackTrace(); + return ""; + } + return hexValue.toString(); + } + + } diff --git a/nursing-unit-api/src/main/java/com/nu/modules/commonutils/SysBaseInfoApi.java b/nursing-unit-api/src/main/java/com/nu/modules/commonutils/SysBaseInfoApi.java index a6f217d..6aaadd3 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/commonutils/SysBaseInfoApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/commonutils/SysBaseInfoApi.java @@ -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; diff --git a/nursing-unit-api/src/main/java/com/nu/modules/documentrecognition/DocumentRecognitionApi.java b/nursing-unit-api/src/main/java/com/nu/modules/documentrecognition/DocumentRecognitionApi.java index 944ffc0..3fbcae7 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/documentrecognition/DocumentRecognitionApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/documentrecognition/DocumentRecognitionApi.java @@ -3,6 +3,7 @@ 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; diff --git a/nursing-unit-api/src/main/java/com/nu/modules/iot/tplink/controller/AppCameraInfoController.java b/nursing-unit-api/src/main/java/com/nu/modules/iot/tplink/controller/AppCameraInfoController.java index 20d5c82..3f9100f 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/iot/tplink/controller/AppCameraInfoController.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/iot/tplink/controller/AppCameraInfoController.java @@ -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> queryPageList(AppCameraInfo CameraInfo, diff --git a/nursing-unit-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java b/nursing-unit-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java index 3b939f5..de5ef46 100644 --- a/nursing-unit-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java +++ b/nursing-unit-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java @@ -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; @@ -23,7 +23,7 @@ public class YouBianCodeUtil { /** * 根据前一个code,获取同级下一个code * 例如:当前最大code为D01A04,下一个code为:D01A05 - * + * * @param code * @return */ @@ -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); @@ -70,11 +73,11 @@ public class YouBianCodeUtil { /** * 根据父亲code,获取下级的下一个code - * + * * 例如:父亲CODE:A01 * 当前CODE:A01B03 * 获取的code:A01B04 - * + * * @param parentCode 上级code * @param localCode 同级code * @return @@ -83,19 +86,20 @@ 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; } - + /** * 将数字前面位数补零 - * + * * @param num * @return */ @@ -105,7 +109,7 @@ public class YouBianCodeUtil { /** * 将数字前面位数补零 - * + * * @param num * @return */ @@ -116,7 +120,7 @@ public class YouBianCodeUtil { /** * 递增获取下个数字 - * + * * @param num * @return */ @@ -127,7 +131,7 @@ public class YouBianCodeUtil { /** * 递增获取下个字母 - * + * * @param num * @return */ @@ -138,7 +142,7 @@ public class YouBianCodeUtil { zimu++; return zimu; } - + /** * 根据数字位数获取最大值 * @param length @@ -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().eq("transaction_id",systemOrderApiEntity.getTransactionId())); + return baseMapper.update(systemOrder,new QueryWrapper().eq("out_trade_no",systemOrderApiEntity.getOutTradeNo())); + } + + @Override + public SystemOrderApiEntity selectByOutTradeNo(String outTradeNo) { + SystemOrder systemOrder = baseMapper.selectOne(new QueryWrapper().eq("out_trade_no", outTradeNo)); + SystemOrderApiEntity systemOrderApiEntity = new SystemOrderApiEntity(); + BeanUtils.copyProperties(systemOrder,systemOrderApiEntity); + return systemOrderApiEntity; } } diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java index a1570d2..75a1dac 100644 --- a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java @@ -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 meidsIds = list.stream().flatMap(directive -> Stream.of(directive.getMp3File(), directive.getMp4File(), directive.getPreviewFile(), directive.getImmediateFile())).filter(Objects::nonNull).distinct().collect(Collectors.toList()); - List mediaObjs = mediaManageApi.queryByIds(meidsIds); + if (!CollectionUtils.isEmpty(meidsIds)) { + List mediaObjs = mediaManageApi.queryByIds(meidsIds); - Map idToFilePathMap = mediaObjs.stream().collect(Collectors.toMap(media -> media.getStr("id"), media -> media.getStr("filePath"))); + Map 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 selectMediaList(String dataSourceCode, List idList) { - return mediaManageApi.selectByDirectiveIds(dataSourceCode,idList); + return mediaManageApi.selectByDirectiveIds(dataSourceCode, idList); } } diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/entity/SysDepart.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/entity/SysDepart.java index c14625b..8ccc99a 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/entity/SysDepart.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/entity/SysDepart.java @@ -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); } } diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/model/SysDepartTreeModel.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/model/SysDepartTreeModel.java index 3c58573..8380392 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/model/SysDepartTreeModel.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/model/SysDepartTreeModel.java @@ -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); } } diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java index 2ce3863..1f41a18 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java @@ -61,7 +61,7 @@ public class OrgCodeRule implements IFillRuleHandler { IPage pageList = sysDepartService.getMaxCodeDepart(page,""); List 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部门信息 diff --git a/nursing-unit-system/nu-system-start/pom.xml b/nursing-unit-system/nu-system-start/pom.xml index 98223ec..4d37072 100644 --- a/nursing-unit-system/nu-system-start/pom.xml +++ b/nursing-unit-system/nu-system-start/pom.xml @@ -60,6 +60,12 @@ nu-payment-biz ${nursingunit.version} + + + com.nursingunit.boot + nu-task-biz + ${nursingunit.version} + com.nursingunit.boot diff --git a/nursing-unit-system/nu-system-start/src/main/resources/application-dev-nu002.yml b/nursing-unit-system/nu-system-start/src/main/resources/application-dev-nu002.yml index 425a671..384ecb2 100644 --- a/nursing-unit-system/nu-system-start/src/main/resources/application-dev-nu002.yml +++ b/nursing-unit-system/nu-system-start/src/main/resources/application-dev-nu002.yml @@ -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存储和大鱼短信秘钥配置 diff --git a/nursing-unit-system/nu-system-start/src/main/resources/application-dev-nu003.yml b/nursing-unit-system/nu-system-start/src/main/resources/application-dev-nu003.yml new file mode 100644 index 0000000..c5876a9 --- /dev/null +++ b/nursing-unit-system/nu-system-start/src/main/resources/application-dev-nu003.yml @@ -0,0 +1,405 @@ +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 + # 商户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 diff --git a/nursing-unit-system/nu-system-start/src/main/resources/application-dev.yml b/nursing-unit-system/nu-system-start/src/main/resources/application-dev.yml index 84e159b..97cb434 100644 --- a/nursing-unit-system/nu-system-start/src/main/resources/application-dev.yml +++ b/nursing-unit-system/nu-system-start/src/main/resources/application-dev.yml @@ -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存储和大鱼短信秘钥配置 diff --git a/nursing-unit-task/nu-task-api/nu-task-local-api/pom.xml b/nursing-unit-task/nu-task-api/nu-task-local-api/pom.xml new file mode 100644 index 0000000..dc14136 --- /dev/null +++ b/nursing-unit-task/nu-task-api/nu-task-local-api/pom.xml @@ -0,0 +1,13 @@ + + + + com.nursingunit.boot + nu-task-api + 2.0.0 + + 4.0.0 + nu-task-local-api + + diff --git a/nursing-unit-task/nu-task-api/nu-task-local-api/src/main/java/com/nu/modules/scheduledtasks/ScheduledTasksApi.java b/nursing-unit-task/nu-task-api/nu-task-local-api/src/main/java/com/nu/modules/scheduledtasks/ScheduledTasksApi.java new file mode 100644 index 0000000..137b140 --- /dev/null +++ b/nursing-unit-task/nu-task-api/nu-task-local-api/src/main/java/com/nu/modules/scheduledtasks/ScheduledTasksApi.java @@ -0,0 +1,4 @@ +package com.nu.modules.scheduledtasks; + +public interface ScheduledTasksApi { +} diff --git a/nursing-unit-task/nu-task-api/pom.xml b/nursing-unit-task/nu-task-api/pom.xml new file mode 100644 index 0000000..85eb7b0 --- /dev/null +++ b/nursing-unit-task/nu-task-api/pom.xml @@ -0,0 +1,24 @@ + + + + com.nursingunit.boot + nursing-unit-task + 2.0.0 + + 4.0.0 + nu-task-api + pom + + + nu-task-local-api + + + + + com.nursingunit.boot + nursing-unit-base-core + + + diff --git a/nursing-unit-task/nu-task-biz/pom.xml b/nursing-unit-task/nu-task-biz/pom.xml new file mode 100644 index 0000000..7099efd --- /dev/null +++ b/nursing-unit-task/nu-task-biz/pom.xml @@ -0,0 +1,35 @@ + + + com.nursingunit.boot + nursing-unit-task + 2.0.0 + + 4.0.0 + nu-task-biz + + + + com.nursingunit.boot + nu-task-local-api + ${nursingunit.version} + + + org.hibernate + hibernate-core + + + org.jeecgframework.boot + hibernate-re + + + + + org.jeecgframework + weixin4j + + + + + diff --git a/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/controller/ScheduledTasksController.java b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/controller/ScheduledTasksController.java new file mode 100644 index 0000000..74be5da --- /dev/null +++ b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/controller/ScheduledTasksController.java @@ -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 { + @Autowired + private IScheduledTasksService scheduledTasksService; + + /** + * 分页列表查询 + * + * @param scheduledTasks + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "定时任务表-分页列表查询") + @ApiOperation(value="定时任务表-分页列表查询", notes="定时任务表-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(ScheduledTasks scheduledTasks, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(scheduledTasks, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage 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 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 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 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 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 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); + } + +} diff --git a/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/entity/ScheduledTasks.java b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/entity/ScheduledTasks.java new file mode 100644 index 0000000..8a34a33 --- /dev/null +++ b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/entity/ScheduledTasks.java @@ -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; +} diff --git a/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/mapper/ScheduledTasksMapper.java b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/mapper/ScheduledTasksMapper.java new file mode 100644 index 0000000..17fae61 --- /dev/null +++ b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/mapper/ScheduledTasksMapper.java @@ -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 { + +} diff --git a/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/mapper/xml/ScheduledTasksMapper.xml b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/mapper/xml/ScheduledTasksMapper.xml new file mode 100644 index 0000000..a147e60 --- /dev/null +++ b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/mapper/xml/ScheduledTasksMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/service/IScheduledTasksService.java b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/service/IScheduledTasksService.java new file mode 100644 index 0000000..64f068a --- /dev/null +++ b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/service/IScheduledTasksService.java @@ -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 { + +} diff --git a/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/service/impl/ScheduledTasksServiceImpl.java b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/service/impl/ScheduledTasksServiceImpl.java new file mode 100644 index 0000000..1e749c2 --- /dev/null +++ b/nursing-unit-task/nu-task-biz/src/main/java/com/nu/modules/scheduledtasks/service/impl/ScheduledTasksServiceImpl.java @@ -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 implements IScheduledTasksService, ScheduledTasksApi { + +} diff --git a/nursing-unit-task/pom.xml b/nursing-unit-task/pom.xml new file mode 100644 index 0000000..45e4ad7 --- /dev/null +++ b/nursing-unit-task/pom.xml @@ -0,0 +1,20 @@ + + + + com.nursingunit.boot + nursing-unit-parent + 2.0.0 + + 任务功能模块 + 4.0.0 + nursing-unit-task + pom + + + nu-task-api + nu-task-biz + + + diff --git a/pom.xml b/pom.xml index 6ecbc0c..7319f96 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,8 @@ nursing-unit-common nursing-unit-payment + + nursing-unit-task nursing-unit-base-core