Browse Source

权重配置

master
sunyuchao 3 years ago
parent
commit
17af4ef407
  1. 106
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyWeightConfigurationDTO.java
  2. 58
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationFormDTO.java
  3. 31
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationListFormDTO.java
  4. 41
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/WeightConfigurationListResultDTO.java
  5. 70
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyWeightConfigurationController.java
  6. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.java
  7. 74
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyWeightConfigurationEntity.java
  8. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyWeightConfigurationService.java
  9. 74
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyWeightConfigurationServiceImpl.java
  10. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.xml

106
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyWeightConfigurationDTO.java

@ -0,0 +1,106 @@
/**
* 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 ScreenPyWeightConfigurationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 网格活跃度
*/
private BigDecimal wghyd;
/**
* 事件赋分
*/
private BigDecimal sjff;
/**
* 雪亮工程
*/
private BigDecimal xlgc;
/**
* 日核周调
*/
private BigDecimal rhzt;
/**
* 亮点工作
*/
private BigDecimal ldgz;
/**
* 其他工作
*/
private BigDecimal qtgz;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

58
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationFormDTO.java

@ -0,0 +1,58 @@
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;
@Data
public class WeightConfigurationFormDTO 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;
/**
* 网格活跃度
*/
private BigDecimal wghyd;
/**
* 事件赋分
*/
private BigDecimal sjff;
/**
* 雪亮工程
*/
private BigDecimal xlgc;
/**
* 日核周调
*/
private BigDecimal rhzt;
/**
* 亮点工作
*/
private BigDecimal ldgz;
/**
* 其他工作
*/
private BigDecimal qtgz;
private String customerId;
private String userId;
}

31
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationListFormDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.indexcollect.form;
import lombok.Data;
import java.io.Serializable;
@Data
public class WeightConfigurationListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当前页
*/
private Integer pageNo = 1;
/**
* 每页记录数
*/
private Integer pageSize = 20;
/**
* 是否分页true分 false不分
*/
private Boolean isPage;
private String customerId;
private String userId;
}

41
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/WeightConfigurationListResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.indexcollect.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class WeightConfigurationListResultDTO implements Serializable {
private static final long serialVersionUID = -4316054054019675419L;
/**
* id
*/
private String id;
/**
* 网格活跃度
*/
private BigDecimal wghyd;
/**
* 事件赋分
*/
private BigDecimal sjff;
/**
* 雪亮工程
*/
private BigDecimal xlgc;
/**
* 日核周调
*/
private BigDecimal rhzt;
/**
* 亮点工作
*/
private BigDecimal ldgz;
/**
* 其他工作
*/
private BigDecimal qtgz;
}

70
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyWeightConfigurationController.java

@ -0,0 +1,70 @@
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.WeightConfigurationFormDTO;
import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO;
import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO;
import com.epmet.service.evaluationindex.indexcoll.ScreenPyWeightConfigurationService;
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("screenPyWeightConfiguration")
public class ScreenPyWeightConfigurationController {
@Autowired
private ScreenPyWeightConfigurationService screenPyWeightConfigurationService;
@RequestMapping("list")
public Result<PageData<WeightConfigurationListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationListFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<PageData<WeightConfigurationListResultDTO>>().ok(screenPyWeightConfigurationService.list(formDTO));
}
@NoRepeatSubmit
@PostMapping("add")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationFormDTO dto) {
ValidatorUtils.validateEntity(dto, WeightConfigurationFormDTO.Add.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserId(tokenDto.getUserId());
screenPyWeightConfigurationService.save(dto);
return new Result();
}
@PostMapping("edit")
public Result update(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationFormDTO dto) {
ValidatorUtils.validateEntity(dto, WeightConfigurationFormDTO.Edit.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserId(tokenDto.getUserId());
screenPyWeightConfigurationService.update(dto);
return new Result();
}
@PostMapping("deleteById")
public Result deleteById(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationFormDTO dto) {
ValidatorUtils.validateEntity(dto, WeightConfigurationFormDTO.Edit.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserId(tokenDto.getUserId());
screenPyWeightConfigurationService.deleteById(dto);
return new Result();
}
}

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.java

@ -0,0 +1,40 @@
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.form.WeightConfigurationListFormDTO;
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO;
import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO;
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity;
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyWeightConfigurationEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 平阴政法能力权重配置
*
* @author generator generator@elink-cn.com
*/
@Mapper
public interface ScreenPyWeightConfigurationDao extends BaseDao<ScreenPyWeightConfigurationEntity> {
List<WeightConfigurationListResultDTO> selectWeightConfigurationList(WeightConfigurationListFormDTO formDTO);
}

74
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyWeightConfigurationEntity.java

@ -0,0 +1,74 @@
/**
* 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_weight_configuration")
public class ScreenPyWeightConfigurationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格活跃度
*/
private BigDecimal wghyd;
/**
* 事件赋分
*/
private BigDecimal sjff;
/**
* 雪亮工程
*/
private BigDecimal xlgc;
/**
* 日核周调
*/
private BigDecimal rhzt;
/**
* 亮点工作
*/
private BigDecimal ldgz;
/**
* 其他工作
*/
private BigDecimal qtgz;
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyWeightConfigurationService.java

@ -0,0 +1,23 @@
package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO;
import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO;
import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO;
/**
* 平阴政法能力权重配置
*
* @author generator generator@elink-cn.com
*/
public interface ScreenPyWeightConfigurationService {
PageData<WeightConfigurationListResultDTO> list(WeightConfigurationListFormDTO formDTO);
void save(WeightConfigurationFormDTO dto);
void update(WeightConfigurationFormDTO dto);
void deleteById(WeightConfigurationFormDTO dto);
}

74
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyWeightConfigurationServiceImpl.java

@ -0,0 +1,74 @@
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.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.ScreenPyWeightConfigurationDao;
import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO;
import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO;
import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO;
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyWeightConfigurationEntity;
import com.epmet.service.evaluationindex.indexcoll.ScreenPyWeightConfigurationService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 平阴政法能力权重配置
*
* @author generator generator@elink-cn.com
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX_READ)
public class ScreenPyWeightConfigurationServiceImpl extends BaseServiceImpl<ScreenPyWeightConfigurationDao, ScreenPyWeightConfigurationEntity> implements ScreenPyWeightConfigurationService {
@Override
public PageData<WeightConfigurationListResultDTO> list(WeightConfigurationListFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<WeightConfigurationListResultDTO> list = baseDao.selectWeightConfigurationList(formDTO);
PageInfo<WeightConfigurationListResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(WeightConfigurationFormDTO formDTO) {
//1.主表新增数据
ScreenPyWeightConfigurationEntity entity = ConvertUtils.sourceToTarget(formDTO, ScreenPyWeightConfigurationEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(WeightConfigurationFormDTO formDTO) {
ScreenPyWeightConfigurationEntity entity = baseDao.selectById(formDTO.getId());
if (entity == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息");
}
ScreenPyWeightConfigurationEntity newEntity = ConvertUtils.sourceToTarget(formDTO, ScreenPyWeightConfigurationEntity.class);
newEntity.setId(entity.getId());
baseDao.updateById(newEntity);
}
@Override
public void deleteById(WeightConfigurationFormDTO formDTO) {
ScreenPyWeightConfigurationEntity entity = baseDao.selectById(formDTO.getId());
if (entity == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息");
}
entity.setDelFlag("1");
baseDao.updateById(entity);
}
}

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.xml

@ -0,0 +1,24 @@
<?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.ScreenPyWeightConfigurationDao">
<select id="selectWeightConfigurationList" resultType="com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO">
SELECT
ID,
CUSTOMER_ID,
wghyd,
sjff,
xlgc,
rhzt,
ldgz,
qtgz
FROM
screen_py_weight_configuration
WHERE
DEL_FLAG = '0'
ORDER BY
UPDATED_TIME DESC
</select>
</mapper>
Loading…
Cancel
Save