Browse Source

维护种子产量上报的企业

master
qushutong 1 year ago
parent
commit
98dc597f39
  1. 111
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/ScreenReportEnterpriseDTO.java
  2. 86
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenReportEnterpriseController.java
  3. 33
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/ScreenReportEnterpriseDao.java
  4. 82
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/ScreenReportEnterpriseEntity.java
  5. 96
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenReportEnterpriseService.java
  6. 103
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenReportEnterpriseServiceImpl.java
  7. 25
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/ScreenReportEnterpriseDao.xml

111
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/ScreenReportEnterpriseDTO.java

@ -0,0 +1,111 @@
/**
* 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 ScreenReportEnterpriseDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 密码
*/
private String password;
/**
* 企业类别
*/
private String placeCategory;
/**
* 企业名称
*/
private String placeOrgName;
/**
* 企业地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 场所负责人
*/
private String personInCharge;
/**
* 负责人电话
*/
private String mobile;
/**
* 删除标识0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -0,0 +1,86 @@
/**
* 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.ScreenReportEnterpriseService;
import com.epmet.resi.partymember.dto.ScreenReportEnterpriseDTO;
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("screenreportenterprise")
public class ScreenReportEnterpriseController {
@Autowired
private ScreenReportEnterpriseService screenReportEnterpriseService;
@GetMapping("page")
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){
ScreenReportEnterpriseDTO data = screenReportEnterpriseService.get(id);
return new Result<ScreenReportEnterpriseDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ScreenReportEnterpriseDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
screenReportEnterpriseService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ScreenReportEnterpriseDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
screenReportEnterpriseService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
screenReportEnterpriseService.delete(ids);
return new Result();
}
}

33
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/ScreenReportEnterpriseDao.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.ScreenReportEnterpriseEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用于上报蔬菜的企业
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2024-03-22
*/
@Mapper
public interface ScreenReportEnterpriseDao extends BaseDao<ScreenReportEnterpriseEntity> {
}

82
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/ScreenReportEnterpriseEntity.java

@ -0,0 +1,82 @@
/**
* 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;
/**
* 用于上报蔬菜的企业
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2024-03-22
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_report_enterprise")
public class ScreenReportEnterpriseEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 密码
*/
private String password;
/**
* 企业类别
*/
private String placeCategory;
/**
* 企业名称
*/
private String placeOrgName;
/**
* 企业地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 场所负责人
*/
private String personInCharge;
/**
* 负责人电话
*/
private String mobile;
}

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

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

@ -0,0 +1,103 @@
/**
* 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.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
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;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 用于上报蔬菜的企业
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2024-03-22
*/
@Service
public class ScreenReportEnterpriseServiceImpl extends BaseServiceImpl<ScreenReportEnterpriseDao, ScreenReportEnterpriseEntity> implements ScreenReportEnterpriseService {
@Override
public PageData<ScreenReportEnterpriseDTO> page(Map<String, Object> params) {
IPage<ScreenReportEnterpriseEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenReportEnterpriseDTO.class);
}
@Override
public List<ScreenReportEnterpriseDTO> list(Map<String, Object> params) {
List<ScreenReportEnterpriseEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenReportEnterpriseDTO.class);
}
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);
return wrapper;
}
@Override
public ScreenReportEnterpriseDTO get(String id) {
ScreenReportEnterpriseEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenReportEnterpriseDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenReportEnterpriseDTO dto) {
ScreenReportEnterpriseEntity entity = ConvertUtils.sourceToTarget(dto, ScreenReportEnterpriseEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenReportEnterpriseDTO dto) {
ScreenReportEnterpriseEntity entity = ConvertUtils.sourceToTarget(dto, ScreenReportEnterpriseEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

25
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/ScreenReportEnterpriseDao.xml

@ -0,0 +1,25 @@
<?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.ScreenReportEnterpriseDao">
<resultMap type="com.epmet.modules.partymember.entity.ScreenReportEnterpriseEntity" id="screenReportEnterpriseMap">
<result property="id" column="ID"/>
<result property="password" column="PASSWORD"/>
<result property="placeCategory" column="PLACE_CATEGORY"/>
<result property="placeOrgName" column="PLACE_ORG_NAME"/>
<result property="address" column="ADDRESS"/>
<result property="longitude" column="LONGITUDE"/>
<result property="latitude" column="LATITUDE"/>
<result property="personInCharge" column="PERSON_IN_CHARGE"/>
<result property="mobile" column="MOBILE"/>
<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"/>
</resultMap>
</mapper>
Loading…
Cancel
Save