Showing
6 changed files
with
85 additions
and
0 deletions
| ... | ... | @@ -67,6 +67,23 @@ public class CustomerShortController extends DefaultBaseController { |
| 67 | 67 | return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * 查询列表 | |
| 73 | + */ | |
| 74 | + @ApiOperation("查询列表") | |
| 75 | + @HasPermission({"base-data:custome-abbreviation:query"}) | |
| 76 | + @GetMapping("/queryShortName") | |
| 77 | + public InvokeResult<PageResult<QueryCustomerShortBo>> queryShortName(@Valid QueryCustomerShortVo vo) { | |
| 78 | + PageResult<CustomerShort> pageResult = customerShortService.queryShortName(getPageIndex(vo), getPageSize(vo), vo); | |
| 79 | + List<CustomerShort> dataList = pageResult.getDatas(); | |
| 80 | + List<QueryCustomerShortBo> results = null; | |
| 81 | + if (!CollectionUtil.isEmpty(dataList)) { | |
| 82 | + results = dataList.stream().map(QueryCustomerShortBo::new).collect(Collectors.toList()); | |
| 83 | + } | |
| 84 | + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); | |
| 85 | + } | |
| 86 | + | |
| 70 | 87 | /** |
| 71 | 88 | * 根据ID查询 |
| 72 | 89 | */ | ... | ... |
| ... | ... | @@ -51,6 +51,16 @@ public class CustomerShortServiceImpl extends BaseMpServiceImpl<CustomerShortMap |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | @Override |
| 54 | + public PageResult<CustomerShort> queryShortName(Integer pageIndex, Integer pageSize, QueryCustomerShortVo vo) { | |
| 55 | + pageIndex = Math.max(pageIndex, 1); | |
| 56 | + pageSize = Math.max(pageSize, 1); | |
| 57 | + int offset = (pageIndex - 1) * pageSize; | |
| 58 | + List<CustomerShort> dataList = getBaseMapper().queryShortName(offset, pageSize, vo); | |
| 59 | + | |
| 60 | + return PageResultUtil.convert(new PageInfo<>(dataList)); | |
| 61 | + } | |
| 62 | + | |
| 63 | + @Override | |
| 54 | 64 | public CustomerShort findById(String id) { |
| 55 | 65 | return getBaseMapper().selectById(id); |
| 56 | 66 | } | ... | ... |
| ... | ... | @@ -22,4 +22,14 @@ public interface CustomerShortMapper extends BaseMapper<CustomerShort> { |
| 22 | 22 | * @return List<CustomerShort> |
| 23 | 23 | */ |
| 24 | 24 | List<CustomerShort> query(@Param("vo") QueryCustomerShortVo vo); |
| 25 | + | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 查询列表 | |
| 29 | + * | |
| 30 | + * @param vo 查询条件 | |
| 31 | + * @return List<CustomerShort> | |
| 32 | + */ | |
| 33 | + List<CustomerShort> queryShortName(@Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize, | |
| 34 | + @Param("vo") QueryCustomerShortVo vo); | |
| 25 | 35 | } | ... | ... |
| ... | ... | @@ -29,6 +29,14 @@ public interface CustomerShortService extends BaseMpService<CustomerShort> { |
| 29 | 29 | List<CustomerShort> query(QueryCustomerShortVo vo); |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | + * 查询列表(根据ShortName去重) | |
| 33 | + * | |
| 34 | + * @param vo 查询条件 | |
| 35 | + * @return List<CustomerShort> | |
| 36 | + */ | |
| 37 | + PageResult<CustomerShort> queryShortName(Integer pageIndex, Integer pageSize, QueryCustomerShortVo vo); | |
| 38 | + | |
| 39 | + /** | |
| 32 | 40 | * 根据ID查询 |
| 33 | 41 | * |
| 34 | 42 | * @param id 主键ID | ... | ... |
| ... | ... | @@ -65,4 +65,35 @@ |
| 65 | 65 | </if> |
| 66 | 66 | </where> |
| 67 | 67 | </select> |
| 68 | + | |
| 69 | + <select id="queryShortName" resultMap="CustomerShort"> | |
| 70 | + SELECT id, | |
| 71 | + short_name, | |
| 72 | + customer_id, | |
| 73 | + type, | |
| 74 | + create_by_id, | |
| 75 | + update_by_id, | |
| 76 | + create_time, | |
| 77 | + update_time | |
| 78 | + FROM ( | |
| 79 | + SELECT tb.id, | |
| 80 | + tb.short_name, | |
| 81 | + tb.customer_id, | |
| 82 | + tb.type, | |
| 83 | + tb.create_by_id, | |
| 84 | + tb.update_by_id, | |
| 85 | + tb.create_time, | |
| 86 | + tb.update_time, | |
| 87 | + ROW_NUMBER() OVER (PARTITION BY tb.short_name ORDER BY tb.id) AS rn | |
| 88 | + FROM base_data_customer_short AS tb | |
| 89 | + <where> | |
| 90 | + <if test="vo.shortName != null and vo.shortName != ''"> | |
| 91 | + AND tb.short_name LIKE CONCAT('%', #{vo.shortName}, '%') | |
| 92 | + </if> | |
| 93 | + </where> | |
| 94 | + ) t | |
| 95 | + WHERE rn = 1 | |
| 96 | + ORDER BY create_time desc | |
| 97 | + LIMIT #{pageIndex}, #{pageSize} | |
| 98 | + </select> | |
| 68 | 99 | </mapper> | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/ledger/FundCoordinationController.java
| ... | ... | @@ -289,6 +289,15 @@ public class FundCoordinationController extends DefaultBaseController { |
| 289 | 289 | long daysBetween = ChronoUnit.DAYS.between(bo1.getDueDate(), LocalDate.now()); |
| 290 | 290 | bo1.setTimeout(String.valueOf(daysBetween)); |
| 291 | 291 | } |
| 292 | + //协调办理日期 | |
| 293 | + if (receipt.getCoordinateDate() != null) { | |
| 294 | + bo1.setCoordinateHandleDate(receipt.getCoordinateDate()); | |
| 295 | + } | |
| 296 | + if (receipt.getCoordinateDate() != null && bo1.getDueDate() != null) { | |
| 297 | + //实际超时(协调办理日期-应办理日期) | |
| 298 | + long daysBetween = ChronoUnit.DAYS.between(bo1.getDueDate(), receipt.getCoordinateDate()); | |
| 299 | + bo1.setActualTimeout(String.valueOf(daysBetween)); | |
| 300 | + } | |
| 292 | 301 | fundOrderingUnitDetailList.add(bo1); |
| 293 | 302 | } |
| 294 | 303 | //排序 | ... | ... |