Browse Source

项目新增字段 ,

zyh
zhanyunjiu 3 years ago
parent
commit
afcecc3c73
  1. 19
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/annotation/FarmMsgAspect.java
  2. 16
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectBaseVO.java
  3. 23
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectExcelVO.java
  4. 33
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectPageReqVO.java
  5. 20
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectSearchPageReqVO.java
  6. 29
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/project/ProjectDO.java
  7. 2
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/area/AreaMapper.java
  8. 22
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaServiceImpl.java

19
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/annotation/FarmMsgAspect.java

@ -1,13 +1,11 @@
package cn.iocoder.yudao.module.farm.annotation; package cn.iocoder.yudao.module.farm.annotation;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.farm.controller.admin.task.dto.TaskAssemblyDTO; import cn.iocoder.yudao.module.farm.controller.admin.task.dto.TaskAssemblyDTO;
import cn.iocoder.yudao.module.farm.controller.admin.task.dto.TaskDetailDTO;
import cn.iocoder.yudao.module.farm.dal.dataobject.area.AreaDO; import cn.iocoder.yudao.module.farm.dal.dataobject.area.AreaDO;
import cn.iocoder.yudao.module.farm.dal.dataobject.discuss.DiscussDO; import cn.iocoder.yudao.module.farm.dal.dataobject.discuss.DiscussDO;
import cn.iocoder.yudao.module.farm.dal.dataobject.logMsg.LogMsgDO; import cn.iocoder.yudao.module.farm.dal.dataobject.logMsg.LogMsgDO;
@ -25,21 +23,20 @@ import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.CpUser.CpUserMapper; import cn.iocoder.yudao.module.system.dal.mysql.CpUser.CpUserMapper;
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpMessageService; import me.chanjar.weixin.cp.api.WxCpMessageService;
import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.message.WxCpAppChatMessage;
import me.chanjar.weixin.cp.bean.message.WxCpMessage; import me.chanjar.weixin.cp.bean.message.WxCpMessage;
import me.chanjar.weixin.cp.bean.message.WxCpMessageSendResult; import me.chanjar.weixin.cp.bean.message.WxCpMessageSendResult;
import me.chanjar.weixin.cp.bean.messagebuilder.MiniProgramNoticeMsgBuilder;
import me.chanjar.weixin.cp.tp.message.WxCpTpMessageHandler;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*; import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature; import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -79,6 +76,9 @@ public class FarmMsgAspect {
@Value("${wxma.app_id}") @Value("${wxma.app_id}")
private String appid; private String appid;
@Value("${spring.profiles.active}")
private String active;
/** /**
* 定义切入点 @PointCut * 定义切入点 @PointCut
* 使用了@FarmMsg注解的地方切入 * 使用了@FarmMsg注解的地方切入
@ -90,6 +90,7 @@ public class FarmMsgAspect {
@Around("farmMsgPointCut(farmMsg)") @Around("farmMsgPointCut(farmMsg)")
public Object doAround(ProceedingJoinPoint pjp,FarmMsg farmMsg) throws Throwable { public Object doAround(ProceedingJoinPoint pjp,FarmMsg farmMsg) throws Throwable {
Object object = pjp.proceed(); Object object = pjp.proceed();
if (active.equalsIgnoreCase("prod")){
if (object instanceof CommonResult){ if (object instanceof CommonResult){
// 只处理接口正常result // 只处理接口正常result
if (farmMsg.type() == FarmMsgTypeEnum.NONE if (farmMsg.type() == FarmMsgTypeEnum.NONE
@ -117,9 +118,6 @@ public class FarmMsgAspect {
AdminUserDO adminUser = adminUserMapper.selectOne(AdminUserDO::getId, getLoginUserId()); AdminUserDO adminUser = adminUserMapper.selectOne(AdminUserDO::getId, getLoginUserId());
CpUserDO user = cpUserMapper.selectOne(CpUserDO::getUserId, adminUser.getCpUserId()); CpUserDO user = cpUserMapper.selectOne(CpUserDO::getUserId, adminUser.getCpUserId());
// if (!toUserStr.contains("WeiLaiKeQi")){
// return object;
// }
if (!farmMsgDTO.getNoSendMsg()){ if (!farmMsgDTO.getNoSendMsg()){
//企业微信小程序通知消息 //企业微信小程序通知消息
this.sendMiniMsg(user, farmMsgDTO, toUserStr); this.sendMiniMsg(user, farmMsgDTO, toUserStr);
@ -137,6 +135,7 @@ public class FarmMsgAspect {
logMsgMapper.insert(logMsgDO); logMsgMapper.insert(logMsgDO);
} }
} }
}
return object; return object;
} }

16
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectBaseVO.java

@ -42,6 +42,9 @@ ProjectBaseVO extends ProjectDO {
@ApiModelProperty("父级区域") @ApiModelProperty("父级区域")
private JSONArray areas; private JSONArray areas;
@ApiModelProperty("种植面积")
private Double plantArea;
private Long cropId; private Long cropId;
@ApiModelProperty("成员选择") @ApiModelProperty("成员选择")
@ -50,11 +53,20 @@ ProjectBaseVO extends ProjectDO {
@ApiModelProperty(value = "项目图片") @ApiModelProperty(value = "项目图片")
private JSONArray images; private JSONArray images;
@ApiModelProperty(value = "") @ApiModelProperty(value = "育苗日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date growSeedTime;
@ApiModelProperty(value = "种植日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date plantTime;
@ApiModelProperty(value = "采收开始日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date planStartTime; private Date planStartTime;
@ApiModelProperty(value = "") @ApiModelProperty(value = "种植结束日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date planEndTime; private Date planEndTime;

23
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectExcelVO.java

@ -1,13 +1,12 @@
package cn.iocoder.yudao.module.farm.controller.admin.project.vo; package cn.iocoder.yudao.module.farm.controller.admin.project.vo;
import cn.hutool.json.JSON;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum; import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import lombok.*; import io.swagger.annotations.ApiModelProperty;
import java.util.*; import lombok.Data;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty; import java.util.Date;
/** /**
* 农场项目 Excel VO * 农场项目 Excel VO
@ -30,6 +29,10 @@ public class ProjectExcelVO {
private ProjectStateEnum state; private ProjectStateEnum state;
private JSONArray areas; private JSONArray areas;
@ApiModelProperty("种植面积")
private Double plantArea;
private JSONArray members; private JSONArray members;
private Long cropId; private Long cropId;
@ -37,10 +40,16 @@ public class ProjectExcelVO {
@ExcelProperty("项目图片") @ExcelProperty("项目图片")
private JSONArray images; private JSONArray images;
@ExcelProperty("") @ExcelProperty("育苗日期")
private Date growSeedTime;
@ExcelProperty("种植日期")
private Date plantTime;
@ExcelProperty("采收开始日期")
private Date planStartTime; private Date planStartTime;
@ExcelProperty("") @ExcelProperty("种植结束日期")
private Date planEndTime; private Date planEndTime;
@ExcelProperty("") @ExcelProperty("")

33
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectPageReqVO.java

@ -1,14 +1,17 @@
package cn.iocoder.yudao.module.farm.controller.admin.project.vo; package cn.iocoder.yudao.module.farm.controller.admin.project.vo;
import cn.hutool.json.JSON; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum; import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import lombok.*; import io.swagger.annotations.ApiModel;
import java.util.*; import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*; import lombok.Data;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("管理后台 - 农场项目分页 Request VO") @ApiModel("管理后台 - 农场项目分页 Request VO")
@ -26,6 +29,10 @@ public class ProjectPageReqVO extends PageParam {
private ProjectStateEnum state; private ProjectStateEnum state;
private JSONArray areas; private JSONArray areas;
@ApiModelProperty("种植面积")
private Double plantArea;
private JSONArray members; private JSONArray members;
private Long cropId; private Long cropId;
@ -33,6 +40,22 @@ public class ProjectPageReqVO extends PageParam {
@ApiModelProperty(value = "项目图片") @ApiModelProperty(value = "项目图片")
private JSONArray images; private JSONArray images;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "育苗开始日期")
private Date beginGrowSeedTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "育苗结束日期")
private Date endGrowSeedTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "种植开始日期")
private Date beginPlantTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "种植结束日期")
private Date endPlantTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始") @ApiModelProperty(value = "开始")
private Date beginPlanStartTime; private Date beginPlanStartTime;

20
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectSearchPageReqVO.java

@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.farm.controller.admin.project.vo; package cn.iocoder.yudao.module.farm.controller.admin.project.vo;
import cn.hutool.json.JSON;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum; import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
@ -32,6 +31,9 @@ public class ProjectSearchPageReqVO extends PageParam {
private JSONArray areas; private JSONArray areas;
@ApiModelProperty("种植面积")
private Double plantArea;
private Long cropId; private Long cropId;
private JSONArray members; private JSONArray members;
@ -39,6 +41,22 @@ public class ProjectSearchPageReqVO extends PageParam {
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private JSONArray images; private JSONArray images;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "育苗开始日期")
private LocalDateTime beginGrowSeedTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "育苗结束日期")
private LocalDateTime endGrowSeedTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "种植开始日期")
private LocalDateTime beginPlantTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "种植结束日期")
private LocalDateTime endPlantTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始") @ApiModelProperty(value = "开始")
private LocalDateTime beginPlanStartTime; private LocalDateTime beginPlanStartTime;

29
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/project/ProjectDO.java

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.farm.dal.dataobject.project; package cn.iocoder.yudao.module.farm.dal.dataobject.project;
import cn.hutool.extra.spring.SpringUtil; import cn.hutool.extra.spring.SpringUtil;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum; import cn.iocoder.yudao.module.farm.enums.ProjectStateEnum;
@ -8,14 +9,19 @@ import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
import cn.iocoder.yudao.module.system.dict.Dict; import cn.iocoder.yudao.module.system.dict.Dict;
import cn.iocoder.yudao.module.system.service.permission.RoleService; import cn.iocoder.yudao.module.system.service.permission.RoleService;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.*; import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*; import java.util.Date;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import java.util.List;
import java.util.Map;
import java.util.Optional;
/** /**
* 农场项目 DO * 农场项目 DO
@ -51,6 +57,9 @@ public class ProjectDO extends BaseDO {
@TableField(typeHandler = JacksonTypeHandler.class) @TableField(typeHandler = JacksonTypeHandler.class)
private JSONArray areas; private JSONArray areas;
@ApiModelProperty("种植面积")
private Double plantArea;
private Long cropId; private Long cropId;
@ApiModelProperty("成员选择") @ApiModelProperty("成员选择")
@ -62,12 +71,22 @@ public class ProjectDO extends BaseDO {
@TableField(typeHandler = JacksonTypeHandler.class) @TableField(typeHandler = JacksonTypeHandler.class)
private JSONArray images; private JSONArray images;
/** /**
* * 育苗日期
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date growSeedTime;
/**
* 种植日期
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date plantTime;
/**
* 采收开始日期
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date planStartTime; private Date planStartTime;
/** /**
* * 种植结束日期
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date planEndTime; private Date planEndTime;

2
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/area/AreaMapper.java

@ -23,7 +23,7 @@ public interface AreaMapper extends BaseMapperX<AreaDO> {
.likeIfPresent(AreaDO::getName, reqVO.getName()) .likeIfPresent(AreaDO::getName, reqVO.getName())
.eqIfPresent(AreaDO::getParentId, reqVO.getParentId()) .eqIfPresent(AreaDO::getParentId, reqVO.getParentId())
.betweenIfPresent(AreaDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) .betweenIfPresent(AreaDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
// .eqIfPresent(AreaDO::getPretendDelete, reqVO.getPretendDelete()) .eqIfPresent(AreaDO::getPretendDelete, reqVO.getPretendDelete())
.orderByDesc(AreaDO::getId)); .orderByDesc(AreaDO::getId));
} }

22
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaServiceImpl.java

@ -1,19 +1,23 @@
package cn.iocoder.yudao.module.farm.service.area; package cn.iocoder.yudao.module.farm.service.area;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.farm.controller.admin.area.vo.*;
import cn.iocoder.yudao.module.farm.dal.dataobject.area.AreaDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.farm.controller.admin.area.vo.AreaCreateReqVO;
import cn.iocoder.yudao.module.farm.controller.admin.area.vo.AreaExportReqVO;
import cn.iocoder.yudao.module.farm.controller.admin.area.vo.AreaPageReqVO;
import cn.iocoder.yudao.module.farm.controller.admin.area.vo.AreaUpdateReqVO;
import cn.iocoder.yudao.module.farm.convert.area.AreaConvert; import cn.iocoder.yudao.module.farm.convert.area.AreaConvert;
import cn.iocoder.yudao.module.farm.dal.dataobject.area.AreaDO;
import cn.iocoder.yudao.module.farm.dal.mysql.area.AreaMapper; import cn.iocoder.yudao.module.farm.dal.mysql.area.AreaMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.farm.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.farm.enums.ErrorCodeConstants.AREA_NOT_EXISTS;
/** /**
* Service 实现类 * Service 实现类

Loading…
Cancel
Save