Commit 43e6bd00 by kangxiaoshan

先回款

parent f2046599
...@@ -124,8 +124,9 @@ public class ContractController { ...@@ -124,8 +124,9 @@ public class ContractController {
@RequestMapping(value = "pay/export", method = RequestMethod.GET,produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) @RequestMapping(value = "pay/export", method = RequestMethod.GET,produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
@ResponseBody @ResponseBody
public ResponseEntity<byte[]> exportPay(@CurrentAccount User loginAccount, @RequestParam String startDate, @RequestParam String endDate, public ResponseEntity<byte[]> exportPay(@CurrentAccount User loginAccount, @RequestParam String startDate, @RequestParam String endDate,
HttpServletRequest request, HttpServletResponse response, @PathVariable String platform ,String moneyType,String packageTypeSearch) { HttpServletRequest request, HttpServletResponse response, @PathVariable String platform ,
List<ContractMoney> moneyList = service.findPayAll(startDate, endDate, platform, moneyType, packageTypeSearch); String moneyType,String packageTypeSearch,String money_ids) {
List<ContractMoney> moneyList = service.findPayAll(startDate, endDate, platform, moneyType, packageTypeSearch,money_ids);
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("pay", "收款"); map.put("pay", "收款");
map.put("invoice", "开票"); map.put("invoice", "开票");
...@@ -327,8 +328,9 @@ public class ContractController { ...@@ -327,8 +328,9 @@ public class ContractController {
@RequestMapping(value = "find/payall", method = RequestMethod.GET) @RequestMapping(value = "find/payall", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResultModel findPayAll(@CurrentAccount User loginAccount, @RequestParam String startDate, public ResultModel findPayAll(@CurrentAccount User loginAccount, @RequestParam String startDate,
@RequestParam String endDate, @PathVariable String platform,String moneyType,String packageTypeSearch) { @RequestParam String endDate, @PathVariable String platform,
return ResultModel.OK(service.findPayAll(startDate, endDate, platform,moneyType,packageTypeSearch)); String moneyType,String packageTypeSearch,String money_ids) {
return ResultModel.OK(service.findPayAll(startDate, endDate, platform,moneyType,packageTypeSearch, money_ids));
} }
......
...@@ -48,4 +48,7 @@ public interface ContractMoneyRepository extends JpaRepository<ContractMoney, Lo ...@@ -48,4 +48,7 @@ public interface ContractMoneyRepository extends JpaRepository<ContractMoney, Lo
@Query(value = "select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.price_level = ?4 order by a.ds desc",nativeQuery = true) @Query(value = "select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.price_level = ?4 order by a.ds desc",nativeQuery = true)
List<ContractMoney> findByDsAllContractPkSearch(String startDate, String endDate, String platfrom, String pkType); List<ContractMoney> findByDsAllContractPkSearch(String startDate, String endDate, String platfrom, String pkType);
@Query(value = "select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.id in ?4 order by a.ds desc",nativeQuery = true)
List<ContractMoney> findByDsAllContractMoneyIds(String startDate, String endDate, String platfrom,List moneyIds);
} }
...@@ -73,5 +73,5 @@ public interface ContractService { ...@@ -73,5 +73,5 @@ public interface ContractService {
Contract findOne(User loginAccount, String startDate, String endDate, String platform, String contractId); Contract findOne(User loginAccount, String startDate, String endDate, String platform, String contractId);
List<ContractMoney> findPayAll(String startDate, String endDate, String platform, String moneyType, String packageType); List<ContractMoney> findPayAll(String startDate, String endDate, String platform, String moneyType, String packageType, String money_ids);
} }
\ No newline at end of file
...@@ -1705,12 +1705,12 @@ public class ContractServiceImpl implements ContractService { ...@@ -1705,12 +1705,12 @@ public class ContractServiceImpl implements ContractService {
@Override @Override
public List<ContractMoney> findPayAll(String startDate, String endDate, String platfrom) { public List<ContractMoney> findPayAll(String startDate, String endDate, String platfrom) {
return this.findPayAll(startDate,endDate,platfrom,"all","all"); return this.findPayAll(startDate,endDate,platfrom,"all","all", null);
} }
@Override @Override
public List<ContractMoney> findPayAll(String startDate, String endDate, String platfrom, String moneyType, String packageTypeSearch) { public List<ContractMoney> findPayAll(String startDate, String endDate, String platfrom, String moneyType, String packageTypeSearch, String money_ids) {
Map<Long,PackageType> packageTypeMap = new HashMap<>(); Map<Long,PackageType> packageTypeMap = new HashMap<>();
Map<Long, String> saleMap = new HashMap<>(); Map<Long, String> saleMap = new HashMap<>();
...@@ -1724,7 +1724,13 @@ public class ContractServiceImpl implements ContractService { ...@@ -1724,7 +1724,13 @@ public class ContractServiceImpl implements ContractService {
List<ContractMoney> list; List<ContractMoney> list;
if(!"all".equals(moneyType) && !"all".equals(packageTypeSearch) ){ if( "-1".equals(money_ids)){
list = new ArrayList<>();
}else if(!StringUtil.isEmpty(money_ids) ){
list = contractMoneyRepository.findByDsAllContractMoneyIds(startDate, endDate, platfrom,Arrays.asList(money_ids.split(",")));
}else if(!"all".equals(moneyType) && !"all".equals(packageTypeSearch) ){
list = contractMoneyRepository.findByDsAllContractAll(startDate, endDate, platfrom,moneyType,packageTypeSearch); list = contractMoneyRepository.findByDsAllContractAll(startDate, endDate, platfrom,moneyType,packageTypeSearch);
}else if(!"all".equals(moneyType)){ }else if(!"all".equals(moneyType)){
list = contractMoneyRepository.findByDsAllContractMoneyType(startDate, endDate, platfrom,moneyType); list = contractMoneyRepository.findByDsAllContractMoneyType(startDate, endDate, platfrom,moneyType);
......
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