Browse Source

Merge remote-tracking branch 'origin/master'

master
DX 1 month ago
parent
commit
267e4964fe
  1. 22
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java
  2. 15
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java
  3. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java
  4. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java
  5. 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java

22
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java

@ -138,8 +138,24 @@ public class EnterpriseController {
}
//获取标签
final List<TagLibraryDO> tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterprise.getId());
enterprise.setTagList(tagLibraryDOS.stream().map(item->item.getTagName()).collect(Collectors.toList()));
// final List<TagLibraryDO> tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterprise.getId());
// enterprise.setTagList(tagLibraryDOS.stream().map(item->item.getTagName()).collect(Collectors.toList()));
// 获取标签
List<TagLibraryDO> tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterprise.getId());
if (tagLibraryDOS != null) {
enterprise.setTagList(tagLibraryDOS.stream()
.map(TagLibraryDO::getTagName)
.collect(Collectors.toList()));
} else {
// 处理 tagLibraryDOS 为 null 的情况,这里可以设置一个空列表
enterprise.setTagList(Collections.emptyList());
}
//通过userID获取专管人
enterprise.setInviterName(adminUserService.getUser(Long.valueOf(enterprise.getUserId())).getNickname());
//获取资质
LambdaQueryWrapper<EnterpriseQualificationDO> queryWrapper = new LambdaQueryWrapper<>();
@ -163,7 +179,7 @@ public class EnterpriseController {
enterprise.setQualificationList(enterpriseQualificationList);
}
//获取企业标签
return success(BeanUtils.toBean(enterprise, EnterpriseRespVO.class));
}

15
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java

@ -5,6 +5,11 @@ import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.Enter
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -59,11 +64,17 @@ public class TaskInfoRespVO {
@Schema(description = "任务计划开始时间")
@ExcelProperty("任务计划开始时间")
private LocalDateTime startDate;
@JsonSerialize(using = LocalDateSerializer.class) // 序列化(响应)
@JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求)
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate startDate;
@Schema(description = "任务计划结束时间")
@ExcelProperty("任务计划结束时间")
private LocalDateTime endDate;
@JsonSerialize(using = LocalDateSerializer.class) // 序列化(响应)
@JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求)
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate endDate;
@Schema(description = "任务创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("任务创建时间")

6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java

@ -44,13 +44,13 @@ public class TaskSendStartMessageJob implements JobHandler {
SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO();
reqDTO.setUserType(1);
reqDTO.setTemplateTitle("环保任务通知");
reqDTO.setPage("pages/index");
reqDTO.setPage("sub/task/detail?id="+beforeTaskInfo.getId());
reqDTO.setUserId(x.getUserId());
Map<String, String> message = new HashMap<>();
message.put("thing2", beforeTaskInfo.getTitle());
message.put("time3", DateUtil.format(beforeTaskInfo.getStartDate(), DateUtils.FORMAT_YEAR_MONTH_DAY));
message.put("time3", DateUtil.format(beforeTaskInfo.getStartDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY));
message.put("thing4", beforeTaskInfo.getDescription());
message.put("time5", DateUtil.format(beforeTaskInfo.getEndDate(), DateUtils.FORMAT_YEAR_MONTH_DAY));
message.put("time5", DateUtil.format(beforeTaskInfo.getEndDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY));
reqDTO.setMessages(message);
socialClientApi.sendWxaSubscribeMessage(reqDTO);
}

10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java

@ -59,6 +59,8 @@ public class EnterpriseServiceImpl implements EnterpriseService {
private EnterpriseTagMapper enterpriseTagMapper;
@Resource
private UserRoleMapper userRoleMapper;
@Resource
private AdminUserService adminUserService;
@Override
@Transactional
@ -106,8 +108,14 @@ public class EnterpriseServiceImpl implements EnterpriseService {
@Override
@Transactional
public Long pccreateEnterprise(EnterpriseSaveReqVO createReqVO) {
//专管员所属部门
final AdminUserDO user = adminUserService.getUser(createReqVO.getUserId());
if (user == null) {
throw exception(USER_NOT_EXISTS);
}
createReqVO.setDeptId(user.getDeptId());
EnterpriseDO enterprise = BeanUtils.toBean(createReqVO, EnterpriseDO.class);
enterprise.setDepartmentId(1L);
enterprise.setDepartmentId(createReqVO.getDeptId());
enterpriseMapper.insert(enterprise);
if (createReqVO.getFileIds() != null && createReqVO.getFileIds().length > 0) {
for (Long fileId : createReqVO.getFileIds()) {

1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java

@ -89,6 +89,7 @@ public class TaskInfoServiceImpl implements TaskInfoService {
String time = "";
time = DateUtil.format(new Date(), "yyyyMMddHHmm");
serialNumber = "HB" + time;
//随机数
taskInfo.setTaskNumber(serialNumber);
taskInfoMapper.insert(taskInfo);

Loading…
Cancel
Save