19 changed files with 1384 additions and 5 deletions
@ -0,0 +1,177 @@ |
|||||
|
/** |
||||
|
* 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 lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 企业信息上报 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-02 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class EnterpriseReportDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 企业所属网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 企业所属网格ID |
||||
|
*/ |
||||
|
private Long gridId; |
||||
|
|
||||
|
/** |
||||
|
* 发布人所属网格 |
||||
|
*/ |
||||
|
private String dept; |
||||
|
|
||||
|
/** |
||||
|
* 发布人所属网格ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 发布人ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 发布人手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 发布人头像 |
||||
|
*/ |
||||
|
private String faceImg; |
||||
|
|
||||
|
/** |
||||
|
* 发布人真实姓名 |
||||
|
*/ |
||||
|
private String realName; |
||||
|
|
||||
|
/** |
||||
|
* 所属年度 |
||||
|
*/ |
||||
|
private String year; |
||||
|
|
||||
|
/** |
||||
|
* 所属季度 |
||||
|
*/ |
||||
|
private String quarter; |
||||
|
|
||||
|
/** |
||||
|
* 公司名称 |
||||
|
*/ |
||||
|
private String enterpriseName; |
||||
|
|
||||
|
/** |
||||
|
* 法人或联络人 |
||||
|
*/ |
||||
|
private String legalPerson; |
||||
|
|
||||
|
/** |
||||
|
* 联系电话 |
||||
|
*/ |
||||
|
private String concat; |
||||
|
|
||||
|
/** |
||||
|
* 公司状态 |
||||
|
*/ |
||||
|
private String enterpriseStatus; |
||||
|
|
||||
|
/** |
||||
|
* 营业收入 |
||||
|
*/ |
||||
|
private BigDecimal enterpriseIncome; |
||||
|
|
||||
|
/** |
||||
|
* 用工人数 |
||||
|
*/ |
||||
|
private Integer enterprisePeopleNum; |
||||
|
|
||||
|
/** |
||||
|
* 问题 |
||||
|
*/ |
||||
|
private String question; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0:未删除,1:已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 企业父所有部门 |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 企业父所有部门 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 企业所有部门ID |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 企业所有部门名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
} |
@ -0,0 +1,104 @@ |
|||||
|
package com.elink.esua.epdc.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.Size; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @since v1.0.0 2020-05-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class EnterpriseReportAddFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
/** |
||||
|
* 企业所属网格ID |
||||
|
*/ |
||||
|
@NotBlank(message = "企业所属网格ID不能为空") |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 所属年度 |
||||
|
*/ |
||||
|
@NotBlank(message = "所属年度不能为空") |
||||
|
private String year; |
||||
|
|
||||
|
/** |
||||
|
* 所属季度 |
||||
|
*/ |
||||
|
@NotBlank(message = "所属季度不能为空") |
||||
|
private String quarter; |
||||
|
|
||||
|
/** |
||||
|
* 公司名称 |
||||
|
*/ |
||||
|
@NotBlank(message = "公司名称不能为空") |
||||
|
@Size(min = 1, max = 100, message = "公司名称不能为空且在100个字以内") |
||||
|
private String enterpriseName; |
||||
|
|
||||
|
/** |
||||
|
* 法人或联络人 |
||||
|
*/ |
||||
|
@NotBlank(message = " 法人或联络人不能为空") |
||||
|
@Size(min = 1, max = 50, message = "法人或联络人不能为空且在50个字以内") |
||||
|
private String legalPerson; |
||||
|
|
||||
|
/** |
||||
|
* 联系电话 |
||||
|
*/ |
||||
|
private String concat; |
||||
|
|
||||
|
/** |
||||
|
* 公司状态 |
||||
|
*/ |
||||
|
private String enterpriseStatus; |
||||
|
|
||||
|
/** |
||||
|
* 营业收入 |
||||
|
*/ |
||||
|
private BigDecimal enterpriseIncome; |
||||
|
|
||||
|
/** |
||||
|
* 用工人数 |
||||
|
*/ |
||||
|
private Integer enterprisePeopleNum; |
||||
|
|
||||
|
/** |
||||
|
* 问题 |
||||
|
*/ |
||||
|
private String question; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 发布人手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 发布人头像 |
||||
|
*/ |
||||
|
private String faceImg; |
||||
|
|
||||
|
/** |
||||
|
* 发布人真实姓名 |
||||
|
*/ |
||||
|
private String realName; |
||||
|
|
||||
|
/** |
||||
|
* 发布人所属网格 |
||||
|
*/ |
||||
|
private String dept; |
||||
|
|
||||
|
/** |
||||
|
* 发布人所属网格ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
private String userId; |
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
package com.elink.esua.epdc.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @since v1.0.0 2020-05-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class EnterpriseReportFormDTO 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 userId; |
||||
|
|
||||
|
} |
@ -0,0 +1,130 @@ |
|||||
|
/** |
||||
|
* 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.enterprisereport.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.DefaultGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.elink.esua.epdc.dto.EnterpriseReportDTO; |
||||
|
import com.elink.esua.epdc.dto.form.EnterpriseReportAddFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.EnterpriseReportFormDTO; |
||||
|
import com.elink.esua.epdc.modules.enterprisereport.excel.EnterpriseReportExcel; |
||||
|
import com.elink.esua.epdc.modules.enterprisereport.service.EnterpriseReportService; |
||||
|
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-08-02 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("enterprisereport") |
||||
|
public class EnterpriseReportController { |
||||
|
|
||||
|
@Autowired |
||||
|
private EnterpriseReportService enterpriseReportService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<EnterpriseReportDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<EnterpriseReportDTO> page = enterpriseReportService.page(params); |
||||
|
return new Result<PageData<EnterpriseReportDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<EnterpriseReportDTO> get(@PathVariable("id") String id){ |
||||
|
EnterpriseReportDTO data = enterpriseReportService.get(id); |
||||
|
return new Result<EnterpriseReportDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody EnterpriseReportDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
enterpriseReportService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody EnterpriseReportDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
enterpriseReportService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
enterpriseReportService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<EnterpriseReportDTO> list = enterpriseReportService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, EnterpriseReportExcel.class); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 小程序获取企业上报列表 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2021/8/2 |
||||
|
* @Param [] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.EnterpriseReportDTO> |
||||
|
**/ |
||||
|
@GetMapping("/getEnterpriseReportList") |
||||
|
public Result<List<EnterpriseReportDTO>> getEnterpriseReportList(@RequestBody EnterpriseReportFormDTO enterpriseReportFormDTO){ |
||||
|
return enterpriseReportService.getEnterpriseReportList(enterpriseReportFormDTO); |
||||
|
} |
||||
|
/** |
||||
|
* @Description 小程序获取企业上报详情 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2021/8/2 |
||||
|
* @Param [] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.EnterpriseReportDTO> |
||||
|
**/ |
||||
|
@GetMapping("/getEnterpriseReportDetail/{id}") |
||||
|
public Result<EnterpriseReportDTO> getEnterpriseReportDetail(@PathVariable String id){ |
||||
|
return enterpriseReportService.getEnterpriseReportDetail(id); |
||||
|
} |
||||
|
/** |
||||
|
* @Description 新增企业上报 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2021/8/2 |
||||
|
* @Param [enterpriseReportAddFormDTO] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
**/ |
||||
|
@PostMapping("/addEnterpriseReport") |
||||
|
public Result addEnterpriseReport(@RequestBody EnterpriseReportAddFormDTO enterpriseReportAddFormDTO){ |
||||
|
return enterpriseReportService.addEnterpriseReport(enterpriseReportAddFormDTO); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
/** |
||||
|
* 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.enterprisereport.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.dto.EnterpriseReportDTO; |
||||
|
import com.elink.esua.epdc.dto.form.EnterpriseReportFormDTO; |
||||
|
import com.elink.esua.epdc.modules.enterprisereport.entity.EnterpriseReportEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 企业信息上报 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-02 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface EnterpriseReportDao extends BaseDao<EnterpriseReportEntity> { |
||||
|
/** |
||||
|
* @Description 企业上报列表 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2021/8/2 |
||||
|
* @Param [formDTO] |
||||
|
* @return java.util.List<com.elink.esua.epdc.dto.EnterpriseReportDTO> |
||||
|
**/ |
||||
|
List<EnterpriseReportDTO> getEnterpriseReportList(EnterpriseReportFormDTO formDTO); |
||||
|
} |
@ -0,0 +1,145 @@ |
|||||
|
/** |
||||
|
* 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.enterprisereport.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 企业信息上报 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-02 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_enterprise_report") |
||||
|
public class EnterpriseReportEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 企业所属网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 企业所属网格ID |
||||
|
*/ |
||||
|
private Long gridId; |
||||
|
|
||||
|
/** |
||||
|
* 发布人所属网格 |
||||
|
*/ |
||||
|
private String dept; |
||||
|
|
||||
|
/** |
||||
|
* 发布人所属网格ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 发布人ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 发布人手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 发布人头像 |
||||
|
*/ |
||||
|
private String faceImg; |
||||
|
|
||||
|
/** |
||||
|
* 发布人真实姓名 |
||||
|
*/ |
||||
|
private String realName; |
||||
|
|
||||
|
/** |
||||
|
* 所属年度 |
||||
|
*/ |
||||
|
private String year; |
||||
|
|
||||
|
/** |
||||
|
* 所属季度 |
||||
|
*/ |
||||
|
private String quarter; |
||||
|
|
||||
|
/** |
||||
|
* 公司名称 |
||||
|
*/ |
||||
|
private String enterpriseName; |
||||
|
|
||||
|
/** |
||||
|
* 法人或联络人 |
||||
|
*/ |
||||
|
private String legalPerson; |
||||
|
|
||||
|
/** |
||||
|
* 联系电话 |
||||
|
*/ |
||||
|
private String concat; |
||||
|
|
||||
|
/** |
||||
|
* 公司状态 |
||||
|
*/ |
||||
|
private String enterpriseStatus; |
||||
|
|
||||
|
/** |
||||
|
* 营业收入 |
||||
|
*/ |
||||
|
private BigDecimal enterpriseIncome; |
||||
|
|
||||
|
/** |
||||
|
* 用工人数 |
||||
|
*/ |
||||
|
private Integer enterprisePeopleNum; |
||||
|
|
||||
|
/** |
||||
|
* 问题 |
||||
|
*/ |
||||
|
private String question; |
||||
|
|
||||
|
/** |
||||
|
* 企业父所有部门 |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 企业父所有部门 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 企业所有部门ID |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 企业所有部门名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
} |
@ -0,0 +1,123 @@ |
|||||
|
/** |
||||
|
* 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.enterprisereport.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 企业信息上报 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-02 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class EnterpriseReportExcel { |
||||
|
|
||||
|
@Excel(name = "ID") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "企业所属网格") |
||||
|
private Long grid; |
||||
|
|
||||
|
@Excel(name = "企业所属网格ID") |
||||
|
private String gridId; |
||||
|
|
||||
|
@Excel(name = "发布人所属网格") |
||||
|
private Long dept; |
||||
|
|
||||
|
@Excel(name = "发布人所属网格ID") |
||||
|
private String deptId; |
||||
|
|
||||
|
@Excel(name = "发布人ID") |
||||
|
private String userId; |
||||
|
|
||||
|
@Excel(name = "发布人昵称") |
||||
|
private String nickname; |
||||
|
|
||||
|
@Excel(name = "发布人手机号") |
||||
|
private String mobile; |
||||
|
|
||||
|
@Excel(name = "发布人头像") |
||||
|
private String faceImg; |
||||
|
|
||||
|
@Excel(name = "发布人真实姓名") |
||||
|
private String realName; |
||||
|
|
||||
|
@Excel(name = "所属年度") |
||||
|
private String year; |
||||
|
|
||||
|
@Excel(name = "所属季度") |
||||
|
private String quarter; |
||||
|
|
||||
|
@Excel(name = "公司名称") |
||||
|
private String enterpriseName; |
||||
|
|
||||
|
@Excel(name = "法人或联络人") |
||||
|
private String legalPerson; |
||||
|
|
||||
|
@Excel(name = "联系电话") |
||||
|
private String concat; |
||||
|
|
||||
|
@Excel(name = "公司状态") |
||||
|
private String enterpriseStatus; |
||||
|
|
||||
|
@Excel(name = "营业收入") |
||||
|
private BigDecimal enterpriseIncome; |
||||
|
|
||||
|
@Excel(name = "用工人数") |
||||
|
private Integer enterprisePeopleNum; |
||||
|
|
||||
|
@Excel(name = "问题") |
||||
|
private String question; |
||||
|
|
||||
|
@Excel(name = "删除标识 0:未删除,1:已删除") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
@Excel(name = "企业父所有部门") |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
@Excel(name = "企业父所有部门") |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
@Excel(name = "企业所有部门ID") |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
@Excel(name = "企业所有部门名称") |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* 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.enterprisereport.redis; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 企业信息上报 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-02 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class EnterpriseReportRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,122 @@ |
|||||
|
/** |
||||
|
* 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.enterprisereport.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.EnterpriseReportDTO; |
||||
|
import com.elink.esua.epdc.dto.form.EnterpriseReportAddFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.EnterpriseReportFormDTO; |
||||
|
import com.elink.esua.epdc.modules.enterprisereport.entity.EnterpriseReportEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 企业信息上报 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-02 |
||||
|
*/ |
||||
|
public interface EnterpriseReportService extends BaseService<EnterpriseReportEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<EnterpriseReportDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-08-02 |
||||
|
*/ |
||||
|
PageData<EnterpriseReportDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<EnterpriseReportDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-08-02 |
||||
|
*/ |
||||
|
List<EnterpriseReportDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return EnterpriseReportDTO |
||||
|
* @author generator |
||||
|
* @date 2021-08-02 |
||||
|
*/ |
||||
|
EnterpriseReportDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-08-02 |
||||
|
*/ |
||||
|
void save(EnterpriseReportDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-08-02 |
||||
|
*/ |
||||
|
void update(EnterpriseReportDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-08-02 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
/** |
||||
|
* @Description 小程序获取企业上报列表 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2021/8/2 |
||||
|
* @Param [] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.EnterpriseReportDTO> |
||||
|
**/ |
||||
|
Result<List<EnterpriseReportDTO>> getEnterpriseReportList(EnterpriseReportFormDTO enterpriseReportFormDTO); |
||||
|
/** |
||||
|
* @Description 新增企业上报 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2021/8/2 |
||||
|
* @Param [enterpriseReportAddFormDTO] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
**/ |
||||
|
Result addEnterpriseReport(EnterpriseReportAddFormDTO enterpriseReportAddFormDTO); |
||||
|
/** |
||||
|
* @Description 小程序获取企业上报详情 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2021/8/4 |
||||
|
* @Param [id] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.EnterpriseReportDTO> |
||||
|
**/ |
||||
|
Result<EnterpriseReportDTO> getEnterpriseReportDetail(String id); |
||||
|
} |
@ -0,0 +1,232 @@ |
|||||
|
/** |
||||
|
* 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.enterprisereport.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.FieldConstant; |
||||
|
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.security.content.dto.form.ParentAndAllDeptDTO; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.EnterpriseReportDTO; |
||||
|
import com.elink.esua.epdc.dto.SysSimpleDictDTO; |
||||
|
import com.elink.esua.epdc.dto.form.EnterpriseReportAddFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.EnterpriseReportFormDTO; |
||||
|
import com.elink.esua.epdc.modules.enterprisereport.dao.EnterpriseReportDao; |
||||
|
import com.elink.esua.epdc.modules.enterprisereport.entity.EnterpriseReportEntity; |
||||
|
import com.elink.esua.epdc.modules.enterprisereport.service.EnterpriseReportService; |
||||
|
import com.elink.esua.epdc.modules.feign.AdminFeignClient; |
||||
|
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-08-02 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class EnterpriseReportServiceImpl extends BaseServiceImpl<EnterpriseReportDao, EnterpriseReportEntity> implements EnterpriseReportService { |
||||
|
|
||||
|
@Autowired |
||||
|
private AdminFeignClient adminFeignClient; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<EnterpriseReportDTO> page(Map<String, Object> params) { |
||||
|
IPage<EnterpriseReportEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, EnterpriseReportDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<EnterpriseReportDTO> list(Map<String, Object> params) { |
||||
|
List<EnterpriseReportEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, EnterpriseReportDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<EnterpriseReportEntity> getWrapper(Map<String, Object> params){ |
||||
|
String gridId = (String)params.get("gridId"); |
||||
|
String communityId = (String)params.get("communityId"); |
||||
|
String streetId = (String)params.get("streetId"); |
||||
|
String year = (String)params.get("year"); |
||||
|
String quarter = (String)params.get("quarter"); |
||||
|
String enterpriseName = (String)params.get("enterpriseName"); |
||||
|
String legalPerson = (String)params.get("legalPerson"); |
||||
|
String concat = (String)params.get("concat"); |
||||
|
String enterpriseStatus = (String)params.get("enterpriseStatus"); |
||||
|
|
||||
|
QueryWrapper<EnterpriseReportEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.apply(StringUtils.isNotBlank(gridId),"FIND_IN_SET ("+gridId+",ALL_DEPT_IDS)"); |
||||
|
wrapper.apply(StringUtils.isNotBlank(communityId),"FIND_IN_SET ("+communityId+",ALL_DEPT_IDS)"); |
||||
|
wrapper.apply(StringUtils.isNotBlank(streetId),"FIND_IN_SET ("+streetId+",ALL_DEPT_IDS)"); |
||||
|
wrapper.eq(StringUtils.isNotBlank(year), "YEAR", year); |
||||
|
wrapper.eq(StringUtils.isNotBlank(quarter), "QUARTER", quarter); |
||||
|
wrapper.like(StringUtils.isNotBlank(enterpriseName), "ENTERPRISE_NAME", enterpriseName); |
||||
|
wrapper.like(StringUtils.isNotBlank(legalPerson), "LEGAL_PERSON", legalPerson); |
||||
|
wrapper.like(StringUtils.isNotBlank(concat), "CONCAT", concat); |
||||
|
wrapper.eq(StringUtils.isNotBlank(enterpriseStatus), "ENTERPRISE_STATUS", enterpriseStatus); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public EnterpriseReportDTO get(String id) { |
||||
|
EnterpriseReportEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, EnterpriseReportDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(EnterpriseReportDTO dto) { |
||||
|
EnterpriseReportEntity entity = ConvertUtils.sourceToTarget(dto, EnterpriseReportEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(EnterpriseReportDTO dto) { |
||||
|
EnterpriseReportEntity entity = ConvertUtils.sourceToTarget(dto, EnterpriseReportEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<List<EnterpriseReportDTO>> getEnterpriseReportList(EnterpriseReportFormDTO formDTO) { |
||||
|
int pageIndex = (formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize(); |
||||
|
formDTO.setPageIndex(pageIndex); |
||||
|
List<EnterpriseReportDTO> list = this.baseDao.getEnterpriseReportList(formDTO); |
||||
|
//处理字典信息
|
||||
|
formatList(list); |
||||
|
return new Result().ok(list); |
||||
|
} |
||||
|
|
||||
|
private void formatList(List<EnterpriseReportDTO> list) { |
||||
|
Result<List<SysSimpleDictDTO>> enterpriseStatusRes = adminFeignClient.getListSimpleByDictType("enterprise_status"); |
||||
|
if(enterpriseStatusRes.success()){ |
||||
|
List<SysSimpleDictDTO> dict = enterpriseStatusRes.getData(); |
||||
|
for (SysSimpleDictDTO sysSimpleDictDTO : dict) { |
||||
|
for (EnterpriseReportDTO enterpriseReportDTO : list) { |
||||
|
if(enterpriseReportDTO.getEnterpriseStatus().equals(sysSimpleDictDTO.getDictValue())){ |
||||
|
enterpriseReportDTO.setEnterpriseStatus(sysSimpleDictDTO.getDictName()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
Result<List<SysSimpleDictDTO>> enterpriseQuarterRes = adminFeignClient.getListSimpleByDictType("enterprise_quarter"); |
||||
|
if(enterpriseQuarterRes.success()){ |
||||
|
List<SysSimpleDictDTO> dict = enterpriseQuarterRes.getData(); |
||||
|
for (SysSimpleDictDTO sysSimpleDictDTO : dict) { |
||||
|
for (EnterpriseReportDTO enterpriseReportDTO : list) { |
||||
|
if(enterpriseReportDTO.getQuarter().equals(sysSimpleDictDTO.getDictValue())){ |
||||
|
enterpriseReportDTO.setQuarter(sysSimpleDictDTO.getDictName()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result addEnterpriseReport(EnterpriseReportAddFormDTO enterpriseReportAddFormDTO) { |
||||
|
|
||||
|
EnterpriseReportEntity enterpriseReportEntity = new EnterpriseReportEntity(); |
||||
|
enterpriseReportEntity.setDept(enterpriseReportAddFormDTO.getDept()); |
||||
|
enterpriseReportEntity.setDeptId(enterpriseReportAddFormDTO.getDeptId()); |
||||
|
enterpriseReportEntity.setMobile(enterpriseReportAddFormDTO.getMobile()); |
||||
|
enterpriseReportEntity.setRealName(enterpriseReportAddFormDTO.getRealName()); |
||||
|
enterpriseReportEntity.setFaceImg(enterpriseReportAddFormDTO.getFaceImg()); |
||||
|
enterpriseReportEntity.setUserId(enterpriseReportAddFormDTO.getUserId()); |
||||
|
enterpriseReportEntity.setYear(enterpriseReportAddFormDTO.getYear()); |
||||
|
enterpriseReportEntity.setQuarter(enterpriseReportAddFormDTO.getQuarter()); |
||||
|
enterpriseReportEntity.setEnterpriseName(enterpriseReportAddFormDTO.getEnterpriseName()); |
||||
|
enterpriseReportEntity.setLegalPerson(enterpriseReportAddFormDTO.getLegalPerson()); |
||||
|
enterpriseReportEntity.setConcat(enterpriseReportAddFormDTO.getConcat()); |
||||
|
enterpriseReportEntity.setEnterpriseStatus(enterpriseReportAddFormDTO.getEnterpriseStatus()); |
||||
|
enterpriseReportEntity.setEnterpriseIncome(enterpriseReportAddFormDTO.getEnterpriseIncome()); |
||||
|
enterpriseReportEntity.setEnterprisePeopleNum(enterpriseReportAddFormDTO.getEnterprisePeopleNum()); |
||||
|
enterpriseReportEntity.setQuestion(enterpriseReportAddFormDTO.getQuestion()); |
||||
|
//获取部门信息
|
||||
|
Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(Long.parseLong(enterpriseReportAddFormDTO.getGridId())); |
||||
|
if(!parentAndAllDept.success()){ |
||||
|
return new Result().error("获取部门信息失败"); |
||||
|
} |
||||
|
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); |
||||
|
enterpriseReportEntity.setGrid(parentAndAllDeptDTO.getGrid()); |
||||
|
enterpriseReportEntity.setGridId(parentAndAllDeptDTO.getGridId()); |
||||
|
enterpriseReportEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); |
||||
|
enterpriseReportEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); |
||||
|
enterpriseReportEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); |
||||
|
enterpriseReportEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); |
||||
|
//校验唯一性
|
||||
|
QueryWrapper<EnterpriseReportEntity> entityQueryWrapper =new QueryWrapper<>(); |
||||
|
entityQueryWrapper.eq("YEAR",enterpriseReportAddFormDTO.getYear()); |
||||
|
entityQueryWrapper.eq("QUARTER",enterpriseReportAddFormDTO.getQuarter()); |
||||
|
entityQueryWrapper.eq("ENTERPRISE_NAME",enterpriseReportAddFormDTO.getEnterpriseName()); |
||||
|
List<EnterpriseReportEntity> enterpriseReportEntities = baseDao.selectList(entityQueryWrapper); |
||||
|
if(enterpriseReportEntities.size()>1){ |
||||
|
enterpriseReportEntity.setId(enterpriseReportEntities.get(0).getId()); |
||||
|
baseDao.updateById(enterpriseReportEntity); |
||||
|
return new Result(); |
||||
|
} |
||||
|
insert(enterpriseReportEntity); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<EnterpriseReportDTO> getEnterpriseReportDetail(String id) { |
||||
|
EnterpriseReportDTO enterpriseReportDTO = get(id); |
||||
|
Result<List<SysSimpleDictDTO>> enterpriseStatusRes = adminFeignClient.getListSimpleByDictType("enterprise_status"); |
||||
|
if(enterpriseStatusRes.success()){ |
||||
|
List<SysSimpleDictDTO> dict = enterpriseStatusRes.getData(); |
||||
|
for (SysSimpleDictDTO sysSimpleDictDTO : dict) { |
||||
|
if(enterpriseReportDTO.getEnterpriseStatus().equals(sysSimpleDictDTO.getDictValue())){ |
||||
|
enterpriseReportDTO.setEnterpriseStatus(sysSimpleDictDTO.getDictName()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
Result<List<SysSimpleDictDTO>> enterpriseQuarterRes = adminFeignClient.getListSimpleByDictType("enterprise_quarter"); |
||||
|
if(enterpriseQuarterRes.success()){ |
||||
|
List<SysSimpleDictDTO> dict = enterpriseQuarterRes.getData(); |
||||
|
for (SysSimpleDictDTO sysSimpleDictDTO : dict) { |
||||
|
if(enterpriseReportDTO.getQuarter().equals(sysSimpleDictDTO.getDictValue())){ |
||||
|
enterpriseReportDTO.setQuarter(sysSimpleDictDTO.getDictName()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return new Result<EnterpriseReportDTO>().ok(enterpriseReportDTO); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,64 @@ |
|||||
|
<?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.enterprisereport.dao.EnterpriseReportDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.modules.enterprisereport.entity.EnterpriseReportEntity" id="enterpriseReportMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="grid" column="GRID"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="dept" column="DEPT"/> |
||||
|
<result property="deptId" column="DEPT_ID"/> |
||||
|
<result property="userId" column="USER_ID"/> |
||||
|
<result property="mobile" column="MOBILE"/> |
||||
|
<result property="faceImg" column="FACE_IMG"/> |
||||
|
<result property="realName" column="REAL_NAME"/> |
||||
|
<result property="year" column="YEAR"/> |
||||
|
<result property="quarter" column="QUARTER"/> |
||||
|
<result property="enterpriseName" column="ENTERPRISE_NAME"/> |
||||
|
<result property="legalPerson" column="LEGAL_PERSON"/> |
||||
|
<result property="concat" column="CONCAT"/> |
||||
|
<result property="enterpriseStatus" column="ENTERPRISE_STATUS"/> |
||||
|
<result property="enterpriseIncome" column="ENTERPRISE_INCOME"/> |
||||
|
<result property="enterprisePeopleNum" column="ENTERPRISE_PEOPLE_NUM"/> |
||||
|
<result property="question" column="QUESTION"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/> |
||||
|
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/> |
||||
|
<result property="allDeptIds" column="ALL_DEPT_IDS"/> |
||||
|
<result property="allDeptNames" column="ALL_DEPT_NAMES"/> |
||||
|
</resultMap> |
||||
|
<select id="getEnterpriseReportList" resultType="com.elink.esua.epdc.dto.EnterpriseReportDTO"> |
||||
|
select |
||||
|
ID, |
||||
|
GRID, |
||||
|
GRID_ID, |
||||
|
DEPT, |
||||
|
DEPT_ID, |
||||
|
USER_ID, |
||||
|
MOBILE, |
||||
|
FACE_IMG, |
||||
|
REAL_NAME, |
||||
|
YEAR, |
||||
|
QUARTER, |
||||
|
ENTERPRISE_NAME, |
||||
|
LEGAL_PERSON, |
||||
|
CONCAT, |
||||
|
ENTERPRISE_STATUS, |
||||
|
ENTERPRISE_INCOME, |
||||
|
ENTERPRISE_PEOPLE_NUM, |
||||
|
CREATED_TIME |
||||
|
from epdc_enterprise_report |
||||
|
where DEL_FLAG = '0' and USER_ID = #{userId} |
||||
|
order by CREATED_TIME desc |
||||
|
LIMIT #{pageIndex},#{pageSize} |
||||
|
|
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue