Commit c3000dc9 by huluobin

# 更新

parent 262d8c52
...@@ -6,10 +6,7 @@ import com.blt.other.common.util.AxiosUtil; ...@@ -6,10 +6,7 @@ import com.blt.other.common.util.AxiosUtil;
import com.blt.other.database.model.UserCostFinansysDomain; import com.blt.other.database.model.UserCostFinansysDomain;
import com.blt.other.module.cost.service.UserCostFinansysService; import com.blt.other.module.cost.service.UserCostFinansysService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -51,10 +48,9 @@ public class UserCostFinansysController { ...@@ -51,10 +48,9 @@ public class UserCostFinansysController {
} }
@PostMapping("/getAllFinansysRecord") @PostMapping("/getAllFinansysRecord")
public Map<String, Object> getAllFinansysRecord(HttpServletResponse response, HttpServletRequest request) { public Map<String, Object> getAllFinansysRecord(@RequestParam(required = false) String key) {
AxiosUtil.setCors(response, request);
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
List<UserCostFinansysDomain> list = userCostFinansysService.getAllFinancesRecord(); List<UserCostFinansysDomain> list = userCostFinansysService.getAllFinancesRecord(key);
result.put("success", true); result.put("success", true);
result.put("allFinansys", list); result.put("allFinansys", list);
return result; return result;
......
...@@ -20,7 +20,13 @@ public interface UserCostFinansysDao extends BaseMapper<UserCostFinansysDomain> ...@@ -20,7 +20,13 @@ public interface UserCostFinansysDao extends BaseMapper<UserCostFinansysDomain>
UserCostFinansysDomain selectByDetail(UserCostFinansysDomain userCostFinansysDomain); UserCostFinansysDomain selectByDetail(UserCostFinansysDomain userCostFinansysDomain);
List<UserCostFinansysDomain> selectAll(); /**
* 搜索历史
*
* @param key key
* @return res
*/
List<UserCostFinansysDomain> selectAll(String key);
/** /**
* 从财务系统同步财务账号信息时查询是否已存在 * 从财务系统同步财务账号信息时查询是否已存在
......
...@@ -30,7 +30,13 @@ public interface UserCostFinansysService { ...@@ -30,7 +30,13 @@ public interface UserCostFinansysService {
UserCostFinansysDomain getByUserCostFinancesDetail(UserCostFinansysDomain userCostFinansysDomain); UserCostFinansysDomain getByUserCostFinancesDetail(UserCostFinansysDomain userCostFinansysDomain);
List<UserCostFinansysDomain> getAllFinancesRecord(); /**
* 查询历史银行卡信息
*
* @param key 模糊匹配key
* @return res
*/
List<UserCostFinansysDomain> getAllFinancesRecord(String key);
String syncUserFinance(); String syncUserFinance();
......
...@@ -7,15 +7,15 @@ import com.bailuntec.cost.api.dto.LogisticsFinansysDto; ...@@ -7,15 +7,15 @@ import com.bailuntec.cost.api.dto.LogisticsFinansysDto;
import com.bailuntec.cost.api.dto.SubLogisticsFinansysDto; import com.bailuntec.cost.api.dto.SubLogisticsFinansysDto;
import com.blt.other.common.config.property.CostUrlProperties; import com.blt.other.common.config.property.CostUrlProperties;
import com.blt.other.common.util.MyMapperUtil; import com.blt.other.common.util.MyMapperUtil;
import com.blt.other.database.model.CostPlanDomain;
import com.blt.other.database.model.UserCostFinansysDomain;
import com.blt.other.database.model.UserDomain;
import com.blt.other.module.auth.dao.UserDao; import com.blt.other.module.auth.dao.UserDao;
import com.blt.other.module.cost.dao.UserCostFinansysDao; import com.blt.other.module.cost.dao.UserCostFinansysDao;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.UserCostFinansysService; import com.blt.other.module.cost.service.UserCostFinansysService;
import com.blt.other.module.cost.vo.UserCostFinansysVo; import com.blt.other.module.cost.vo.UserCostFinansysVo;
import com.blt.other.module.cost.vo.UserFinansysVo; import com.blt.other.module.cost.vo.UserFinansysVo;
import com.blt.other.database.model.CostPlanDomain;
import com.blt.other.database.model.UserCostFinansysDomain;
import com.blt.other.database.model.UserDomain;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -80,8 +80,8 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService { ...@@ -80,8 +80,8 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
} }
@Override @Override
public List<UserCostFinansysDomain> getAllFinancesRecord() { public List<UserCostFinansysDomain> getAllFinancesRecord(String key) {
List<UserCostFinansysDomain> list = userCostFinansysDao.selectAll(); List<UserCostFinansysDomain> list = userCostFinansysDao.selectAll(key);
return list; return list;
} }
......
...@@ -38,7 +38,15 @@ ...@@ -38,7 +38,15 @@
<select id="selectAll" resultType="com.blt.other.database.model.UserCostFinansysDomain"> <select id="selectAll" resultType="com.blt.other.database.model.UserCostFinansysDomain">
SELECT * SELECT *
FROM user_cost_finansys FROM user_cost_finansys
<if test="key!=null and key !='' ">
where (bank_card like concat('%',#{key},'%')
or bank_name like concat('%',#{key},'%')
or bank_card_user like concat('%',#{key},'%')
or bank_company like concat('%',#{key},'%')
)
</if>
ORDER BY id DESC ORDER BY id DESC
limit 10
</select> </select>
<select id="selectByBankInfo" resultType="com.blt.other.database.model.UserCostFinansysDomain"> <select id="selectByBankInfo" resultType="com.blt.other.database.model.UserCostFinansysDomain">
......
package com.blt.other.module.cost.service.impl;
import com.bailuntec.common.JsonUtilByFsJson;
import com.blt.other.database.model.UserCostFinansysDomain;
import com.blt.other.module.cost.service.UserCostFinansysService;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/2/25 1:58 下午
*/
@Transactional
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
@ActiveProfiles("prod")
@Slf4j
public class UserCostFinansysServiceImplTest {
@Resource
UserCostFinansysService userCostFinansysService;
@Test
public void getAllFinancesRecord() {
List<UserCostFinansysDomain> userCostFinansysDomainList = userCostFinansysService.getAllFinancesRecord("test");
log.info("res:{}", JsonUtilByFsJson.beanToJson(userCostFinansysDomainList));
}
}
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