| @@ -0,0 +1,75 @@ | |||
| package com.iformall.controller.contract; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.service.WxRentContractService; | |||
| import com.iformall.service.WxShopService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author: furunxin | |||
| * @Date: 2020/7/14 11:21 | |||
| * @Description: | |||
| */ | |||
| @RestController | |||
| @RequestMapping("wxRentContractExtension") | |||
| public class WxRentContractExtensionController extends BaseController { | |||
| @Autowired | |||
| private WxRentContractService wxRentContractService; | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| @GetMapping("searchMerchant") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "merchantName", value = "商户名称", dataType = "string", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "商户搜索") | |||
| public ResultData searchMerchant(String merchantName) throws Exception{ | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| wxRentContract.setTenantId("789"); | |||
| wxRentContract.setMerchantName(merchantName); | |||
| List<Map<String,Object>> result = wxRentContractService.searchMerchantByname(wxRentContract); | |||
| return new ResultData(result); | |||
| } | |||
| @GetMapping("getContractInfo") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "merchantId", value = "商户id", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "根据商户id查询该商户计租中合同信息") | |||
| public ResultData getContractInfo(Long merchantId) throws Exception{ | |||
| Map<String,Object> resultMap = new HashMap<>(); | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| wxRentContract.setMerchantId(merchantId); | |||
| wxRentContract = wxRentContractService.getByMerchantId(wxRentContract); | |||
| WxShop wxShop = wxShopService.getById(wxRentContract.getShopId()); | |||
| resultMap.put("wxRentContract",wxRentContract); | |||
| resultMap.put("wxShop",wxShop); | |||
| return new ResultData(resultMap); | |||
| } | |||
| @GetMapping("getAllContractInfo") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "merchantId", value = "商户id", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "根据商户id查询该商户下所有合同") | |||
| public ResultData getAllContractInfo(Long merchantId) throws Exception{ | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| wxRentContract.setMerchantId(merchantId); | |||
| List<WxRentContract> rentContracts = wxRentContractService.getAllContractByMerchantId(wxRentContract); | |||
| return new ResultData(rentContracts); | |||
| } | |||
| } | |||
| @@ -1,13 +1,12 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| #include: rabbitMQ | |||
| #include: aliyunRocketMQ | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| #url: jdbc:mysql://rm-2zel9i9t555zy7lftmo.mysql.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | |||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | |||
| url: jdbc:mysql://202.165.179.86:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| username: root | |||
| password: fm2020test | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -24,13 +23,13 @@ spring: | |||
| poolPreparedStatements: true | |||
| maxOpenPreparedStatements: 20 | |||
| connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=60000" | |||
| #jackson: | |||
| #jackson: | |||
| #date-format: yyyy-MM-dd HH:mm:ss | |||
| # REDIS | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| @@ -42,7 +41,7 @@ spring: | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| @@ -53,6 +52,14 @@ spring: | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkadmin | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| @@ -67,6 +74,7 @@ spring: | |||
| socketFactory: | |||
| port: 465 | |||
| class: javax.net.ssl.SSLSocketFactory | |||
| # ROCKETMQ | |||
| rocketmq: | |||
| nameServer: 127.0.0.1:9876 | |||
| @@ -81,8 +89,8 @@ spring: | |||
| rabbitmq: | |||
| host: 202.165.179.86 | |||
| port: 5672 | |||
| username: ENC(2f9Nqt3c4cbVGYnhpjp9Mg==) | |||
| password: ENC(2av0JfMfz141IHkG6ibI8aKzmD33bc64wcN/O43ucbo=) | |||
| username: fumao | |||
| password: f9l98&*%%u7flt33 | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| @@ -100,20 +108,45 @@ aws: | |||
| access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) | |||
| secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) | |||
| #wechat: | |||
| # web: | |||
| # appId: "wxe31beafbfd8295ba" | |||
| # secret: "c689fabf3c4c9f5b6424ff2a36a26727" | |||
| # url: "https://mall.youlane.cn" | |||
| # open: | |||
| # componentAppId: "wx897e4673286c915d" | |||
| # componentSecret: "cdfdfda65c45689beb6766c4c427eed2" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 202.165.179.86 | |||
| # port: 6379 | |||
| # password: iF0rm@2l2ol9 | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wxe31beafbfd8295ba" | |||
| secret: "c689fabf3c4c9f5b6424ff2a36a26727" | |||
| url: "https://mall.youlane.cn" | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| open: | |||
| componentAppId: "wx897e4673286c915d" | |||
| componentSecret: "cdfdfda65c45689beb6766c4c427eed2" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -121,7 +154,7 @@ wechat: | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 500 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| @@ -94,7 +94,7 @@ public class WxRentContract extends TenantEntity { | |||
| private Integer receivePeriod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同文件路径", name = "filepath") | |||
| private String filepath; | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同进度状态1待签约2已签约未记租3计租中4提前终止5合同到期", name = "status") | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同进度状态1待签约2已签约未记租3计租中4提前终止5合同到期", name = "status") | |||
| private Integer status; | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同编号", name = "contractNumber") | |||
| private String contractNumber; | |||
| @@ -78,4 +78,9 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||
| List<Map<String,Object>> queryContractByBus(WxBusiness wxBusiness); | |||
| List<Map<String,Object>> searchMerchantByname(WxRentContract wxRentContract); | |||
| WxRentContract getByMerchantId(WxRentContract wxRentContract); | |||
| List<WxRentContract> getAllContractBymerchantId(WxRentContract wxRentContract); | |||
| } | |||
| @@ -101,4 +101,9 @@ public interface WxRentContractService { | |||
| ResultData getContractByContractNumber(WxRentContract wxRentContract); | |||
| List<Map<String,Object>> searchMerchantByname(WxRentContract wxRentContract); | |||
| WxRentContract getByMerchantId(WxRentContract wxRentContract); | |||
| List<WxRentContract> getAllContractByMerchantId(WxRentContract wxRentContract); | |||
| } | |||
| @@ -2540,4 +2540,19 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| WxRentContract wxRentContract = wxRentContractMapper.selectOne(new QueryWrapper<>(rentContract)); | |||
| return new ResultData(wxRentContract); | |||
| } | |||
| @Override | |||
| public List<Map<String, Object>> searchMerchantByname(WxRentContract wxRentContract) { | |||
| return wxRentContractMapper.searchMerchantByname(wxRentContract); | |||
| } | |||
| @Override | |||
| public WxRentContract getByMerchantId(WxRentContract wxRentContract) { | |||
| return wxRentContractMapper.getByMerchantId(wxRentContract); | |||
| } | |||
| @Override | |||
| public List<WxRentContract> getAllContractByMerchantId(WxRentContract wxRentContract) { | |||
| return wxRentContractMapper.getAllContractBymerchantId(wxRentContract); | |||
| } | |||
| } | |||
| @@ -326,5 +326,6 @@ | |||
| update wx_bill_rent set owe = receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay where status in (1,2,4) | |||
| </update> | |||
| </mapper> | |||
| @@ -519,5 +519,17 @@ | |||
| `rent_shop_type` = 2 AND `shop_id` = #{shopId} | |||
| ) | |||
| </select> | |||
| <select id="searchMerchantByname" resultType="hashmap" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select merchant_id,merchant_name from wx_rent_contract where tenant_id = #{tenantId} and merchant_name like concat('%',#{merchantName},'%') | |||
| </select> | |||
| <select id="getByMerchantId" resultType="com.iformall.domain.po.WxRentContract" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select * from wx_rent_contract where merchant_id = #{merchantId} and status=3 | |||
| </select> | |||
| <select id="getAllContractBymerchantId" resultType="com.iformall.domain.po.WxRentContract" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select * from wx_rent_contract where merchant_id = #{merchantId} ORDER BY rental_end_date | |||
| </select> | |||
| </mapper> | |||