Browse Source

大屏企业信息管理、大屏企业列表接口 init

feature/screenDataPush
liuchuang 4 years ago
parent
commit
d8e44bc937
  1. 18
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java
  2. 11
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java
  3. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java
  4. 10
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java
  5. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java
  6. 5
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/constant/CustomImageConstant.java
  7. 128
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ScreenCompanyDTO.java
  8. 29
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcScreenCompanyListFormDTO.java
  9. 57
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcScreenCompanyListResultDTO.java
  10. 111
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/ScreenCompanyController.java
  11. 58
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/ScreenCompanyDao.java
  12. 91
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/ScreenCompanyEntity.java
  13. 86
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/excel/ScreenCompanyExcel.java
  14. 107
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/ScreenCompanyService.java
  15. 120
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/ScreenCompanyServiceImpl.java
  16. 13
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/CustomImgDao.java
  17. 13
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/CustomImgService.java
  18. 8
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/CustomImgServiceImpl.java
  19. 80
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/epidemic/ScreenCompanyDao.xml
  20. 6
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/CustomImgDao.xml

18
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java

@ -8,11 +8,15 @@ import com.elink.esua.epdc.dto.DeptOption;
import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO;
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO;
import com.elink.esua.epdc.service.AppUserService;
import com.elink.esua.epdc.service.CustomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户模块
*
@ -168,4 +172,18 @@ public class ApiScreenPopulationController {
public Result<PopulationInfoOverviewDTO> getPopulationInfoOverviewForScreen(@PathVariable("communityId")String communityId) {
return appUserService.getPopulationInfoOverviewForScreen(communityId);
}
/**
* 大屏-企业信息
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO>>
* @author lc
* @since 2021/9/3 18:59
*/
@PostMapping("screenCompany/list")
public Result<List<EpdcScreenCompanyListResultDTO>> screenCompanyList(@RequestBody EpdcScreenCompanyListFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
return customService.listOfCompanyListForScreen(formDto);
}
}

11
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java

@ -398,4 +398,15 @@ public interface CustomFeignClient {
@PostMapping(value = "custom/enterprisereport/addEnterpriseReport", consumes = MediaType.APPLICATION_JSON_VALUE)
Result addEnterpriseReport(@RequestBody EnterpriseReportAddFormDTO enterpriseReportAddFormDTO);
/**
* 大屏-企业列表
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO>>
* @author lc
* @since 2021/9/3 19:02
*/
@PostMapping(value = "custom/screencompany/screenCompanyList", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<EpdcScreenCompanyListResultDTO>> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto);
}

5
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java

@ -215,4 +215,9 @@ public class CustomFeignClientFallback implements CustomFeignClient {
public Result addEnterpriseReport(EnterpriseReportAddFormDTO enterpriseReportAddFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "addEnterpriseReport", enterpriseReportAddFormDTO);
}
@Override
public Result<List<EpdcScreenCompanyListResultDTO>> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "listOfCompanyListForScreen", formDto);
}
}

10
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java

@ -382,4 +382,14 @@ public interface CustomService {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.EnterpriseReportDTO>
**/
Result<EnterpriseReportDTO> getEnterpriseReportList(String id);
/**
* 大屏-企业信息
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO>>
* @author lc
* @since 2021/9/3 19:00
*/
Result<List<EpdcScreenCompanyListResultDTO>> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto);
}

5
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java

@ -417,4 +417,9 @@ public class CustomServiceImpl implements CustomService {
return customFeignClient.getEnterpriseReportList(id);
}
@Override
public Result<List<EpdcScreenCompanyListResultDTO>> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto) {
return customFeignClient.listOfCompanyListForScreen(formDto);
}
}

5
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/constant/CustomImageConstant.java

@ -20,4 +20,9 @@ public interface CustomImageConstant {
* 志愿者服务-拼团购-评价
*/
String IMAGE_TYPE_GROUP_BUY_EVALUATION = "group_buy_evaluation";
/**
* 大屏企业管理照片
*/
String SCREEN_COMPANY_IMAGE = "screen_company_image";
}

128
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ScreenCompanyDTO.java

@ -0,0 +1,128 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data;
/**
* 大屏企业信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-03
*/
@Data
public class ScreenCompanyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 企业名称
*/
private String companyName;
/**
* 企业简介
*/
private String companyIntroduction;
/**
* 联系人
*/
private String contactPerson;
/**
* 联系电话
*/
private String mobile;
/**
* 企业地址
*/
private String companyAddress;
/**
* 统一社会信用代码
*/
private String uniformSocialCreditCode;
/**
* 注册资金(万元)
*/
private Integer registeredCapital;
/**
* 企业人数
*/
private Integer employedPopulation;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 乐观锁
*/
private Integer revision;
/**
* 删除标识 01
*/
private String delFlag;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 企业照片
*/
private List<String> images;
}

29
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcScreenCompanyListFormDTO.java

@ -0,0 +1,29 @@
package com.elink.esua.epdc.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import java.io.Serializable;
@Data
public class EpdcScreenCompanyListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 页码
*/
@Min(value = 1, message = "页码必须大于0")
private Integer pageIndex;
/**
* 页容量
*/
@Min(value = 1, message = "页容量必须大于0")
private Integer pageSize;
/**
* 企业名称
*/
private String companyName;
}

57
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcScreenCompanyListResultDTO.java

@ -0,0 +1,57 @@
package com.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class EpdcScreenCompanyListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 企业名称
*/
private String companyName;
/**
* 企业简介
*/
private String companyIntroduction;
/**
* 联系人
*/
private String contactPerson;
/**
* 联系电话
*/
private String mobile;
/**
* 企业地址
*/
private String companyAddress;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 企业照片
*/
private List<String> images;
}

111
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/ScreenCompanyController.java

@ -0,0 +1,111 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.epidemic.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.ScreenCompanyDTO;
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO;
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO;
import com.elink.esua.epdc.modules.epidemic.excel.ScreenCompanyExcel;
import com.elink.esua.epdc.modules.epidemic.service.ScreenCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 大屏企业信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-03
*/
@RestController
@RequestMapping("screencompany")
public class ScreenCompanyController {
@Autowired
private ScreenCompanyService screenCompanyService;
@GetMapping("page")
public Result<PageData<ScreenCompanyDTO>> page(@RequestParam Map<String, Object> params){
PageData<ScreenCompanyDTO> page = screenCompanyService.page(params);
return new Result<PageData<ScreenCompanyDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ScreenCompanyDTO> get(@PathVariable("id") String id){
ScreenCompanyDTO data = screenCompanyService.get(id);
return new Result<ScreenCompanyDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ScreenCompanyDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
screenCompanyService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ScreenCompanyDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
screenCompanyService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
screenCompanyService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ScreenCompanyDTO> list = screenCompanyService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ScreenCompanyExcel.class);
}
/**
* 大屏-企业列表
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO>>
* @author lc
* @since 2021/9/3 18:55
*/
@PostMapping("screenCompanyList")
public Result<List<EpdcScreenCompanyListResultDTO>> screenCompanyList(@RequestBody EpdcScreenCompanyListFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
List<EpdcScreenCompanyListResultDTO> data = screenCompanyService.listOfCompanyListForScreen(formDto);
return new Result<List<EpdcScreenCompanyListResultDTO>>().ok(data);
}
}

58
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/ScreenCompanyDao.java

@ -0,0 +1,58 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.epidemic.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.ScreenCompanyDTO;
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO;
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO;
import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 大屏企业信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-03
*/
@Mapper
public interface ScreenCompanyDao extends BaseDao<ScreenCompanyEntity> {
/**
* 查询大屏企业信息
*
* @param id
* @return com.elink.esua.epdc.dto.ScreenCompanyDTO
* @author lc
* @since 2021/9/3 18:34
*/
ScreenCompanyDTO selectCompanyInfoById(String id);
/**
* 大屏-企业列表
*
* @param formDto
* @return java.util.List<com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO>
* @author lc
* @since 2021/9/3 18:50
*/
List<EpdcScreenCompanyListResultDTO> selectListOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto);
}

91
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/ScreenCompanyEntity.java

@ -0,0 +1,91 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.epidemic.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 大屏企业信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_screen_company")
public class ScreenCompanyEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 企业名称
*/
private String companyName;
/**
* 企业简介
*/
private String companyIntroduction;
/**
* 联系人
*/
private String contactPerson;
/**
* 联系电话
*/
private String mobile;
/**
* 企业地址
*/
private String companyAddress;
/**
* 统一社会信用代码
*/
private String uniformSocialCreditCode;
/**
* 注册资金(万元)
*/
private Integer registeredCapital;
/**
* 企业人数
*/
private Integer employedPopulation;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

86
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/excel/ScreenCompanyExcel.java

@ -0,0 +1,86 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.epidemic.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 大屏企业信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-03
*/
@Data
public class ScreenCompanyExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "企业名称")
private String companyName;
@Excel(name = "企业简介")
private String companyIntroduction;
@Excel(name = "联系人")
private String contactPerson;
@Excel(name = "联系电话")
private String mobile;
@Excel(name = "企业地址")
private String companyAddress;
@Excel(name = "统一社会信用代码")
private String uniformSocialCreditCode;
@Excel(name = "注册资金(万元)")
private Integer registeredCapital;
@Excel(name = "企业人数")
private Integer employedPopulation;
@Excel(name = "经度")
private String longitude;
@Excel(name = "纬度")
private String latitude;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "删除标识 0:否,1:是")
private String delFlag;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

107
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/ScreenCompanyService.java

@ -0,0 +1,107 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.epidemic.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.ScreenCompanyDTO;
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO;
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO;
import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity;
import java.util.List;
import java.util.Map;
/**
* 大屏企业信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-03
*/
public interface ScreenCompanyService extends BaseService<ScreenCompanyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenCompanyDTO>
* @author generator
* @date 2021-09-03
*/
PageData<ScreenCompanyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenCompanyDTO>
* @author generator
* @date 2021-09-03
*/
List<ScreenCompanyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenCompanyDTO
* @author generator
* @date 2021-09-03
*/
ScreenCompanyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-09-03
*/
void save(ScreenCompanyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-09-03
*/
void update(ScreenCompanyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-09-03
*/
void delete(String[] ids);
/**
* 大屏-企业列表
*
* @param formDto
* @return java.util.List<com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO>
* @author lc
* @since 2021/9/3 18:52
*/
List<EpdcScreenCompanyListResultDTO> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto);
}

120
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/ScreenCompanyServiceImpl.java

@ -0,0 +1,120 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.epidemic.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.constant.CustomImageConstant;
import com.elink.esua.epdc.dto.ScreenCompanyDTO;
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO;
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO;
import com.elink.esua.epdc.modules.epidemic.dao.ScreenCompanyDao;
import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity;
import com.elink.esua.epdc.modules.epidemic.service.ScreenCompanyService;
import com.elink.esua.epdc.modules.reportissue.service.CustomImgService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 大屏企业信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-03
*/
@Service
public class ScreenCompanyServiceImpl extends BaseServiceImpl<ScreenCompanyDao, ScreenCompanyEntity> implements ScreenCompanyService {
@Autowired
private CustomImgService customImgService;
@Override
public PageData<ScreenCompanyDTO> page(Map<String, Object> params) {
IPage<ScreenCompanyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenCompanyDTO.class);
}
@Override
public List<ScreenCompanyDTO> list(Map<String, Object> params) {
List<ScreenCompanyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenCompanyDTO.class);
}
private QueryWrapper<ScreenCompanyEntity> getWrapper(Map<String, Object> params){
String companyName = (String)params.get("companyName");
QueryWrapper<ScreenCompanyEntity> wrapper = new QueryWrapper<>();
wrapper.like(StringUtils.isNotBlank(companyName), "COMPANY_NAME", companyName.trim());
return wrapper;
}
@Override
public ScreenCompanyDTO get(String id) {
return baseDao.selectCompanyInfoById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenCompanyDTO dto) {
ScreenCompanyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCompanyEntity.class);
insert(entity);
// 保存图片
customImgService.saveImages(dto.getImages(), entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenCompanyDTO dto) {
ScreenCompanyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCompanyEntity.class);
updateById(entity);
// 删除已有图片
customImgService.modifyImagesByReferenceIdAndImgType(entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE);
// 保存新图片
customImgService.saveImages(dto.getImages(), entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<EpdcScreenCompanyListResultDTO> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto) {
int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize();
formDto.setPageIndex(pageIndex);
return baseDao.selectListOfCompanyListForScreen(formDto);
}
}

13
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/CustomImgDao.java

@ -37,4 +37,15 @@ public interface CustomImgDao extends BaseDao<CustomImgEntity> {
* @return void
**/
void deleteByGroupBuyId(String id);
}
/**
* 删除照片
*
* @param referenceId
* @param imgType
* @return void
* @author lc
* @since 2021/9/3 18:30
*/
void modifyImagesByReferenceIdAndImgType(String referenceId, String imgType);
}

13
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/CustomImgService.java

@ -104,4 +104,15 @@ public interface CustomImgService extends BaseService<CustomImgEntity> {
* @since 2020/10/22 17:42
*/
boolean saveImages(List<String> images, String referenceId, String imgType);
}
/**
* 删除照片
*
* @param referenceId
* @param imgType
* @return void
* @author lc
* @since 2021/9/3 18:29
*/
void modifyImagesByReferenceIdAndImgType(String referenceId, String imgType);
}

8
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/CustomImgServiceImpl.java

@ -116,4 +116,10 @@ public class CustomImgServiceImpl extends BaseServiceImpl<CustomImgDao, CustomIm
return insertBatch(entities);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void modifyImagesByReferenceIdAndImgType(String referenceId, String imgType) {
baseDao.modifyImagesByReferenceIdAndImgType(referenceId, imgType);
}
}

80
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/epidemic/ScreenCompanyDao.xml

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.epidemic.dao.ScreenCompanyDao">
<resultMap id="screenCompanyInfo" type="com.elink.esua.epdc.dto.ScreenCompanyDTO">
<result property="id" column="ID"/>
<result property="companyName" column="COMPANY_NAME"/>
<result property="companyIntroduction" column="COMPANY_INTRODUCTION"/>
<result property="contactPerson" column="CONTACT_PERSON"/>
<result property="mobile" column="MOBILE"/>
<result property="companyAddress" column="COMPANY_ADDRESS"/>
<result property="uniformSocialCreditCode" column="UNIFORM_SOCIAL_CREDIT_CODE"/>
<result property="registeredCapital" column="REGISTERED_CAPITAL"/>
<result property="employedPopulation" column="EMPLOYED_POPULATION"/>
<result property="longitude" column="LONGITUDE"/>
<result property="latitude" column="LATITUDE"/>
<collection property="images" ofType="java.lang.String">
<result property="imgUrl" column="IMG_URL"/>
</collection>
</resultMap>
<select id="selectCompanyInfoById" resultMap="screenCompanyInfo">
SELECT
c.ID,
c.COMPANY_NAME,
c.COMPANY_INTRODUCTION,
c.CONTACT_PERSON,
c.MOBILE,
c.COMPANY_ADDRESS,
c.UNIFORM_SOCIAL_CREDIT_CODE,
c.REGISTERED_CAPITAL,
c.EMPLOYED_POPULATION,
c.LONGITUDE,
c.LATITUDE,
i.IMG_URL
FROM
epdc_screen_company c
LEFT JOIN epdc_custom_img i ON i.REFERENCE_ID = c.ID AND i.DEL_FLAG = '0'
WHERE
c.DEL_FLAG = '0'
AND c.ID = #{id}
</select>
<resultMap id="screenCompanyInfoList" type="com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO">
<result property="id" column="ID"/>
<result property="companyName" column="COMPANY_NAME"/>
<result property="companyIntroduction" column="COMPANY_INTRODUCTION"/>
<result property="contactPerson" column="CONTACT_PERSON"/>
<result property="mobile" column="MOBILE"/>
<result property="companyAddress" column="COMPANY_ADDRESS"/>
<result property="longitude" column="LONGITUDE"/>
<result property="latitude" column="LATITUDE"/>
<collection property="images" ofType="java.lang.String">
<result property="imgUrl" column="IMG_URL"/>
</collection>
</resultMap>
<select id="selectListOfCompanyListForScreen" resultMap="screenCompanyInfoList">
SELECT
c.ID,
c.COMPANY_NAME,
c.COMPANY_INTRODUCTION,
c.CONTACT_PERSON,
c.MOBILE,
c.COMPANY_ADDRESS,
c.LONGITUDE,
c.LATITUDE,
i.IMG_URL
FROM
epdc_screen_company c
LEFT JOIN epdc_custom_img i ON i.REFERENCE_ID = c.ID AND i.DEL_FLAG = '0'
WHERE
c.DEL_FLAG = '0'
<if test="companyName != null and companyName != ''">
and c.COMPANY_NAME like concat('%', #{companyName}, '%')
</if>
ORDER BY c.CREATED_TIME DESC
LIMIT #{pageIndex},#{pageSize}
</select>
</mapper>

6
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/CustomImgDao.xml

@ -19,5 +19,9 @@
delete from epdc_custom_img where REFERENCE_ID = #{id}
</delete>
<update id="modifyImagesByReferenceIdAndImgType">
update epdc_custom_img set del_flag = '1' where REFERENCE_ID = #{id} and IMG_TYPE = #{imgType}
</update>
</mapper>
</mapper>

Loading…
Cancel
Save