From 31c747f311845a2ee7862360527b7a5fd660ce54 Mon Sep 17 00:00:00 2001 From: ky <592468495@qq.com> Date: Tue, 9 Jun 2020 14:45:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gszc/controller/PcCustomController.java | 4 ++-- src/main/java/com/gszc/entity/Custom.java | 4 ++++ src/main/java/com/gszc/entity/Invoice.java | 4 ++++ .../gszc/service/impl/CustomServiceImpl.java | 20 ++++++++++++++----- .../gszc/service/impl/InvoiceServiceImpl.java | 1 + 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gszc/controller/PcCustomController.java b/src/main/java/com/gszc/controller/PcCustomController.java index e7de4d0..f8d3c2e 100644 --- a/src/main/java/com/gszc/controller/PcCustomController.java +++ b/src/main/java/com/gszc/controller/PcCustomController.java @@ -50,9 +50,9 @@ public class PcCustomController { @PostMapping("/pcEnableCustomList") @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header") @ApiOperation(value = "已认证列表", notes = "已认证列表") - public Result pcEnableCustomList(Integer pageNum,Integer pageSize,String copycatId) { + public Result pcEnableCustomList(Integer pageNum,Integer pageSize,String copycatId,String param) { - JSONObject customs = customService.pcEnableCustomList(pageNum,pageSize,copycatId); + JSONObject customs = customService.pcEnableCustomList(pageNum,pageSize,copycatId,param); return ResultBuilder.withPayload(customs).build(); } diff --git a/src/main/java/com/gszc/entity/Custom.java b/src/main/java/com/gszc/entity/Custom.java index 96fea87..da254bf 100644 --- a/src/main/java/com/gszc/entity/Custom.java +++ b/src/main/java/com/gszc/entity/Custom.java @@ -142,4 +142,8 @@ red yellow blue purple @ApiModelProperty(value = "成立日期") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date buildDate; + + @ApiModelProperty(hidden = true) + @TableField(exist = false) + private String parkName; } diff --git a/src/main/java/com/gszc/entity/Invoice.java b/src/main/java/com/gszc/entity/Invoice.java index 51c17fe..38e3de2 100644 --- a/src/main/java/com/gszc/entity/Invoice.java +++ b/src/main/java/com/gszc/entity/Invoice.java @@ -92,4 +92,8 @@ public class Invoice implements Serializable { @ApiModelProperty(hidden = true) @TableField(exist = false) private String copycatName; + + @ApiModelProperty(hidden = true) + @TableField(exist = false) + private String customSocialCreditCode; } diff --git a/src/main/java/com/gszc/service/impl/CustomServiceImpl.java b/src/main/java/com/gszc/service/impl/CustomServiceImpl.java index cea9b3f..84582be 100644 --- a/src/main/java/com/gszc/service/impl/CustomServiceImpl.java +++ b/src/main/java/com/gszc/service/impl/CustomServiceImpl.java @@ -56,6 +56,9 @@ public class CustomServiceImpl extends ServiceImpl impleme @Autowired MiniUserServiceImpl miniUserService; + @Autowired + ParkMapper parkMapper; + public void customRegister(Custom custom,List customSupports){ String id = String.format("%06d",new Random().nextInt(999999)+1); Custom isHave = customMapper.selectById(id); @@ -133,6 +136,9 @@ public class CustomServiceImpl extends ServiceImpl impleme Custom custom = customMapper.selectById(customId); List customSupports = customSupportMapper.selectList(new EntityWrapper().eq("custom_id", customId)); jsonObject.put("custom",custom); + String parkId = custom.getPark(); + Park park = parkMapper.selectById(parkId); + custom.setParkName(park.getName()); jsonObject.put("customSupports",customSupports); //年度 @@ -214,16 +220,20 @@ public class CustomServiceImpl extends ServiceImpl impleme * @param pageSize * @return */ - public JSONObject pcEnableCustomList(Integer pageNum,Integer pageSize,String copycatId){ + public JSONObject pcEnableCustomList(Integer pageNum,Integer pageSize,String copycatId,String param){ + Wrapper customWrapper = new EntityWrapper().eq("status_code", "enable"); + if(!param.equals("")){ + customWrapper.like("company_name",param).like("link_man",param).like("link_telephone",param); + } Integer count = null; List customs; if(null==copycatId){ - count = customMapper.selectCount(new EntityWrapper().eq("status_code", "enable")); - customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "enable").orderBy("create_date", false)); + count = customMapper.selectCount(customWrapper); + customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize), customWrapper.orderBy("create_date", false)); }else { - count = customMapper.selectCount(new EntityWrapper().eq("status_code", "enable").eq("copycat_id",copycatId)); - customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "enable").eq("copycat_id",copycatId).orderBy("create_date", false)); + count = customMapper.selectCount(customWrapper.eq("copycat_id",copycatId)); + customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize), customWrapper.eq("copycat_id",copycatId).orderBy("create_date", false)); }for(Custom custom:customs){ String copycat = custom.getCopycatId(); PcUser pcUser = pcUserService.pcUserDetail(copycat); diff --git a/src/main/java/com/gszc/service/impl/InvoiceServiceImpl.java b/src/main/java/com/gszc/service/impl/InvoiceServiceImpl.java index d5180d8..83e9b16 100644 --- a/src/main/java/com/gszc/service/impl/InvoiceServiceImpl.java +++ b/src/main/java/com/gszc/service/impl/InvoiceServiceImpl.java @@ -121,6 +121,7 @@ public class InvoiceServiceImpl extends ServiceImpl impl String customId = invoice.getCustomId(); Custom custom = customMapper.selectById(customId); invoice.setCustomName(custom.getCompanyName()); + invoice.setCustomSocialCreditCode(custom.getSocialCreditCode()); InvoiceHeader invoiceHeader = invoiceHeaderMapper.selectById(invoice.getInvoiceHeaderId()); jsonObject.put("invoice", invoice); jsonObject.put("invoiceHeader", invoiceHeader);