Browse Source

物业项目打分功能

hotfix/yujt_opt
zhangyuan 5 years ago
parent
commit
3772d3e1e0
  1. 11
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/controller/AppPropertyProjectController.java
  2. 1
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/controller/PropertyProjectScoreController.java
  3. 12
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/dao/PropertyProjectScoreDao.java
  4. 11
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/service/PropertyProjectScoreService.java
  5. 10
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/service/impl/PropertyProjectScoreServiceImpl.java
  6. 12
      epdc-cloud-property/src/main/resources/mapper/project/PropertyProjectScoreDao.xml

11
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/controller/AppPropertyProjectController.java

@ -21,8 +21,10 @@ import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.project.form.ProjectDetailFormDTO; import com.elink.esua.epdc.dto.project.form.ProjectDetailFormDTO;
import com.elink.esua.epdc.dto.project.form.ProjectListFormDTO; import com.elink.esua.epdc.dto.project.form.ProjectListFormDTO;
import com.elink.esua.epdc.dto.project.form.ProjectScoreFormDTO;
import com.elink.esua.epdc.dto.project.result.ProjectDetailResultDTO; import com.elink.esua.epdc.dto.project.result.ProjectDetailResultDTO;
import com.elink.esua.epdc.dto.project.result.ProjectListResultDTO; import com.elink.esua.epdc.dto.project.result.ProjectListResultDTO;
import com.elink.esua.epdc.modules.project.service.PropertyProjectScoreService;
import com.elink.esua.epdc.modules.project.service.PropertyProjectService; import com.elink.esua.epdc.modules.project.service.PropertyProjectService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -43,6 +45,9 @@ public class AppPropertyProjectController {
@Autowired @Autowired
private PropertyProjectService propertyProjectService; private PropertyProjectService propertyProjectService;
@Autowired
private PropertyProjectScoreService propertyProjectScoreService;
/** /**
* 项目列表 * 项目列表
* *
@ -94,8 +99,8 @@ public class AppPropertyProjectController {
* @since 2020/5/13 15:37 * @since 2020/5/13 15:37
*/ */
@GetMapping("projectScore") @GetMapping("projectScore")
public Result<ProjectDetailResultDTO> score(@RequestBody ProjectDetailFormDTO formDto) { public Result score(@RequestBody ProjectScoreFormDTO formDto) {
ProjectDetailResultDTO data = propertyProjectService.getProjectDetailById(formDto); propertyProjectScoreService.score(formDto);
return new Result<ProjectDetailResultDTO>().ok(data); return new Result();
} }
} }

1
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/controller/PropertyProjectScoreController.java

@ -90,5 +90,4 @@ public class PropertyProjectScoreController {
List<PropertyProjectScoreDTO> list = propertyProjectScoreService.list(params); List<PropertyProjectScoreDTO> list = propertyProjectScoreService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PropertyProjectScoreExcel.class); ExcelUtils.exportExcelToTarget(response, null, list, PropertyProjectScoreExcel.class);
} }
} }

12
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/dao/PropertyProjectScoreDao.java

@ -18,6 +18,8 @@
package com.elink.esua.epdc.modules.project.dao; package com.elink.esua.epdc.modules.project.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.project.form.ProjectDetailFormDTO;
import com.elink.esua.epdc.dto.project.form.ProjectScoreFormDTO;
import com.elink.esua.epdc.modules.project.entity.PropertyProjectScoreEntity; import com.elink.esua.epdc.modules.project.entity.PropertyProjectScoreEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -29,5 +31,13 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface PropertyProjectScoreDao extends BaseDao<PropertyProjectScoreEntity> { public interface PropertyProjectScoreDao extends BaseDao<PropertyProjectScoreEntity> {
/**
* 物业打分
*
* @return int
* @params [params]
* @author zhangyuan
* @since 2019/10/11 14:54
*/
int deleteByIds(ProjectScoreFormDTO dto);
} }

11
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/service/PropertyProjectScoreService.java

@ -20,6 +20,7 @@ package com.elink.esua.epdc.modules.project.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService; 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.page.PageData;
import com.elink.esua.epdc.dto.project.PropertyProjectScoreDTO; import com.elink.esua.epdc.dto.project.PropertyProjectScoreDTO;
import com.elink.esua.epdc.dto.project.form.ProjectScoreFormDTO;
import com.elink.esua.epdc.modules.project.entity.PropertyProjectScoreEntity; import com.elink.esua.epdc.modules.project.entity.PropertyProjectScoreEntity;
import java.util.List; import java.util.List;
@ -92,4 +93,14 @@ public interface PropertyProjectScoreService extends BaseService<PropertyProject
* @date 2020-05-20 * @date 2020-05-20
*/ */
void delete(String[] ids); void delete(String[] ids);
/**
* 物业项目打分
*
* @param dto
* @return void
* @author zhangy
* @date 2020-05-09
*/
void score(ProjectScoreFormDTO dto);
} }

10
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/project/service/impl/PropertyProjectScoreServiceImpl.java

@ -23,6 +23,7 @@ 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.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.dto.project.form.ProjectScoreFormDTO;
import com.elink.esua.epdc.modules.project.dao.PropertyProjectScoreDao; import com.elink.esua.epdc.modules.project.dao.PropertyProjectScoreDao;
import com.elink.esua.epdc.dto.project.PropertyProjectScoreDTO; import com.elink.esua.epdc.dto.project.PropertyProjectScoreDTO;
import com.elink.esua.epdc.modules.project.entity.PropertyProjectScoreEntity; import com.elink.esua.epdc.modules.project.entity.PropertyProjectScoreEntity;
@ -101,4 +102,13 @@ public class PropertyProjectScoreServiceImpl extends BaseServiceImpl<PropertyPro
baseDao.deleteBatchIds(Arrays.asList(ids)); baseDao.deleteBatchIds(Arrays.asList(ids));
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void score(ProjectScoreFormDTO dto) {
PropertyProjectScoreEntity entity = ConvertUtils.sourceToTarget(dto, PropertyProjectScoreEntity.class);
// 物理删除历史打分记录
baseDao.deleteByIds(dto);
// 插入新打分记录
baseDao.insert(entity);
}
} }

12
epdc-cloud-property/src/main/resources/mapper/project/PropertyProjectScoreDao.xml

@ -3,7 +3,8 @@
<mapper namespace="com.elink.esua.epdc.modules.project.dao.PropertyProjectScoreDao"> <mapper namespace="com.elink.esua.epdc.modules.project.dao.PropertyProjectScoreDao">
<resultMap type="com.elink.esua.epdc.modules.project.entity.PropertyProjectScoreEntity" id="propertyProjectScoreMap"> <resultMap type="com.elink.esua.epdc.modules.project.entity.PropertyProjectScoreEntity"
id="propertyProjectScoreMap">
<result property="id" column="ID"/> <result property="id" column="ID"/>
<result property="projectId" column="PROJECT_ID"/> <result property="projectId" column="PROJECT_ID"/>
<result property="propertyId" column="PROPERTY_ID"/> <result property="propertyId" column="PROPERTY_ID"/>
@ -17,5 +18,14 @@
<result property="updatedTime" column="UPDATED_TIME"/> <result property="updatedTime" column="UPDATED_TIME"/>
</resultMap> </resultMap>
<delete id="deleteByIds">
DELETE
FROM
epdc_property_project_score
WHERE
PROJECT_ID = #{projectId}
AND PROPERTY_ID = #{propertyId}
AND USER_ID = #{userId}
</delete>
</mapper> </mapper>
Loading…
Cancel
Save