forked from rongchao/epmet-cloud-rizhao
19 changed files with 1180 additions and 0 deletions
@ -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.epmet.dto.indexcollect; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
public class ScreenPyHistoryScoreDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 删除标识 0未删除;1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,126 @@ |
|||
/** |
|||
* 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.epmet.dto.indexcollect; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
public class ScreenPyHistoryScoreDetailDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* screen_py_history_score.id |
|||
*/ |
|||
private String historyScoreId; |
|||
|
|||
/** |
|||
* 街道组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 街道名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
/** |
|||
* 能力得分 |
|||
*/ |
|||
private BigDecimal nldf; |
|||
|
|||
/** |
|||
* 删除标识 0未删除;1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.epmet.dto.indexcollect.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class HistoryScoreComputeFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public interface Compute extends CustomerClientShowGroup {} |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
@NotBlank(message = "组织Id不能为空", groups = Compute.class) |
|||
private String agencyId; |
|||
/** |
|||
* 计算类型 grid:网格活跃度 event:事件赋分 |
|||
*/ |
|||
@NotBlank(message = "计算类型不能为空", groups = Compute.class) |
|||
private String type; |
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
private Date startTime; |
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private Date endTime; |
|||
|
|||
private String customerId; |
|||
private String userId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.epmet.dto.indexcollect.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class HistoryScoreFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public interface Add extends CustomerClientShowGroup {} |
|||
public interface Edit extends CustomerClientShowGroup {} |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotBlank(message = "标题不能为空", groups = Edit.class) |
|||
private String id; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
@NotBlank(message = "标题不能为空", groups = Add.class) |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private List<Detail> detailList; |
|||
|
|||
private String customerId; |
|||
private String userId; |
|||
|
|||
|
|||
@Data |
|||
public static class Detail implements Serializable { |
|||
/** |
|||
* 街道组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 街道名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
/** |
|||
* 能力得分 |
|||
*/ |
|||
private BigDecimal nldf; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
package com.epmet.dto.indexcollect.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class HistoryScoreListFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 当前页 |
|||
*/ |
|||
private Integer pageNo = 1; |
|||
|
|||
/** |
|||
* 每页记录数 |
|||
*/ |
|||
private Integer pageSize = 20; |
|||
|
|||
/** |
|||
* 是否分页【true分 false不分】 |
|||
*/ |
|||
private Boolean isPage; |
|||
|
|||
private String customerId; |
|||
private String userId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.dto.indexcollect.result; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
@Data |
|||
public class HistoryScoreComputeResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 分数 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
} |
@ -0,0 +1,103 @@ |
|||
package com.epmet.dto.indexcollect.result; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class HistoryScoreDetailResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public interface Add extends CustomerClientShowGroup {} |
|||
public interface Edit extends CustomerClientShowGroup {} |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private List<Detail> detailList; |
|||
|
|||
@Data |
|||
public static class Detail implements Serializable { |
|||
/** |
|||
* 街道组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 街道名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
/** |
|||
* 能力得分 |
|||
*/ |
|||
private BigDecimal nldf; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.dto.indexcollect.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class HistoryScoreListResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4316054054019675419L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
/** |
|||
* 时间区间 |
|||
*/ |
|||
private String time; |
|||
/** |
|||
* 发布者 |
|||
*/ |
|||
private String createdBy; |
|||
private String createdById; |
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private String releaseTime; |
|||
|
|||
} |
@ -0,0 +1,123 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("screenPyHistoryScore") |
|||
public class ScreenPyHistoryScoreController { |
|||
|
|||
@Autowired |
|||
private ScreenPyHistoryScoreService screenPyHistoryScoreService; |
|||
|
|||
|
|||
@RequestMapping("list") |
|||
public Result<PageData<HistoryScoreListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreListFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setUserId(tokenDto.getUserId()); |
|||
return new Result<PageData<HistoryScoreListResultDTO>>().ok(screenPyHistoryScoreService.list(formDTO)); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("add") |
|||
public Result save(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, HistoryScoreFormDTO.Add.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
screenPyHistoryScoreService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("edit") |
|||
public Result update(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, HistoryScoreFormDTO.Edit.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
screenPyHistoryScoreService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("deleteById") |
|||
public Result deleteById(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, HistoryScoreFormDTO.Edit.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
screenPyHistoryScoreService.deleteById(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@RequestMapping("detail") |
|||
public Result<HistoryScoreDetailResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, HistoryScoreFormDTO.Edit.class); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
return new Result<HistoryScoreDetailResultDTO>().ok(screenPyHistoryScoreService.detail(formDTO)); |
|||
} |
|||
|
|||
/*@PostMapping("export") |
|||
public void export(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreListFormDTO formDTO, HttpServletResponse response) throws IOException { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setUserId(tokenDto.getUserId()); |
|||
formDTO.setIsPage(false); |
|||
ExcelWriter excelWriter = null; |
|||
formDTO.setPageNo(NumConstant.ONE); |
|||
formDTO.setPageSize(NumConstant.TEN_THOUSAND); |
|||
try { |
|||
String fileName = "迁入管理" + DateUtils.format(new Date()) + ".xlsx"; |
|||
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcMoveInRecordExcel.class).build(); |
|||
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); |
|||
PageData<IcMoveInListResultDTO> data = null; |
|||
List<IcMoveInRecordExcel> list = null; |
|||
do { |
|||
data = screenPyHistoryScoreService.list(formDTO); |
|||
list = ConvertUtils.sourceToTarget(data.getList(), IcMoveInRecordExcel.class); |
|||
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); |
|||
excelWriter.write(list, writeSheet); |
|||
} while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); |
|||
} catch (EpmetException e) { |
|||
response.reset(); |
|||
response.setCharacterEncoding("UTF-8"); |
|||
response.setHeader("content-type", "application/json; charset=UTF-8"); |
|||
PrintWriter printWriter = response.getWriter(); |
|||
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); |
|||
printWriter.write(JSON.toJSONString(result)); |
|||
printWriter.close(); |
|||
} catch (Exception e) { |
|||
log.error("export exception", e); |
|||
} finally { |
|||
if (excelWriter != null) { |
|||
excelWriter.finish(); |
|||
} |
|||
} |
|||
}*/ |
|||
|
|||
@RequestMapping("computescore") |
|||
public Result<HistoryScoreComputeResultDTO> computeScore(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreComputeFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, HistoryScoreComputeFormDTO.Compute.class); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
return new Result<HistoryScoreComputeResultDTO>().ok(screenPyHistoryScoreService.computeScore(formDTO)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.dao.evaluationindex.indexcoll; /** |
|||
* 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/>.
|
|||
*/ |
|||
|
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenPyHistoryScoreDao extends BaseDao<ScreenPyHistoryScoreEntity> { |
|||
|
|||
List<HistoryScoreListResultDTO> selectHistoryScoreList(HistoryScoreListFormDTO formDTO); |
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.dao.evaluationindex.indexcoll; /** |
|||
* 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/>.
|
|||
*/ |
|||
|
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenPyHistoryScoreDetailDao extends BaseDao<ScreenPyHistoryScoreDetailEntity> { |
|||
|
|||
void delByHistoryScoreId(@Param("historyScoreId") String historyScoreId, @Param("userId") String userId); |
|||
|
|||
} |
@ -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.epmet.entity.evaluationindex.indexcoll; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("screen_py_history_score_detail") |
|||
public class ScreenPyHistoryScoreDetailEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* screen_py_history_score.id |
|||
*/ |
|||
private String historyScoreId; |
|||
|
|||
/** |
|||
* 街道组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 街道名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
/** |
|||
* 能力得分 |
|||
*/ |
|||
private BigDecimal nldf; |
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
/** |
|||
* 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.epmet.entity.evaluationindex.indexcoll; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("screen_py_history_score") |
|||
public class ScreenPyHistoryScoreEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
} |
@ -0,0 +1,10 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
public interface ScreenPyHistoryScoreDetailService { |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll; |
|||
|
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.dto.result.IcMoveInListResultDTO; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
public interface ScreenPyHistoryScoreService { |
|||
|
|||
PageData<HistoryScoreListResultDTO> list(HistoryScoreListFormDTO formDTO); |
|||
|
|||
void save(HistoryScoreFormDTO dto); |
|||
|
|||
void update(HistoryScoreFormDTO dto); |
|||
|
|||
void deleteById(HistoryScoreFormDTO dto); |
|||
|
|||
HistoryScoreDetailResultDTO detail(HistoryScoreFormDTO formDTO); |
|||
|
|||
HistoryScoreComputeResultDTO computeScore(HistoryScoreComputeFormDTO formDTO); |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX_READ) |
|||
public class ScreenPyHistoryScoreDetailServiceImpl extends BaseServiceImpl<ScreenPyHistoryScoreDetailDao, ScreenPyHistoryScoreDetailEntity> implements ScreenPyHistoryScoreDetailService { |
|||
|
|||
@Autowired |
|||
private ScreenPyHistoryScoreDetailDao screenPyHistoryScoreDetailDao; |
|||
|
|||
|
|||
} |
@ -0,0 +1,143 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDao; |
|||
import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao; |
|||
import com.epmet.dto.indexcollect.ScreenPyHistoryScoreDetailDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.dto.result.IcMoveInListResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX_READ) |
|||
public class ScreenPyHistoryScoreServiceImpl implements ScreenPyHistoryScoreService { |
|||
|
|||
@Autowired |
|||
private ScreenPyHistoryScoreDao screenPyHistoryScoreDao; |
|||
@Autowired |
|||
private ScreenPyHistoryScoreDetailServiceImpl screenPyHistoryScoreDetailServiceImpl; |
|||
@Autowired |
|||
private ScreenPyHistoryScoreDetailDao screenPyHistoryScoreDetailDao; |
|||
|
|||
|
|||
@Override |
|||
public PageData<HistoryScoreListResultDTO> list(HistoryScoreListFormDTO formDTO) { |
|||
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); |
|||
List<HistoryScoreListResultDTO> list = screenPyHistoryScoreDao.selectHistoryScoreList(formDTO); |
|||
PageInfo<HistoryScoreListResultDTO> pageInfo = new PageInfo<>(list); |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(HistoryScoreFormDTO formDTO) { |
|||
//1.主表新增数据
|
|||
ScreenPyHistoryScoreEntity entity = ConvertUtils.sourceToTarget(formDTO, ScreenPyHistoryScoreEntity.class); |
|||
screenPyHistoryScoreDao.insert(entity); |
|||
//2.明细表新增数据
|
|||
List<ScreenPyHistoryScoreDetailEntity> list = new ArrayList<>(); |
|||
formDTO.getDetailList().forEach(dto -> { |
|||
ScreenPyHistoryScoreDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, ScreenPyHistoryScoreDetailEntity.class); |
|||
detailEntity.setCustomerId(formDTO.getCustomerId()); |
|||
detailEntity.setHistoryScoreId(entity.getId()); |
|||
list.add(detailEntity); |
|||
}); |
|||
screenPyHistoryScoreDetailServiceImpl.insertBatch(list); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(HistoryScoreFormDTO formDTO) { |
|||
ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId()); |
|||
if (entity == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); |
|||
} |
|||
//1.更新主表
|
|||
ScreenPyHistoryScoreEntity newEntity = ConvertUtils.sourceToTarget(formDTO, ScreenPyHistoryScoreEntity.class); |
|||
newEntity.setId(entity.getId()); |
|||
screenPyHistoryScoreDao.updateById(newEntity); |
|||
//2.更新字表 字表先删后增
|
|||
List<ScreenPyHistoryScoreDetailEntity> list = new ArrayList<>(); |
|||
formDTO.getDetailList().forEach(dto -> { |
|||
ScreenPyHistoryScoreDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, ScreenPyHistoryScoreDetailEntity.class); |
|||
detailEntity.setCustomerId(entity.getCustomerId()); |
|||
detailEntity.setHistoryScoreId(entity.getId()); |
|||
list.add(detailEntity); |
|||
}); |
|||
screenPyHistoryScoreDetailDao.delByHistoryScoreId(formDTO.getId(), formDTO.getUserId()); |
|||
screenPyHistoryScoreDetailServiceImpl.insertBatch(list); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteById(HistoryScoreFormDTO formDTO) { |
|||
ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId()); |
|||
if (entity == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); |
|||
} |
|||
entity.setDelFlag("1"); |
|||
screenPyHistoryScoreDao.updateById(entity); |
|||
screenPyHistoryScoreDetailDao.delByHistoryScoreId(formDTO.getId(), formDTO.getUserId()); |
|||
} |
|||
|
|||
@Override |
|||
public HistoryScoreDetailResultDTO detail(HistoryScoreFormDTO formDTO) { |
|||
HistoryScoreDetailResultDTO resultDTO = new HistoryScoreDetailResultDTO(); |
|||
//1.主表数据
|
|||
ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId()); |
|||
if (entity == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); |
|||
} |
|||
resultDTO = ConvertUtils.sourceToTarget(entity, HistoryScoreDetailResultDTO.class); |
|||
//2.字表数据
|
|||
LambdaQueryWrapper<ScreenPyHistoryScoreDetailEntity> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(ScreenPyHistoryScoreDetailEntity::getHistoryScoreId, formDTO.getId()); |
|||
wrapper.eq(ScreenPyHistoryScoreDetailEntity::getDelFlag, "1"); |
|||
List<ScreenPyHistoryScoreDetailEntity> list = screenPyHistoryScoreDetailDao.selectList(wrapper); |
|||
List<HistoryScoreDetailResultDTO.Detail> detailList = ConvertUtils.sourceToTarget(list, HistoryScoreDetailResultDTO.Detail.class); |
|||
resultDTO.setDetailList(detailList); |
|||
return resultDTO; |
|||
} |
|||
|
|||
@Override |
|||
public HistoryScoreComputeResultDTO computeScore(HistoryScoreComputeFormDTO formDTO) { |
|||
HistoryScoreComputeResultDTO resultDTO = new HistoryScoreComputeResultDTO(); |
|||
if ("grid".equals(formDTO.getType())) { |
|||
//网格活跃度每周得分=(活跃网格数/本街镇网格数)x100+(正常网格数/本街镇网格数)x80
|
|||
//本街镇网格数基于本街镇基础网格总数进行计算,不包含专属网格
|
|||
|
|||
} else if ("event".equals(formDTO.getType())) { |
|||
//事件赋分每周得分=(活跃网格数/末级网格数)x100+(正常运行网格数/末级网格数)x80
|
|||
//1周内每个末级网格有五天及五天以上上传事件或开展例行工作的为活跃网格;有2天及2天以上,5天以下上传事件或开展例行工作的为正常运行网格;只有1天上传事件或开展例行工作的为僵尸网格
|
|||
} |
|||
return resultDTO; |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
<?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.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDao"> |
|||
|
|||
|
|||
<select id="selectHistoryScoreList" resultType="com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO"> |
|||
SELECT |
|||
a.id, |
|||
a.title, |
|||
CONCAT(DATE_FORMAT(a.start_time,'%Y年%m月%d日'),'-',DATE_FORMAT(a.end_time,'%Y年%m月%d日')) `time`, |
|||
DATE_FORMAT(a.release_time,'%Y-%m-%d %H:%i') releaseTime, |
|||
a.created_by createdById, |
|||
b.real_name createdBy |
|||
FROM |
|||
screen_py_history_score a |
|||
LEFT JOIN epmet_user.customer_staff b ON a.customer_id = b.customer_id AND a.created_by = b.user_id |
|||
WHERE |
|||
a.del_flag = '0' |
|||
<if test="title != null and title != ''"> |
|||
AND a.title LIKE concat('%', #{title}, '%') |
|||
</if> |
|||
<if test="startTime != null and startTime.trim() != ''"> |
|||
AND a.start_time >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime.trim() != ''"> |
|||
<![CDATA[AND a.end_time <= #{endTime}]]> |
|||
</if> |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,18 @@ |
|||
<?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.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao"> |
|||
|
|||
<update id="delByHistoryScoreId" parameterType="java.lang.String"> |
|||
UPDATE |
|||
screen_py_history_score_detail |
|||
SET |
|||
updated_by = #{userId}, |
|||
updated_time = NOW(), |
|||
del_flag = '1' |
|||
WHERE |
|||
history_score_id = #{historyScoreId} |
|||
AND del_flag = '0' |
|||
</update> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue