10 changed files with 835 additions and 0 deletions
@ -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.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 街道或区直绩效考核最终得分 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-23 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class KpiResultSuperiorDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 最终得分 |
||||
|
*/ |
||||
|
private BigDecimal finalScore; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期开始日 |
||||
|
*/ |
||||
|
private Date startDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期结束日 |
||||
|
*/ |
||||
|
private Date endDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期(字典值 代表月,季,年) |
||||
|
*/ |
||||
|
private String kpiCycle; |
||||
|
|
||||
|
/** |
||||
|
* 机构类别 |
||||
|
*/ |
||||
|
private String deptTypeKey; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级机构id |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级机构名称 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 所有机构id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有机构名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
} |
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* 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.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.KpiResultSuperiorDTO; |
||||
|
import com.elink.esua.epdc.excel.KpiResultSuperiorExcel; |
||||
|
import com.elink.esua.epdc.service.KpiResultSuperiorService; |
||||
|
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 2019-12-23 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("kpiresultsuperior") |
||||
|
public class KpiResultSuperiorController { |
||||
|
|
||||
|
@Autowired |
||||
|
private KpiResultSuperiorService kpiResultSuperiorService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<KpiResultSuperiorDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<KpiResultSuperiorDTO> page = kpiResultSuperiorService.page(params); |
||||
|
return new Result<PageData<KpiResultSuperiorDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<KpiResultSuperiorDTO> get(@PathVariable("id") String id){ |
||||
|
KpiResultSuperiorDTO data = kpiResultSuperiorService.get(id); |
||||
|
return new Result<KpiResultSuperiorDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody KpiResultSuperiorDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
kpiResultSuperiorService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody KpiResultSuperiorDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
kpiResultSuperiorService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
kpiResultSuperiorService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<KpiResultSuperiorDTO> list = kpiResultSuperiorService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, KpiResultSuperiorExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* 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.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.entity.KpiResultSuperiorEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 街道或区直绩效考核最终得分 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-23 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface KpiResultSuperiorDao extends BaseDao<KpiResultSuperiorEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,92 @@ |
|||||
|
/** |
||||
|
* 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.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; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 街道或区直绩效考核最终得分 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-23 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_kpi_result_superior") |
||||
|
public class KpiResultSuperiorEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 最终得分 |
||||
|
*/ |
||||
|
private BigDecimal finalScore; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期开始日 |
||||
|
*/ |
||||
|
private Date startDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期结束日 |
||||
|
*/ |
||||
|
private Date endDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期(字典值 代表月,季,年) |
||||
|
*/ |
||||
|
private String kpiCycle; |
||||
|
|
||||
|
/** |
||||
|
* 机构类别 |
||||
|
*/ |
||||
|
private String deptTypeKey; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级机构id |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级机构名称 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 所有机构id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有机构名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
/** |
||||
|
* 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.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 2019-12-23 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class KpiResultSuperiorExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "网格ID") |
||||
|
private Long deptId; |
||||
|
|
||||
|
@Excel(name = "最终得分") |
||||
|
private BigDecimal finalScore; |
||||
|
|
||||
|
@Excel(name = "考核周期开始日") |
||||
|
private Date startDate; |
||||
|
|
||||
|
@Excel(name = "考核周期结束日") |
||||
|
private Date endDate; |
||||
|
|
||||
|
@Excel(name = "考核周期(字典值 代表月,季,年)") |
||||
|
private String kpiCycle; |
||||
|
|
||||
|
@Excel(name = "机构类别") |
||||
|
private String deptTypeKey; |
||||
|
|
||||
|
@Excel(name = "所有上级机构id") |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
@Excel(name = "所有上级机构名称") |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
@Excel(name = "所有机构id") |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
@Excel(name = "所有机构名称") |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
@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 delFlag; |
||||
|
|
||||
|
|
||||
|
} |
@ -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.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 2019-12-23 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class KpiResultSuperiorRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,95 @@ |
|||||
|
/** |
||||
|
* 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.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.KpiResultSuperiorDTO; |
||||
|
import com.elink.esua.epdc.entity.KpiResultSuperiorEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 街道或区直绩效考核最终得分 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-23 |
||||
|
*/ |
||||
|
public interface KpiResultSuperiorService extends BaseService<KpiResultSuperiorEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<KpiResultSuperiorDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-12-23 |
||||
|
*/ |
||||
|
PageData<KpiResultSuperiorDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<KpiResultSuperiorDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-12-23 |
||||
|
*/ |
||||
|
List<KpiResultSuperiorDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return KpiResultSuperiorDTO |
||||
|
* @author generator |
||||
|
* @date 2019-12-23 |
||||
|
*/ |
||||
|
KpiResultSuperiorDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-12-23 |
||||
|
*/ |
||||
|
void save(KpiResultSuperiorDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-12-23 |
||||
|
*/ |
||||
|
void update(KpiResultSuperiorDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-12-23 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* 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.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.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.dao.KpiResultSuperiorDao; |
||||
|
import com.elink.esua.epdc.dto.KpiResultSuperiorDTO; |
||||
|
import com.elink.esua.epdc.entity.KpiResultSuperiorEntity; |
||||
|
import com.elink.esua.epdc.redis.KpiResultSuperiorRedis; |
||||
|
import com.elink.esua.epdc.service.KpiResultSuperiorService; |
||||
|
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 2019-12-23 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class KpiResultSuperiorServiceImpl extends BaseServiceImpl<KpiResultSuperiorDao, KpiResultSuperiorEntity> implements KpiResultSuperiorService { |
||||
|
|
||||
|
@Autowired |
||||
|
private KpiResultSuperiorRedis kpiResultSuperiorRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<KpiResultSuperiorDTO> page(Map<String, Object> params) { |
||||
|
IPage<KpiResultSuperiorEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, KpiResultSuperiorDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<KpiResultSuperiorDTO> list(Map<String, Object> params) { |
||||
|
List<KpiResultSuperiorEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, KpiResultSuperiorDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<KpiResultSuperiorEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<KpiResultSuperiorEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public KpiResultSuperiorDTO get(String id) { |
||||
|
KpiResultSuperiorEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, KpiResultSuperiorDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(KpiResultSuperiorDTO dto) { |
||||
|
KpiResultSuperiorEntity entity = ConvertUtils.sourceToTarget(dto, KpiResultSuperiorEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(KpiResultSuperiorDTO dto) { |
||||
|
KpiResultSuperiorEntity entity = ConvertUtils.sourceToTarget(dto, KpiResultSuperiorEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
<?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.dao.KpiResultSuperiorDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.entity.KpiResultSuperiorEntity" id="kpiResultSuperiorMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="deptId" column="dept_id"/> |
||||
|
<result property="finalScore" column="final_score"/> |
||||
|
<result property="startDate" column="start_date"/> |
||||
|
<result property="endDate" column="end_date"/> |
||||
|
<result property="kpiCycle" column="kpi_cycle"/> |
||||
|
<result property="deptTypeKey" column="dept_type_key"/> |
||||
|
<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"/> |
||||
|
<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="delFlag" column="DEL_FLAG"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue