Browse Source

公众号页面相关接口

master
qushutong 2 years ago
parent
commit
246edf6c85
  1. 96
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/ScreenEnterpriseOutputDTO.java
  2. 44
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/vegetableFormDTO.java
  3. 8
      epmet-module/resi-partymember/resi-partymember-server/pom.xml
  4. 104
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenEnterpriseOutputController.java
  5. 24
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenReportEnterpriseController.java
  6. 33
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/ScreenEnterpriseOutputDao.java
  7. 66
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/ScreenEnterpriseOutputEntity.java
  8. 99
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenEnterpriseOutputService.java
  9. 4
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenReportEnterpriseService.java
  10. 116
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenEnterpriseOutputServiceImpl.java
  11. 23
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenReportEnterpriseServiceImpl.java
  12. 22
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/ScreenEnterpriseOutputDao.xml

96
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/ScreenEnterpriseOutputDTO.java

@ -0,0 +1,96 @@
/**
* 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.resi.partymember.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 用于上报蔬菜的企业
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2024-03-22
*/
@Data
public class ScreenEnterpriseOutputDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 蔬菜类别
*/
private String vegetableCategory;
/**
* 企业名称
*/
private String placeOrgName;
/**
* 产量
*/
private String output;
/**
* 删除标识0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 种植时间
*/
private Date growTime;
/**
* 上市时间
*/
private Date marketTime;
}

44
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/vegetableFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.resi.partymember.dto.partymember.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
*
* @description: 企业上报蔬菜
* @author qushutong
* @date 2024/3/22 15:08
* @param
* @return
* @Version1.0
**/
@Data
public class vegetableFormDTO implements Serializable {
private static final long serialVersionUID = 7719236439989973549L;
/**
* vegetableList : [{"output":"产量","placeOrgName":"企业名称","vegetableCategory":"白菜","growTime":"2020-01-02 09:27:06","marketTime":"2020-01-02 09:27:06"},{"output":"产量","placeOrgName":"企业名称","vegetableCategory":"小白菜","growTime":"2020-01-02 09:27:06","marketTime":"2020-01-02 09:27:06"}]
*/
private List<VegetableListEntity> vegetableList;
@Data
public static class VegetableListEntity {
public VegetableListEntity(){}
/**
* output : 产量
* placeOrgName : 企业名称
* vegetableCategory : 白菜
* growTime : 2020-01-02 09:27:06
* marketTime : 2020-01-02 09:27:06
*/
private String output;
private String placeOrgName;
private String vegetableCategory;
private Date growTime;
private Date marketTime;
}
}

8
epmet-module/resi-partymember/resi-partymember-server/pom.xml

@ -182,8 +182,8 @@
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epmet</spring.datasource.druid.username>
<spring.datasource.druid.password>EpmEt_yfz@@</spring.datasource.druid.password>
<spring.datasource.druid.username>root</spring.datasource.druid.username>
<spring.datasource.druid.password>root</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host>
@ -236,8 +236,8 @@
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epmet</spring.datasource.druid.username>
<spring.datasource.druid.password>EpmEt_yfz@@</spring.datasource.druid.password>
<spring.datasource.druid.username>root</spring.datasource.druid.username>
<spring.datasource.druid.password>root</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host>

104
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenEnterpriseOutputController.java

@ -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.epmet.modules.partymember.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.partymember.service.ScreenEnterpriseOutputService;
import com.epmet.resi.partymember.dto.ScreenEnterpriseOutputDTO;
import com.epmet.resi.partymember.dto.partymember.form.vegetableFormDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 用于上报蔬菜的企业
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2024-03-22
*/
@RestController
@RequestMapping("screenenterpriseoutput")
public class ScreenEnterpriseOutputController {
@Autowired
private ScreenEnterpriseOutputService screenEnterpriseOutputService;
@GetMapping("page")
public Result<PageData<ScreenEnterpriseOutputDTO>> page(@RequestParam Map<String, Object> params){
PageData<ScreenEnterpriseOutputDTO> page = screenEnterpriseOutputService.page(params);
return new Result<PageData<ScreenEnterpriseOutputDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ScreenEnterpriseOutputDTO> get(@PathVariable("id") String id){
ScreenEnterpriseOutputDTO data = screenEnterpriseOutputService.get(id);
return new Result<ScreenEnterpriseOutputDTO>().ok(data);
}
/**
*
* @description: 上报
* @author qushutong
* @date 2024/3/22 14:52
* @param
* @return com.epmet.commons.tools.utils.Result
* @Version1.0
**/
@PostMapping("yifengScreen/submitOutput")
public Result submitOutput(@RequestBody vegetableFormDTO dto){
//效验数据
// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
screenEnterpriseOutputService.submitOutput(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ScreenEnterpriseOutputDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
screenEnterpriseOutputService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
screenEnterpriseOutputService.delete(ids);
return new Result();
}
@PostMapping
public Result save(@RequestBody ScreenEnterpriseOutputDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
screenEnterpriseOutputService.save(dto);
return new Result();
}
}

24
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenReportEnterpriseController.java

@ -42,24 +42,24 @@ import java.util.Map;
@RestController
@RequestMapping("screenreportenterprise")
public class ScreenReportEnterpriseController {
@Autowired
private ScreenReportEnterpriseService screenReportEnterpriseService;
@GetMapping("page")
public Result<PageData<ScreenReportEnterpriseDTO>> page(@RequestParam Map<String, Object> params){
public Result<PageData<ScreenReportEnterpriseDTO>> page(@RequestParam Map<String, Object> params) {
PageData<ScreenReportEnterpriseDTO> page = screenReportEnterpriseService.page(params);
return new Result<PageData<ScreenReportEnterpriseDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ScreenReportEnterpriseDTO> get(@PathVariable("id") String id){
public Result<ScreenReportEnterpriseDTO> get(@PathVariable("id") String id) {
ScreenReportEnterpriseDTO data = screenReportEnterpriseService.get(id);
return new Result<ScreenReportEnterpriseDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ScreenReportEnterpriseDTO dto){
public Result save(@RequestBody ScreenReportEnterpriseDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
screenReportEnterpriseService.save(dto);
@ -67,7 +67,7 @@ public class ScreenReportEnterpriseController {
}
@PutMapping
public Result update(@RequestBody ScreenReportEnterpriseDTO dto){
public Result update(@RequestBody ScreenReportEnterpriseDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
screenReportEnterpriseService.update(dto);
@ -75,12 +75,24 @@ public class ScreenReportEnterpriseController {
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
screenReportEnterpriseService.delete(ids);
return new Result();
}
/**
* @param
* @return com.epmet.commons.tools.utils.Result
* @description: 企业登录
* @author qushutong
* @date 2024/3/22 10:46
* @Version1.0
**/
@PostMapping("yifengScreen/login")
public Result login(@RequestBody ScreenReportEnterpriseDTO formDto) {
return screenReportEnterpriseService.login(formDto);
}
}

33
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/ScreenEnterpriseOutputDao.java

@ -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.epmet.modules.partymember.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partymember.entity.ScreenEnterpriseOutputEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用于上报蔬菜的企业
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2024-03-22
*/
@Mapper
public interface ScreenEnterpriseOutputDao extends BaseDao<ScreenEnterpriseOutputEntity> {
}

66
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/ScreenEnterpriseOutputEntity.java

@ -0,0 +1,66 @@
/**
* 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.modules.partymember.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 用于上报蔬菜的企业
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2024-03-22
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_enterprise_output")
public class ScreenEnterpriseOutputEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 蔬菜类别
*/
private String vegetableCategory;
/**
* 企业名称
*/
private String placeOrgName;
/**
* 产量
*/
private String output;
/**
* 种植时间
*/
private Date growTime;
/**
* 上市时间
*/
private Date marketTime;
}

99
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenEnterpriseOutputService.java

@ -0,0 +1,99 @@
/**
* 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.modules.partymember.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partymember.entity.ScreenEnterpriseOutputEntity;
import com.epmet.resi.partymember.dto.ScreenEnterpriseOutputDTO;
import com.epmet.resi.partymember.dto.partymember.form.vegetableFormDTO;
import java.util.List;
import java.util.Map;
/**
* 用于上报蔬菜的企业
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2024-03-22
*/
public interface ScreenEnterpriseOutputService extends BaseService<ScreenEnterpriseOutputEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenEnterpriseOutputDTO>
* @author generator
* @date 2024-03-22
*/
PageData<ScreenEnterpriseOutputDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenEnterpriseOutputDTO>
* @author generator
* @date 2024-03-22
*/
List<ScreenEnterpriseOutputDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenEnterpriseOutputDTO
* @author generator
* @date 2024-03-22
*/
ScreenEnterpriseOutputDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2024-03-22
*/
void save(ScreenEnterpriseOutputDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2024-03-22
*/
void update(ScreenEnterpriseOutputDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2024-03-22
*/
void delete(String[] ids);
Result submitOutput(vegetableFormDTO dto);
}

4
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenReportEnterpriseService.java

@ -20,6 +20,7 @@ package com.epmet.modules.partymember.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partymember.entity.ScreenReportEnterpriseEntity;
import com.epmet.resi.partymember.dto.ScreenReportEnterpriseDTO;
@ -93,4 +94,7 @@ public interface ScreenReportEnterpriseService extends BaseService<ScreenReportE
* @date 2024-03-22
*/
void delete(String[] ids);
Result login(ScreenReportEnterpriseDTO formDto);
}

116
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenEnterpriseOutputServiceImpl.java

@ -0,0 +1,116 @@
/**
* 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.modules.partymember.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partymember.dao.ScreenEnterpriseOutputDao;
import com.epmet.modules.partymember.entity.ScreenEnterpriseOutputEntity;
import com.epmet.modules.partymember.service.ScreenEnterpriseOutputService;
import com.epmet.resi.partymember.dto.ScreenEnterpriseOutputDTO;
import com.epmet.resi.partymember.dto.partymember.form.vegetableFormDTO;
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.HashMap;
import java.util.List;
import java.util.Map;
/**
* 用于上报蔬菜的企业
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2024-03-22
*/
@Service
public class ScreenEnterpriseOutputServiceImpl extends BaseServiceImpl<ScreenEnterpriseOutputDao, ScreenEnterpriseOutputEntity> implements ScreenEnterpriseOutputService {
@Override
public PageData<ScreenEnterpriseOutputDTO> page(Map<String, Object> params) {
IPage<ScreenEnterpriseOutputEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenEnterpriseOutputDTO.class);
}
@Override
public List<ScreenEnterpriseOutputDTO> list(Map<String, Object> params) {
List<ScreenEnterpriseOutputEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenEnterpriseOutputDTO.class);
}
private QueryWrapper<ScreenEnterpriseOutputEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenEnterpriseOutputEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ScreenEnterpriseOutputDTO get(String id) {
ScreenEnterpriseOutputEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenEnterpriseOutputDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenEnterpriseOutputDTO dto) {
ScreenEnterpriseOutputEntity entity = ConvertUtils.sourceToTarget(dto, ScreenEnterpriseOutputEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenEnterpriseOutputDTO dto) {
ScreenEnterpriseOutputEntity entity = ConvertUtils.sourceToTarget(dto, ScreenEnterpriseOutputEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public Result submitOutput(vegetableFormDTO dto) {
String placeOrgName = dto.getVegetableList().get(0).getPlaceOrgName();
Map map = new HashMap();
map.put("PLACE_ORG_NAME",placeOrgName);
baseDao.deleteByMap(map);
List<vegetableFormDTO.VegetableListEntity> vegetableList = dto.getVegetableList();
List<ScreenEnterpriseOutputEntity> screenEnterpriseOutputEntities = ConvertUtils.sourceToTarget(vegetableList, ScreenEnterpriseOutputEntity.class);
this.insertBatch(screenEnterpriseOutputEntities);
return new Result();
}
}

23
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenReportEnterpriseServiceImpl.java

@ -22,15 +22,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partymember.dao.ScreenReportEnterpriseDao;
import com.epmet.modules.partymember.entity.ScreenReportEnterpriseEntity;
import com.epmet.modules.partymember.service.ScreenReportEnterpriseService;
import com.epmet.resi.partymember.dto.ScreenReportEnterpriseDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -64,8 +64,8 @@ public class ScreenReportEnterpriseServiceImpl extends BaseServiceImpl<ScreenRep
return ConvertUtils.sourceToTarget(entityList, ScreenReportEnterpriseDTO.class);
}
private QueryWrapper<ScreenReportEnterpriseEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<ScreenReportEnterpriseEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenReportEnterpriseEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -100,4 +100,19 @@ public class ScreenReportEnterpriseServiceImpl extends BaseServiceImpl<ScreenRep
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public Result login(ScreenReportEnterpriseDTO formDto) {
ScreenReportEnterpriseEntity screenReportEnterpriseEntity = baseDao.selectOne(new QueryWrapper<ScreenReportEnterpriseEntity>()
.eq("del_flag", 0)
.eq("PLACE_ORG_NAME", formDto.getPlaceOrgName()));
if(null==screenReportEnterpriseEntity){
return new Result().error("账号不存在,请重新输入");
}
if (!formDto.getPassword().equals(screenReportEnterpriseEntity.getPassword())) {
return new Result().error("密码错误,请重新输入");
}
return new Result();
}
}

22
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/ScreenEnterpriseOutputDao.xml

@ -0,0 +1,22 @@
<?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.modules.partymember.dao.ScreenEnterpriseOutputDao">
<resultMap type="com.epmet.modules.partymember.entity.ScreenEnterpriseOutputEntity" id="screenEnterpriseOutputMap">
<result property="id" column="ID"/>
<result property="vegetableCategory" column="VEGETABLE_CATEGORY"/>
<result property="placeOrgName" column="PLACE_ORG_NAME"/>
<result property="output" column="OUTPUT"/>
<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="growTime" column="GROW_TIME"/>
<result property="marketTime" column="MARKET_TIME"/>
</resultMap>
</mapper>
Loading…
Cancel
Save