fix:bug
This commit is contained in:
+27
-3
@@ -261,6 +261,32 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
|
||||
addMeetingContactsList(meetingContactsList, payMeeting.getId());
|
||||
}
|
||||
|
||||
public void delWithStandardForUpdate(PayMeeting payMeeting){
|
||||
List<PayMeetingStandard> questionList = payMeeting.getQuestionList();
|
||||
if(!org.springframework.util.CollectionUtils.isEmpty(questionList)) {
|
||||
List<PayMeetingStandard> list = payMeetingStandardService.list(new LambdaQueryWrapper<PayMeetingStandard>().eq(PayMeetingStandard::getMeetingId, payMeeting.getId()));
|
||||
if(!org.springframework.util.CollectionUtils.isEmpty(list)) {
|
||||
ArrayList<PayMeetingStandard> listNew = new ArrayList<>();
|
||||
ArrayList<PayMeetingStandard> listUpdate = new ArrayList<>();
|
||||
for(PayMeetingStandard payMeetingStandard: questionList){
|
||||
if(StringUtils.isNotBlank(payMeetingStandard.getId())){
|
||||
//有id表示是更新或者不动
|
||||
listUpdate.add(payMeetingStandard);
|
||||
}else {
|
||||
//无id表示是新增
|
||||
payMeetingStandard.setMeetingId(payMeeting.getId());
|
||||
listNew.add(payMeetingStandard);
|
||||
}
|
||||
}
|
||||
payMeetingStandardService.updateBatchById(listUpdate);
|
||||
payMeetingStandardService.saveBatch(listNew);
|
||||
}else {
|
||||
List<PayMeetingStandard> collect = payMeeting.getQuestionList().stream().map(s -> s.setMeetingId(payMeeting.getId())).collect(Collectors.toList());
|
||||
payMeetingStandardService.saveBatch(collect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@@ -270,9 +296,7 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
|
||||
//进行校验,赋值操作
|
||||
PayMeeting payMeeting = getPayMeeting(payMeetingVO, hotelContactsList);
|
||||
saveOrUpdate(payMeeting);
|
||||
List<PayMeetingStandard> collect = payMeetingVO.getQuestionList().stream().map(s -> s.setMeetingId(payMeeting.getId())).collect(Collectors.toList());
|
||||
payMeetingStandardService.remove(new LambdaQueryWrapper<PayMeetingStandard>().eq(PayMeetingStandard::getMeetingId,payMeeting.getId()));
|
||||
payMeetingStandardService.saveBatch(collect);
|
||||
delWithStandardForUpdate(payMeeting);
|
||||
//如果酒店联系人列表不为空,就更新
|
||||
if (!CollectionUtils.isEmpty(hotelContactsList)) {
|
||||
String meetingId = payMeeting.getId();
|
||||
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
package com.jero.standards.xuanguan.stablecrosstraining.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.standards.xuanguan.stablecrosstraining.entity.WebMeetingStandard;
|
||||
import com.jero.standards.xuanguan.stablecrosstraining.service.IWebMeetingStandardService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.jmreport.common.vo.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: 宣贯征集问题
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags="宣贯征集问题")
|
||||
@RestController
|
||||
@RequestMapping("/webMeetingStandard/webMeetingStandard")
|
||||
public class WebMeetingStandardController extends JeroController<WebMeetingStandard, IWebMeetingStandardService> {
|
||||
@Autowired
|
||||
private IWebMeetingStandardService webMeetingStandardService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param webMeetingStandard
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "宣贯征集问题-分页列表查询")
|
||||
@ApiOperation(value="宣贯征集问题-分页列表查询", notes="宣贯征集问题-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(WebMeetingStandard webMeetingStandard,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<WebMeetingStandard> queryWrapper = QueryGenerator.initQueryWrapper(webMeetingStandard, req.getParameterMap());
|
||||
Page<WebMeetingStandard> page = new Page<WebMeetingStandard>(pageNo, pageSize);
|
||||
IPage<WebMeetingStandard> pageList = webMeetingStandardService.page(page, queryWrapper);
|
||||
return Result.ok(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param webMeetingStandard
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "宣贯征集问题-添加")
|
||||
@ApiOperation(value="宣贯征集问题-添加", notes="宣贯征集问题-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody WebMeetingStandard webMeetingStandard) {
|
||||
webMeetingStandardService.save(webMeetingStandard);
|
||||
return Result.ok("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param webMeetingStandard
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "宣贯征集问题-编辑")
|
||||
@ApiOperation(value="宣贯征集问题-编辑", notes="宣贯征集问题-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody WebMeetingStandard webMeetingStandard) {
|
||||
webMeetingStandardService.updateById(webMeetingStandard);
|
||||
return Result.ok("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "宣贯征集问题-通过id删除")
|
||||
@ApiOperation(value="宣贯征集问题-通过id删除", notes="宣贯征集问题-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
webMeetingStandardService.removeById(id);
|
||||
return Result.ok("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "宣贯征集问题-批量删除")
|
||||
@ApiOperation(value="宣贯征集问题-批量删除", notes="宣贯征集问题-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.webMeetingStandardService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.ok("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "宣贯征集问题-通过id查询")
|
||||
@ApiOperation(value="宣贯征集问题-通过id查询", notes="宣贯征集问题-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
WebMeetingStandard webMeetingStandard = webMeetingStandardService.getById(id);
|
||||
return Result.ok(webMeetingStandard);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param webMeetingStandard
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, WebMeetingStandard webMeetingStandard) {
|
||||
return super.exportXls(request, webMeetingStandard, WebMeetingStandard.class, "宣贯征集问题");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.jero.standards.xuanguan.stablecrosstraining.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
/**
|
||||
* @Description: 宣贯征集问题
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("web_meeting_standard")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="web_meeting_standard对象", description="宣贯征集问题")
|
||||
public class WebMeetingStandard {
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ID_WORKER_STR)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**创建人*/
|
||||
@Excel(name = "创建人", width = 15)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@Excel(name = "更新人", width = 15)
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@Excel(name = "更新日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**会议id*/
|
||||
@Excel(name = "会议id", width = 15)
|
||||
@ApiModelProperty(value = "会议id")
|
||||
private java.lang.String stableCrossId;
|
||||
/**标准号*/
|
||||
@Excel(name = "标准号", width = 15)
|
||||
@ApiModelProperty(value = "标准号")
|
||||
private java.lang.Object standardNumber;
|
||||
/**能力介绍*/
|
||||
@Excel(name = "能力介绍", width = 15)
|
||||
@ApiModelProperty(value = "能力介绍")
|
||||
private java.lang.Object standardName;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.jero.standards.xuanguan.stablecrosstraining.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.standards.xuanguan.stablecrosstraining.entity.WebMeetingStandard;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 宣贯征集问题
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface WebMeetingStandardMapper extends BaseMapper<WebMeetingStandard> {
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?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.jero.standards.xuanguan.stablecrosstraining.mapper.WebMeetingStandardMapper">
|
||||
|
||||
</mapper>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.standards.xuanguan.stablecrosstraining.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.standards.xuanguan.stablecrosstraining.entity.WebMeetingStandard;
|
||||
|
||||
/**
|
||||
* @Description: 宣贯征集问题
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IWebMeetingStandardService extends IService<WebMeetingStandard> {
|
||||
|
||||
}
|
||||
+27
@@ -24,6 +24,8 @@ import com.jero.standards.jiudian.hotelcontact.mapper.HotelContactMapper;
|
||||
import com.jero.standards.jiudian.hotelcontact.service.IHotelContactService;
|
||||
import com.jero.standards.meetingNews.entity.MeetingNews;
|
||||
import com.jero.standards.meetingNews.service.IMeetingNewsService;
|
||||
import com.jero.standards.xuanguan.stablecrosstraining.entity.WebMeetingStandard;
|
||||
import com.jero.standards.xuanguan.stablecrosstraining.service.IWebMeetingStandardService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.jero.standards.xuanguan.attendmeetings.entity.AttendMeetings;
|
||||
import com.jero.standards.xuanguan.attendmeetings.service.IAttendMeetingsService;
|
||||
@@ -35,9 +37,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 宣贯培训
|
||||
@@ -67,6 +71,8 @@ public class StableCrossTrainingServiceImpl extends ServiceImpl<StableCrossTrain
|
||||
private IMeetingNewsService meetingNewsService;
|
||||
@Resource
|
||||
private IOSSFileService iossFileService;
|
||||
@Autowired
|
||||
private IWebMeetingStandardService webMeetingStandardService;
|
||||
|
||||
@Override
|
||||
public StableCrossTraining push(PayMeeting payMeeting, List<PayMeetingHotelContacts> hotelContactsList) {
|
||||
@@ -175,6 +181,16 @@ public class StableCrossTrainingServiceImpl extends ServiceImpl<StableCrossTrain
|
||||
//配置培训状态
|
||||
this.isTrainingState(stableCrossTraining);
|
||||
Boolean resFlag = stableCrossTrainingService.save(stableCrossTraining);
|
||||
if(!CollectionUtils.isEmpty(stableCrossTraining.getQuestionList())){
|
||||
List<WebMeetingStandard> collect = stableCrossTraining.getQuestionList().stream().map(s -> {
|
||||
WebMeetingStandard webMeetingStandard = new WebMeetingStandard();
|
||||
webMeetingStandard.setStableCrossId(stableCrossTraining.getId());
|
||||
webMeetingStandard.setStandardName(s.getStandardName());
|
||||
webMeetingStandard.setStandardNumber(s.getStandardNumber());
|
||||
return webMeetingStandard;
|
||||
}).collect(Collectors.toList());
|
||||
webMeetingStandardService.saveBatch(collect);
|
||||
}
|
||||
//创建时间/创建人/修改时间/修改人
|
||||
BaseUtil.create(stableCrossTraining, "e9ca23d68d884d4ebb19d07889727dae");
|
||||
//添加酒店信息
|
||||
@@ -283,6 +299,17 @@ public class StableCrossTrainingServiceImpl extends ServiceImpl<StableCrossTrain
|
||||
// .setContactPerson(stableCrossTraining.getContactPerson()).setContactNumber(stableCrossTraining.getContactNumber())
|
||||
.setMeetingType(1).setId(hotelManagements.get(0).getId());
|
||||
hotelManagementService.edit(hotelManagement);
|
||||
webMeetingStandardService.remove(new LambdaQueryWrapper<WebMeetingStandard>().eq(WebMeetingStandard::getStableCrossId,stableCrossTraining.getId()));
|
||||
if(!CollectionUtils.isEmpty(stableCrossTraining.getQuestionList())){
|
||||
List<WebMeetingStandard> collect = stableCrossTraining.getQuestionList().stream().map(s -> {
|
||||
WebMeetingStandard webMeetingStandard = new WebMeetingStandard();
|
||||
webMeetingStandard.setStableCrossId(stableCrossTraining.getId());
|
||||
webMeetingStandard.setStandardName(s.getStandardName());
|
||||
webMeetingStandard.setStandardNumber(s.getStandardNumber());
|
||||
return webMeetingStandard;
|
||||
}).collect(Collectors.toList());
|
||||
webMeetingStandardService.saveBatch(collect);
|
||||
}
|
||||
//编辑宣贯信息
|
||||
return stableCrossTrainingService.updateById(stableCrossTraining);
|
||||
}else {
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.jero.standards.xuanguan.stablecrosstraining.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.jero.standards.xuanguan.stablecrosstraining.entity.WebMeetingStandard;
|
||||
import com.jero.standards.xuanguan.stablecrosstraining.mapper.WebMeetingStandardMapper;
|
||||
import com.jero.standards.xuanguan.stablecrosstraining.service.IWebMeetingStandardService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 宣贯征集问题
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
|
||||
@DS(value = "multi-datasource1")
|
||||
@Service
|
||||
public class WebMeetingStandardServiceImpl extends ServiceImpl<WebMeetingStandardMapper, WebMeetingStandard> implements IWebMeetingStandardService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user