Commit 820915cc by manxiaoqiang

app排序

parent 5a011dbb
...@@ -135,8 +135,8 @@ public class ContractController { ...@@ -135,8 +135,8 @@ public class ContractController {
@RequestMapping(value = "checkAccount", method = RequestMethod.GET) @RequestMapping(value = "checkAccount", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResultModel checkAccount(@CurrentAccount User loginAccount, @RequestParam String email) { public ResultModel checkAccount(@CurrentAccount User loginAccount, @RequestParam String email, @PathVariable String platform) {
return ResultModel.OK(service.checkAccount(email)); return ResultModel.OK(service.checkAccount(email, platform));
} }
@RequestMapping(value = "find/body", method = RequestMethod.GET) @RequestMapping(value = "find/body", method = RequestMethod.GET)
......
...@@ -15,8 +15,8 @@ public interface ContractRepository extends JpaRepository<Contract, Long> { ...@@ -15,8 +15,8 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value="select count(*) from contract where ds = ?1",nativeQuery=true) @Query(value="select count(*) from contract where ds = ?1",nativeQuery=true)
BigInteger countNumByDs(String ds); BigInteger countNumByDs(String ds);
@Query(value="select count(*) from contract where email = ?1",nativeQuery=true) @Query(value="select count(*) from contract where email = ?1 and platform = ?2",nativeQuery=true)
BigInteger countNumByEmail(String email); BigInteger countNumByEmail(String email, String platfrom);
@Query(value="select * from contract where ds >= ?1 and ds <= ?2 and platform = ?3 order by ds desc",nativeQuery=true) @Query(value="select * from contract where ds >= ?1 and ds <= ?2 and platform = ?3 order by ds desc",nativeQuery=true)
List<Contract> findByDs(String startDate, String endDate, String platfrom); List<Contract> findByDs(String startDate, String endDate, String platfrom);
......
...@@ -11,7 +11,7 @@ import java.util.Map; ...@@ -11,7 +11,7 @@ import java.util.Map;
*/ */
public interface ContractService { public interface ContractService {
Map<String, Object> checkAccount(String email); Map<String, Object> checkAccount(String email, String platfrom);
List<ContractBody> findBody(); List<ContractBody> findBody();
......
...@@ -42,13 +42,13 @@ public class ContractServiceImpl implements ContractService{ ...@@ -42,13 +42,13 @@ public class ContractServiceImpl implements ContractService{
AccountService accountService; AccountService accountService;
@Override @Override
public Map<String, Object> checkAccount(String email) { public Map<String, Object> checkAccount(String email, String platfrom) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
Account4Web account4Web = account4WebRepository.findByEmail(email); Account4Web account4Web = account4WebRepository.findByEmail(email);
if(null == account4Web){ if(null == account4Web){
map.put("result", 0); map.put("result", 0);
}else{ }else{
BigInteger integer = contractRepository.countNumByDs(DateUtil.getBeforeDays(0)); BigInteger integer = contractRepository.countNumByEmail(email,platfrom);
map.put("result", 1); map.put("result", 1);
map.put("company", account4Web.getCompany()); map.put("company", account4Web.getCompany());
map.put("num", integer.intValue()); map.put("num", integer.intValue());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment