20 changed files with 957 additions and 4 deletions
@ -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; |
|||
|
|||
/** |
|||
* 删除标识 0:否,1:是 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 企业照片 |
|||
*/ |
|||
private List<String> images; |
|||
|
|||
} |
@ -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; |
|||
} |
@ -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; |
|||
} |
@ -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); |
|||
} |
|||
|
|||
} |
@ -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); |
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
|
|||
} |
@ -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); |
|||
} |
@ -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); |
|||
} |
|||
|
|||
} |
@ -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> |
Loading…
Reference in new issue