common/src/main/java/com/jilongda/common/basic/Constant.java
@@ -115,6 +115,9 @@ , "/logout" , "/cpe/**"//当前H5用户端不采用security , "/sales-report/**"//报表目前不做权限校验 , "/sales-report/**"//报表目前不做权限校验 , "/code/login" , "/sendMsg" }; public static final String[] APPLET_AUTH_WHITELIST = { "/" manage/pom.xml
@@ -18,6 +18,11 @@ <dependencies> <dependency> <groupId>com.aliyun</groupId> <artifactId>alibabacloud-dysmsapi20170525</artifactId> <version>3.0.1</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>5.3.9</version> manage/src/main/java/com/jilongda/manage/authority/controller/LoginController.java
@@ -131,6 +131,7 @@ } /** * 退出 * manage/src/main/java/com/jilongda/manage/controller/TOptometryController.java
@@ -61,6 +61,11 @@ PageInfo<TOptometryVO> tOptometryVOPageInfo = optometristService.pageList(query); List<TOptometryVO> records = tOptometryVOPageInfo.getRecords(); for (TOptometryVO record : records) { List<TOptometryDetail> list = optometryDetailService.lambdaQuery() .eq(TOptometryDetail::getOptometryId, record.getId()) .eq(TOptometryDetail::getType,1) .list(); record.setList(list); if (record.getUserId()!=null){ TAppUser byId = appUserService.getById(record.getUserId()); if (byId!=null){ manage/src/main/java/com/jilongda/manage/controller/TOrderAccountingController.java
@@ -1,6 +1,20 @@ package com.jilongda.manage.controller; import com.jilongda.common.basic.ApiResult; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TLineUp; import com.jilongda.manage.query.TLineUpQuery; import com.jilongda.manage.query.TOrderAccountingQuery; import com.jilongda.manage.service.TOrderAccountingService; import com.jilongda.manage.service.TOrderService; import com.jilongda.manage.service.TStoreService; import com.jilongda.manage.vo.TOrderVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; 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; @@ -14,8 +28,20 @@ * @since 2024-12-09 */ @RestController @Api(tags = "订单核算") @RequestMapping("/t-order-accounting") public class TOrderAccountingController { @Autowired private TStoreService storeService; @Autowired private TOrderService orderService; @Autowired private TOrderAccountingService orderAccountingService; @ApiOperation(value = "核算订单分页列表") @PostMapping(value = "/pageList") public ApiResult<PageInfo<TOrderVO>> pageList(@RequestBody TOrderAccountingQuery query) { PageInfo<TOrderVO> res = orderAccountingService.pageList(query); return ApiResult.success(res); } } manage/src/main/java/com/jilongda/manage/mapper/TOrderAccountingMapper.java
@@ -1,7 +1,15 @@ package com.jilongda.manage.mapper; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TLineUp; import com.jilongda.manage.model.TOrderAccounting; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.jilongda.manage.query.TLineUpQuery; import com.jilongda.manage.query.TOrderAccountingQuery; import com.jilongda.manage.vo.TOrderVO; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> @@ -12,5 +20,5 @@ * @since 2024-12-09 */ public interface TOrderAccountingMapper extends BaseMapper<TOrderAccounting> { List<TOrderVO> pageList(@Param("query")TOrderAccountingQuery query, @Param("pageInfo")PageInfo<TOrderVO> pageInfo); } manage/src/main/java/com/jilongda/manage/model/TOrder.java
@@ -141,19 +141,16 @@ @ApiModelProperty(value = "核算时间") @TableField("accountingTime") private LocalDateTime accountingTime; @ApiModelProperty(value = "手机号") @TableField("phone") private String phone; @ApiModelProperty(value = "姓名") @ApiModelProperty(value = "用户姓名") @TableField("realName") private String realName; @ApiModelProperty(value = "年龄") @ApiModelProperty(value = "用户手机号") @TableField("phone") private String phone; @ApiModelProperty(value = "用户年龄") @TableField("age") private Integer age; @ApiModelProperty(value = "性别1男2女3保密") @ApiModelProperty(value = "用户性别 1男2女") @TableField("gender") private Integer gender; manage/src/main/java/com/jilongda/manage/query/TOrderAccountingQuery.java
New file @@ -0,0 +1,32 @@ package com.jilongda.manage.query; import com.jilongda.common.pojo.BasePage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; @Data @ApiModel(value = "核算订单查询参数") public class TOrderAccountingQuery extends BasePage { @ApiModelProperty(value = "微信昵称") private String name; @ApiModelProperty(value = "手机号") private String phone; @ApiModelProperty(value = "下单起始时间 2022-11-11") private String startTime; @ApiModelProperty(value = "下单结束时间 2023-11-11") private String endTime; @ApiModelProperty(value = "姓名") private String realName; @ApiModelProperty(value = "金额范围起始") private BigDecimal startMoney; @ApiModelProperty(value = "金额范围结束") private BigDecimal endMoney; @ApiModelProperty(value = "核算状态 不传查全部 1是 2否") private Integer isAccounting; @ApiModelProperty(value = "门店id") private Integer storeId; } manage/src/main/java/com/jilongda/manage/service/TOrderAccountingService.java
@@ -1,7 +1,10 @@ package com.jilongda.manage.service; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TOrderAccounting; import com.baomidou.mybatisplus.extension.service.IService; import com.jilongda.manage.query.TOrderAccountingQuery; import com.jilongda.manage.vo.TOrderVO; /** * <p> @@ -13,4 +16,6 @@ */ public interface TOrderAccountingService extends IService<TOrderAccounting> { PageInfo<TOrderVO> pageList(TOrderAccountingQuery query); } manage/src/main/java/com/jilongda/manage/service/impl/TOrderAccountingServiceImpl.java
@@ -1,10 +1,16 @@ package com.jilongda.manage.service.impl; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TLineUp; import com.jilongda.manage.model.TOrderAccounting; import com.jilongda.manage.mapper.TOrderAccountingMapper; import com.jilongda.manage.query.TOrderAccountingQuery; import com.jilongda.manage.service.TOrderAccountingService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jilongda.manage.vo.TOrderVO; import org.springframework.stereotype.Service; import java.util.List; /** * <p> @@ -17,4 +23,11 @@ @Service public class TOrderAccountingServiceImpl extends ServiceImpl<TOrderAccountingMapper, TOrderAccounting> implements TOrderAccountingService { @Override public PageInfo<TOrderVO> pageList(TOrderAccountingQuery query) { PageInfo<TOrderVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); List<TOrderVO> list=this.baseMapper.pageList(query, pageInfo); pageInfo.setRecords(list); return pageInfo; } } manage/src/main/java/com/jilongda/manage/utils/MsgUtils.java
@@ -1,5 +1,6 @@ package com.jilongda.manage.utils; import com.aliyun.dysmsapi20170525.Client; import com.aliyun.dysmsapi20170525.models.SendSmsRequest; import com.aliyun.dysmsapi20170525.models.SendSmsResponse; import com.aliyun.tea.TeaException; @@ -33,7 +34,7 @@ * @return Client * @throws Exception */ public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception { public static Client createClient(String accessKeyId, String accessKeySecret) throws Exception { Config config = new Config() // 您的 AccessKey ID .setAccessKeyId(accessKeyId) @@ -41,11 +42,11 @@ .setAccessKeySecret(accessKeySecret); // 访问的域名 config.endpoint = "dysmsapi.aliyuncs.com"; return new com.aliyun.dysmsapi20170525.Client(config); return new Client(config); } public void sendMsg(String phone,String code) throws Exception { com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(accessKeyId,accessKeySecret); Client client = MsgUtils.createClient(accessKeyId, accessKeySecret); SendSmsRequest sendSmsRequest = new SendSmsRequest() .setSignName(signName) .setTemplateCode(templateCode) manage/src/main/java/com/jilongda/manage/utils/SendSms.java
New file @@ -0,0 +1,94 @@ // This file is auto-generated, don't edit it. Thanks. package com.jilongda.manage.utils; import com.aliyun.auth.credentials.Credential; import com.aliyun.auth.credentials.provider.StaticCredentialProvider; import com.aliyun.core.http.HttpClient; import com.aliyun.core.http.HttpMethod; import com.aliyun.core.http.ProxyOptions; import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder; import com.aliyun.sdk.service.dysmsapi20170525.models.*; import com.aliyun.sdk.service.dysmsapi20170525.*; import com.google.gson.Gson; import darabonba.core.RequestConfiguration; import darabonba.core.client.ClientOverrideConfiguration; import darabonba.core.utils.CommonUtil; import darabonba.core.TeaPair; //import javax.net.ssl.KeyManager; //import javax.net.ssl.X509TrustManager; import java.net.InetSocketAddress; import java.time.Duration; import java.util.*; import java.util.concurrent.CompletableFuture; import java.io.*; public class SendSms { public static void main(String[] args) throws Exception { // HttpClient Configuration /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder() .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout time, the default is 10 seconds .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout time, the default is 20 seconds .maxConnections(128) // Set the connection pool size .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout, the default is 30 seconds // Configure the proxy .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001)) .setCredentials("<your-proxy-username>", "<your-proxy-password>")) // If it is an https connection, you need to configure the certificate, or ignore the certificate(.ignoreSSL(true)) .x509TrustManagers(new X509TrustManager[]{}) .keyManagers(new KeyManager[]{}) .ignoreSSL(false) .build();*/ // Configure Credentials authentication information, including ak, secret, token StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder() // Please ensure that the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set. .accessKeyId("LTAI5tL1dE1DzT4ZYdDQZ8k7") .accessKeySecret("4SZBtTyLhOoYRcfMS4SVAtGz8ZnxRP") //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // use STS token .build()); // Configure the Client AsyncClient client = AsyncClient.builder() .region("cn-qingdao") // Region ID //.httpClient(httpClient) // Use the configured HttpClient, otherwise use the default HttpClient (Apache HttpClient) .credentialsProvider(provider) //.serviceConfiguration(Configuration.create()) // Service-level configuration // Client-level configuration rewrite, can set Endpoint, Http request parameters, etc. .overrideConfiguration( ClientOverrideConfiguration.create() // Endpoint 请参考 https://api.aliyun.com/product/Dysmsapi .setEndpointOverride("dysmsapi.aliyuncs.com") //.setConnectTimeout(Duration.ofSeconds(30)) ) .build(); // Parameter settings for API request SendSmsRequest sendSmsRequest = SendSmsRequest.builder() .phoneNumbers("19983174515") .signName("眼度") .templateCode("SMS_180051431") .templateParam("{\"code\":\"123543\"}") // Request-level configuration rewrite, can set Http request parameters, etc. // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders())) .build(); // Asynchronously get the return value of the API request CompletableFuture<SendSmsResponse> response = client.sendSms(sendSmsRequest); // Synchronously get the return value of the API request SendSmsResponse resp = response.get(); System.out.println(new Gson().toJson(resp)); // Asynchronous processing of return values /*response.thenAccept(resp -> { System.out.println(new Gson().toJson(resp)); }).exceptionally(throwable -> { // Handling exceptions System.out.println(throwable.getMessage()); return null; });*/ // Finally, close the client client.close(); } } manage/src/main/java/com/jilongda/manage/vo/TOptometryVO.java
@@ -1,10 +1,13 @@ package com.jilongda.manage.vo; import com.jilongda.manage.model.TOptometry; import com.jilongda.manage.model.TOptometryDetail; import com.jilongda.manage.model.TSupplier; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel(value = "验光单VO") @@ -21,5 +24,6 @@ private String pupilDistance; @ApiModelProperty(value = "验光师名称") private String optometristName; @ApiModelProperty(value = "验光单详情") private List<TOptometryDetail> list; } manage/src/main/java/com/jilongda/manage/vo/TOrderVO.java
New file @@ -0,0 +1,18 @@ package com.jilongda.manage.vo; import com.jilongda.manage.model.TModel; import com.jilongda.manage.model.TOrder; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel(value = "镜架型号VO") public class TOrderVO extends TOrder { @ApiModelProperty(value = "微信名称") private String name; @ApiModelProperty(value = "店铺名称") private String storeName; } manage/src/main/resources/mapping/TOrderAccountingMapper.xml
@@ -28,5 +28,10 @@ <sql id="Base_Column_List"> id, code, orderId, rLens, lLens, frame, createTime, updateTime, createBy, updateBy, isDelete, commission, rLensProfit, lLensProfit, frameProfit, payMoney, profitMoney, profitRating </sql> <select id="pageList" resultType="com.jilongda.manage.vo.TOrderVO"> select t1.* from t_order t1 left join </select> </mapper> optometrist/pom.xml
@@ -90,7 +90,7 @@ <artifactId>lombok</artifactId> </exclude> </excludes> <mainClass>com.jilongda.optometrist.ManageApplication</mainClass> <mainClass>com.jilongda.optometrist.OptometristApplication</mainClass> </configuration> </plugin> optometrist/src/main/java/com/jilongda/optometrist/OptometristApplication.java
File was renamed from optometrist/src/main/java/com/jilongda/optometrist/ManageApplication.java @@ -25,10 +25,10 @@ @MapperScan({"com.jilongda.optometrist.mapper", "com.jilongda.optometrist.authority.mapper"}) @EnableTransactionManagement @SpringBootApplication public class ManageApplication { public class OptometristApplication { public static void main(String[] args) throws UnknownHostException { ConfigurableApplicationContext application = SpringApplication.run(ManageApplication.class, args); ConfigurableApplicationContext application = SpringApplication.run(OptometristApplication.class, args); Environment env = application.getEnvironment(); log.info("\n----------------------------------------------------------\n\t" + "应用 '{}' 运行成功! 访问连接:\n\t" + optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometristController.java
@@ -78,6 +78,8 @@ SecUser byId = secUserService.getById(userId); TStore byId1 = storeService.getById(byId.getStoreId()); tOptometristVO.setStoreName(byId1.getName()); tOptometristVO.setName(byId.getNickName()); tOptometristVO.setPhone(byId.getPhone()); int size = optometryService.lambdaQuery().eq(TOptometry::getOptometristId, userId) .eq(TOptometry::getStatus, 3).list().size(); tOptometristVO.setOptometryCount(size);