修复测试bug,添加放心学数据查询
This commit is contained in:
parent
8f01c3ba9d
commit
e6c62e8355
@ -22,13 +22,6 @@ import java.util.List;
|
|||||||
@ApiModel(value = "EasyLearnPageBo对象", description = "放心学分页查询参数")
|
@ApiModel(value = "EasyLearnPageBo对象", description = "放心学分页查询参数")
|
||||||
public class EasyLearnPageBo {
|
public class EasyLearnPageBo {
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始与结束时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
|
||||||
@ApiModelProperty(value = "开始与结束时间")
|
|
||||||
private List<LocalDateTime> startAndEnd;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 顾问
|
* 顾问
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -13,12 +13,15 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 果酱-放心学订单表 控制层。
|
* 果酱-放心学订单表 控制层。
|
||||||
@ -44,8 +47,8 @@ public class EasyLearnController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("查询放心学分页")
|
@ApiOperation("查询放心学分页")
|
||||||
@GetMapping("/getEasyLearnPage")
|
@GetMapping("/getEasyLearnPage")
|
||||||
public R<Page<EasyLearnPageVo>> getEasyLearnPage(@Validated EasyLearnPageBo bo) {
|
public R<Page<EasyLearnPageVo>> getEasyLearnPage(@RequestParam(value = "startAndEnd",required = false) List<LocalDate> startAndEnd, @Validated EasyLearnPageBo bo) {
|
||||||
Page<EasyLearnPageVo> page = easyLearnOrderService.getEasyLearnPage(bo);
|
Page<EasyLearnPageVo> page = easyLearnOrderService.getEasyLearnPage(startAndEnd, bo);
|
||||||
return R.ok(page);
|
return R.ok(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +61,8 @@ public class EasyLearnController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/getEasyLearnXml")
|
@GetMapping("/getEasyLearnXml")
|
||||||
@ApiOperation("导出放心学数据")
|
@ApiOperation("导出放心学数据")
|
||||||
public void getEasyLearnXml(HttpServletResponse response, @ApiParam("分页查询条件") @Validated EasyLearnPageBo bo) throws IOException {
|
public void getEasyLearnXml(HttpServletResponse response, @RequestParam(value = "startAndEnd", required = false) List<LocalDate> startAndEnd,
|
||||||
|
@ApiParam("分页查询条件") @Validated EasyLearnPageBo bo) throws IOException {
|
||||||
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
||||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
response.setCharacterEncoding("utf-8");
|
response.setCharacterEncoding("utf-8");
|
||||||
@ -84,6 +88,6 @@ public class EasyLearnController {
|
|||||||
}
|
}
|
||||||
String fileName = URLEncoder.encode(fileFullName + "数据", "UTF-8").replaceAll("\\+", "%20");
|
String fileName = URLEncoder.encode(fileFullName + "数据", "UTF-8").replaceAll("\\+", "%20");
|
||||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||||
EasyExcel.write(response.getOutputStream(), EasyLearnPageDto.class).sheet("记录").doWrite(easyLearnOrderService.getEasyLearnXml(bo));
|
EasyExcel.write(response.getOutputStream(), EasyLearnPageDto.class).sheet("记录").doWrite(easyLearnOrderService.getEasyLearnXml(startAndEnd, bo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import com.cpop.jambox.business.vo.EasyLearnPageVo;
|
|||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.service.IService;
|
import com.mybatisflex.core.service.IService;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -25,7 +26,7 @@ public interface EasyLearnOrderService extends IService<EasyLearnOrder> {
|
|||||||
* @param bo 查询参数
|
* @param bo 查询参数
|
||||||
* @return Page<EasyLearnPageVo>
|
* @return Page<EasyLearnPageVo>
|
||||||
*/
|
*/
|
||||||
Page<EasyLearnPageVo> getEasyLearnPage(EasyLearnPageBo bo);
|
Page<EasyLearnPageVo> getEasyLearnPage(List<LocalDate> startAndEnd,EasyLearnPageBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出放心学数据
|
* 导出放心学数据
|
||||||
@ -34,5 +35,5 @@ public interface EasyLearnOrderService extends IService<EasyLearnOrder> {
|
|||||||
* @param bo 请求参数
|
* @param bo 请求参数
|
||||||
* @return List<EasyLearnPageDto>
|
* @return List<EasyLearnPageDto>
|
||||||
*/
|
*/
|
||||||
List<EasyLearnPageDto> getEasyLearnXml(EasyLearnPageBo bo);
|
List<EasyLearnPageDto> getEasyLearnXml(List<LocalDate> startAndEnd,EasyLearnPageBo bo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import com.zaxxer.hikari.HikariDataSource;
|
|||||||
import org.apache.poi.util.StringUtil;
|
import org.apache.poi.util.StringUtil;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -40,38 +41,41 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取放心学分页
|
* 获取放心学分页
|
||||||
* @author DB
|
*
|
||||||
* @since 2023/12/15
|
|
||||||
* @param bo 查询参数
|
* @param bo 查询参数
|
||||||
* @return Page<EasyLearnPageVo>
|
* @return Page<EasyLearnPageVo>
|
||||||
|
* @author DB
|
||||||
|
* @since 2023/12/15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Page<EasyLearnPageVo> getEasyLearnPage(EasyLearnPageBo bo) {
|
public Page<EasyLearnPageVo> getEasyLearnPage(List<LocalDate> startAndEnd, EasyLearnPageBo bo) {
|
||||||
//TODO: 后续数据录入后,应该查询新版中的数据
|
//TODO: 后续数据录入后,应该查询新版中的数据
|
||||||
return getOldEasyLearnPage(bo);
|
return getOldEasyLearnPage(startAndEnd, bo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出放心学数据
|
* 导出放心学数据
|
||||||
* @author DB
|
*
|
||||||
* @since 2023/12/15
|
|
||||||
* @param bo 请求参数
|
* @param bo 请求参数
|
||||||
* @return List<EasyLearnPageDto>
|
* @return List<EasyLearnPageDto>
|
||||||
|
* @author DB
|
||||||
|
* @since 2023/12/15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<EasyLearnPageDto> getEasyLearnXml(EasyLearnPageBo bo) {
|
public List<EasyLearnPageDto> getEasyLearnXml(List<LocalDate> startAndEnd, EasyLearnPageBo bo) {
|
||||||
//TODO: 后续数据录入后,应该查询新版中的数据
|
//TODO: 后续数据录入后,应该查询新版中的数据
|
||||||
return getOldEasyLearnXml(bo);
|
return getOldEasyLearnXml(startAndEnd, bo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取旧数据
|
* 获取旧数据
|
||||||
* @author DB
|
*
|
||||||
* @since 2023/12/15
|
|
||||||
* @param bo 请求参数
|
* @param bo 请求参数
|
||||||
* @return List<EasyLearnPageDto>
|
* @return List<EasyLearnPageDto>
|
||||||
|
* @author DB
|
||||||
|
* @since 2023/12/15
|
||||||
*/
|
*/
|
||||||
private List<EasyLearnPageDto> getOldEasyLearnXml(EasyLearnPageBo bo) {
|
private List<EasyLearnPageDto> getOldEasyLearnXml(List<LocalDate> startAndEnd, EasyLearnPageBo bo) {
|
||||||
//TODO: 暂时不处理顾问
|
//TODO: 暂时不处理顾问
|
||||||
try {
|
try {
|
||||||
getJamboxProdDataSource();
|
getJamboxProdDataSource();
|
||||||
@ -80,14 +84,14 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
case 0:
|
case 0:
|
||||||
try {
|
try {
|
||||||
DataSourceKey.use("jamboxProd");
|
DataSourceKey.use("jamboxProd");
|
||||||
return RowUtil.toEntityList(Db.selectListByQuery(getLearnNowPayLaterData(false, bo)), EasyLearnPageDto.class);
|
return RowUtil.toEntityList(Db.selectListByQuery(getLearnNowPayLaterData(startAndEnd, false, bo)), EasyLearnPageDto.class);
|
||||||
} finally {
|
} finally {
|
||||||
DataSourceKey.clear();
|
DataSourceKey.clear();
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
try {
|
try {
|
||||||
DataSourceKey.use("jamboxProd");
|
DataSourceKey.use("jamboxProd");
|
||||||
return RowUtil.toEntityList(Db.selectListByQuery(getLearnNowPayLaterData(true, bo)), EasyLearnPageDto.class);
|
return RowUtil.toEntityList(Db.selectListByQuery(getLearnNowPayLaterData(startAndEnd, true, bo)), EasyLearnPageDto.class);
|
||||||
} finally {
|
} finally {
|
||||||
DataSourceKey.clear();
|
DataSourceKey.clear();
|
||||||
}
|
}
|
||||||
@ -97,7 +101,7 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
case 3:
|
case 3:
|
||||||
try {
|
try {
|
||||||
DataSourceKey.use("jamboxProd");
|
DataSourceKey.use("jamboxProd");
|
||||||
return RowUtil.toEntityList(Db.selectListByQuery(getEcppData(bo)), EasyLearnPageDto.class);
|
return RowUtil.toEntityList(Db.selectListByQuery(getEcppData(startAndEnd, bo)), EasyLearnPageDto.class);
|
||||||
} finally {
|
} finally {
|
||||||
DataSourceKey.clear();
|
DataSourceKey.clear();
|
||||||
}
|
}
|
||||||
@ -105,7 +109,7 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
try {
|
try {
|
||||||
//使用旧库
|
//使用旧库
|
||||||
DataSourceKey.use("jamboxProd");
|
DataSourceKey.use("jamboxProd");
|
||||||
return RowUtil.toEntityList(Db.selectListByQuery( getMemberData(bo)), EasyLearnPageDto.class);
|
return RowUtil.toEntityList(Db.selectListByQuery(getMemberData(startAndEnd, bo)), EasyLearnPageDto.class);
|
||||||
} finally {
|
} finally {
|
||||||
DataSourceKey.clear();
|
DataSourceKey.clear();
|
||||||
}
|
}
|
||||||
@ -119,12 +123,13 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取旧数据分页
|
* 获取旧数据分页
|
||||||
* @author DB
|
*
|
||||||
* @since 2023/12/15
|
|
||||||
* @param bo 请求参数
|
* @param bo 请求参数
|
||||||
* @return Page<EasyLearnPageVo>
|
* @return Page<EasyLearnPageVo>
|
||||||
|
* @author DB
|
||||||
|
* @since 2023/12/15
|
||||||
*/
|
*/
|
||||||
private Page<EasyLearnPageVo> getOldEasyLearnPage(EasyLearnPageBo bo) {
|
private Page<EasyLearnPageVo> getOldEasyLearnPage(List<LocalDate> startAndEnd,EasyLearnPageBo bo) {
|
||||||
//TODO: 暂时不处理顾问
|
//TODO: 暂时不处理顾问
|
||||||
try {
|
try {
|
||||||
getJamboxProdDataSource();
|
getJamboxProdDataSource();
|
||||||
@ -136,14 +141,14 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
case 0:
|
case 0:
|
||||||
try {
|
try {
|
||||||
DataSourceKey.use("jamboxProd");
|
DataSourceKey.use("jamboxProd");
|
||||||
return Db.paginate("j_commodity_ticket", page, getLearnNowPayLaterData(false, bo)).map(item -> item.toEntity(EasyLearnPageVo.class));
|
return Db.paginate("j_commodity_ticket", page, getLearnNowPayLaterData(startAndEnd,false, bo)).map(item -> item.toEntity(EasyLearnPageVo.class));
|
||||||
} finally {
|
} finally {
|
||||||
DataSourceKey.clear();
|
DataSourceKey.clear();
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
try {
|
try {
|
||||||
DataSourceKey.use("jamboxProd");
|
DataSourceKey.use("jamboxProd");
|
||||||
return Db.paginate("j_commodity_ticket", page, getLearnNowPayLaterData(true, bo)).map(item -> item.toEntity(EasyLearnPageVo.class));
|
return Db.paginate("j_commodity_ticket", page, getLearnNowPayLaterData(startAndEnd,true, bo)).map(item -> item.toEntity(EasyLearnPageVo.class));
|
||||||
} finally {
|
} finally {
|
||||||
DataSourceKey.clear();
|
DataSourceKey.clear();
|
||||||
}
|
}
|
||||||
@ -153,7 +158,7 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
case 3:
|
case 3:
|
||||||
try {
|
try {
|
||||||
DataSourceKey.use("jamboxProd");
|
DataSourceKey.use("jamboxProd");
|
||||||
return Db.paginate("j_commodity_ticket", page, getEcppData(bo)).map(item -> item.toEntity(EasyLearnPageVo.class));
|
return Db.paginate("j_commodity_ticket", page, getEcppData(startAndEnd,bo)).map(item -> item.toEntity(EasyLearnPageVo.class));
|
||||||
} finally {
|
} finally {
|
||||||
DataSourceKey.clear();
|
DataSourceKey.clear();
|
||||||
}
|
}
|
||||||
@ -161,7 +166,7 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
try {
|
try {
|
||||||
//使用旧库
|
//使用旧库
|
||||||
DataSourceKey.use("jamboxProd");
|
DataSourceKey.use("jamboxProd");
|
||||||
return Db.paginate("j_commodity_ticket", page, getMemberData(bo)).map(item -> item.toEntity(EasyLearnPageVo.class));
|
return Db.paginate("j_commodity_ticket", page, getMemberData(startAndEnd,bo)).map(item -> item.toEntity(EasyLearnPageVo.class));
|
||||||
} finally {
|
} finally {
|
||||||
DataSourceKey.clear();
|
DataSourceKey.clear();
|
||||||
}
|
}
|
||||||
@ -173,7 +178,7 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private QueryWrapper getMemberData(EasyLearnPageBo bo) {
|
private QueryWrapper getMemberData(List<LocalDate> startAndEnd, EasyLearnPageBo bo) {
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create();
|
QueryWrapper queryWrapper = QueryWrapper.create();
|
||||||
queryWrapper
|
queryWrapper
|
||||||
//查询品牌校区
|
//查询品牌校区
|
||||||
@ -187,25 +192,25 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
.groupBy("jmt.ticket_id")
|
.groupBy("jmt.ticket_id")
|
||||||
.orderBy("jmt.creation_time desc");
|
.orderBy("jmt.creation_time desc");
|
||||||
//开始时间结束时间
|
//开始时间结束时间
|
||||||
if (bo.getStartAndEnd() != null) {
|
if (startAndEnd != null) {
|
||||||
queryWrapper.and("jmt.creation_time between ? and ?", bo.getStartAndEnd().get(0), bo.getStartAndEnd().get(1));
|
queryWrapper.and("jmt.creation_time between ? and ?", startAndEnd.get(0), startAndEnd.get(1));
|
||||||
}
|
}
|
||||||
//品牌校区模糊查询
|
//品牌校区模糊查询
|
||||||
if (StringUtils.isNotBlank(bo.getBrandOrStore())){
|
if (StringUtils.isNotBlank(bo.getBrandOrStore())) {
|
||||||
queryWrapper.and("tbi.name like ?", "%" + bo.getBrandOrStore() + "%");
|
queryWrapper.and("tbi.name like ?", "%" + bo.getBrandOrStore() + "%");
|
||||||
}
|
}
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取数币数据
|
* 获取数币数据
|
||||||
|
*
|
||||||
|
* @return Page<EasyLearnPageVo>
|
||||||
* @author DB
|
* @author DB
|
||||||
* @since 2023/12/15
|
* @since 2023/12/15
|
||||||
* @return Page<EasyLearnPageVo>
|
|
||||||
*/
|
*/
|
||||||
private QueryWrapper getEcppData(EasyLearnPageBo bo) {
|
private QueryWrapper getEcppData(List<LocalDate> startAndEnd,EasyLearnPageBo bo) {
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create();
|
QueryWrapper queryWrapper = QueryWrapper.create();
|
||||||
queryWrapper
|
queryWrapper
|
||||||
//查询品牌校区
|
//查询品牌校区
|
||||||
@ -225,28 +230,32 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
.groupBy("jct.ticket_id")
|
.groupBy("jct.ticket_id")
|
||||||
.orderBy("jct.creation_time desc");
|
.orderBy("jct.creation_time desc");
|
||||||
//开始时间结束时间
|
//开始时间结束时间
|
||||||
if (bo.getStartAndEnd() != null) {
|
if (startAndEnd != null) {
|
||||||
queryWrapper.and("jct.creation_time between ? and ?", bo.getStartAndEnd().get(0), bo.getStartAndEnd().get(1));
|
queryWrapper.and("jct.creation_time between ? and ?", startAndEnd.get(0), startAndEnd.get(1));
|
||||||
}
|
}
|
||||||
//品牌校区模糊查询
|
//品牌校区模糊查询
|
||||||
if (StringUtils.isNotBlank(bo.getBrandOrStore())){
|
if (StringUtils.isNotBlank(bo.getBrandOrStore())) {
|
||||||
queryWrapper.and("tbi.name like ?", "%" + bo.getBrandOrStore() + "%").or("tmi.mechanism like ?", "%" + bo.getBrandOrStore() + "%");
|
queryWrapper.and("tbi.name like ?", "%" + bo.getBrandOrStore() + "%").or("tmi.mechanism like ?", "%" + bo.getBrandOrStore() + "%");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(bo.getStaffName())) {
|
||||||
|
queryWrapper.and("jct.staff_name like ?", "%" + bo.getStaffName() + "%");
|
||||||
|
}
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取先学后付数据
|
* 获取先学后付数据
|
||||||
* @author DB
|
*
|
||||||
* @param isMonth 是否是月付
|
* @param isMonth 是否是月付
|
||||||
* @since 2023/12/15
|
|
||||||
* @return Page<EasyLearnPageVo>
|
* @return Page<EasyLearnPageVo>
|
||||||
|
* @author DB
|
||||||
|
* @since 2023/12/15
|
||||||
*/
|
*/
|
||||||
private QueryWrapper getLearnNowPayLaterData(Boolean isMonth, EasyLearnPageBo bo) {
|
private QueryWrapper getLearnNowPayLaterData(List<LocalDate> startAndEnd,Boolean isMonth, EasyLearnPageBo bo) {
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
//查询品牌校区
|
//查询品牌校区
|
||||||
.select("tbi.name as brandName", "tmi.mechanism as storeName")
|
.select("tbi.name as brandName", "tmi.mechanism as storeName")
|
||||||
.select( "jct.ticket_id as id", "jct.wx_order_id as outOrderNo", "jct.name as customerName", "jct.price as totalAmount", "jct.price as totalPayAmount", "jct.phone as customerPhone", "jct.creation_time as createTime")
|
.select("jct.ticket_id as id", "jct.wx_order_id as outOrderNo", "jct.name as customerName", "jct.price as totalAmount", "jct.price as totalPayAmount", "jct.phone as customerPhone", "jct.creation_time as createTime")
|
||||||
.select("tct.name as productName")
|
.select("tct.name as productName")
|
||||||
.from("j_commodity_ticket").as("jct")
|
.from("j_commodity_ticket").as("jct")
|
||||||
//品牌
|
//品牌
|
||||||
@ -264,13 +273,16 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
|||||||
.groupBy("jct.ticket_id")
|
.groupBy("jct.ticket_id")
|
||||||
.orderBy("jct.creation_time desc");
|
.orderBy("jct.creation_time desc");
|
||||||
//开始时间结束时间
|
//开始时间结束时间
|
||||||
if (bo.getStartAndEnd() != null) {
|
if (startAndEnd != null) {
|
||||||
queryWrapper.and("jct.creation_time between ? and ?", bo.getStartAndEnd().get(0), bo.getStartAndEnd().get(1));
|
queryWrapper.and("jct.creation_time between ? and ?", startAndEnd.get(0), startAndEnd.get(1));
|
||||||
}
|
}
|
||||||
//品牌校区模糊查询
|
//品牌校区模糊查询
|
||||||
if (StringUtils.isNotBlank(bo.getBrandOrStore())){
|
if (StringUtils.isNotBlank(bo.getBrandOrStore())) {
|
||||||
queryWrapper.and("tbi.name like ?", "%" + bo.getBrandOrStore() + "%").or("tmi.mechanism like ?", "%" + bo.getBrandOrStore() + "%");
|
queryWrapper.and("tbi.name like ?", "%" + bo.getBrandOrStore() + "%").or("tmi.mechanism like ?", "%" + bo.getBrandOrStore() + "%");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(bo.getStaffName())) {
|
||||||
|
queryWrapper.and("jct.staff_name like ?", "%" + bo.getStaffName() + "%");
|
||||||
|
}
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,11 +43,6 @@ spring:
|
|||||||
host: localhost
|
host: localhost
|
||||||
port: 27017
|
port: 27017
|
||||||
database: cpop-union
|
database: cpop-union
|
||||||
# 热部署
|
|
||||||
devtools:
|
|
||||||
restart:
|
|
||||||
# 开启热部署(更改文件后,自动重启)
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 9420
|
port: 9420
|
||||||
|
|||||||
@ -44,11 +44,6 @@ spring:
|
|||||||
host: localhost
|
host: localhost
|
||||||
port: 27017
|
port: 27017
|
||||||
database: rock-blade
|
database: rock-blade
|
||||||
# 热部署
|
|
||||||
devtools:
|
|
||||||
restart:
|
|
||||||
# 开启热部署(更改文件后,自动重启)
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 9420
|
port: 9420
|
||||||
|
|||||||
@ -48,11 +48,6 @@ spring:
|
|||||||
host: localhost
|
host: localhost
|
||||||
port: 27017
|
port: 27017
|
||||||
database: rock-blade
|
database: rock-blade
|
||||||
# 热部署
|
|
||||||
devtools:
|
|
||||||
restart:
|
|
||||||
# 开启热部署(更改文件后,自动重启)
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 8420
|
port: 8420
|
||||||
|
|||||||
@ -84,6 +84,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|||||||
TASK.COMPLETION_DATE,
|
TASK.COMPLETION_DATE,
|
||||||
TASK.SUBJECT)
|
TASK.SUBJECT)
|
||||||
.from(TASK)
|
.from(TASK)
|
||||||
|
.where(TASK.TASK_TYPE.in(0, 1))
|
||||||
.and(TASK.TASK_STATUS.eq(bo.getIsFinish() ? 9 : 8).and(TASK.TASK_CONTENT.like(bo.getTaskContent())))
|
.and(TASK.TASK_STATUS.eq(bo.getIsFinish() ? 9 : 8).and(TASK.TASK_CONTENT.like(bo.getTaskContent())))
|
||||||
.and(TASK.SUBJECT.like(bo.getSubject())),
|
.and(TASK.SUBJECT.like(bo.getSubject())),
|
||||||
TaskArchivingPagVo.class,
|
TaskArchivingPagVo.class,
|
||||||
@ -115,12 +116,30 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setTaskArchiving(String taskId) {
|
public void setTaskArchiving(String taskId) {
|
||||||
|
//获取任务
|
||||||
|
Task task = this.getById(taskId);
|
||||||
this.updateChain()
|
this.updateChain()
|
||||||
.set(TASK.TASK_STATUS, 9)
|
.set(TASK.TASK_STATUS, 9)
|
||||||
.set(TASK.TASK_ITEM, 3)
|
.set(TASK.TASK_ITEM, 3)
|
||||||
.set(TASK.COMPLETION_DATE, LocalDate.now())
|
.set(TASK.COMPLETION_DATE, LocalDate.now())
|
||||||
.where(TASK.ID.eq(taskId))
|
.where(TASK.ID.eq(taskId))
|
||||||
.update();
|
.update();
|
||||||
|
// 企微通知手机号
|
||||||
|
List<String> phoneList = new ArrayList<String>();
|
||||||
|
StaffInfoVo responsibleStaff = SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
|
||||||
|
//字符串数组
|
||||||
|
String testStaffPhone = SpringUtils.getBean(RedisService.class).getCacheObject(OamConfigKey.OAM_CONFIG_KEY + OamConfigEnum.TEST_STAFF_PHONE.getKey());
|
||||||
|
phoneList.add(responsibleStaff.getPhoneNumber());
|
||||||
|
List<String> testPhoneList = Arrays.asList(testStaffPhone.split(","));
|
||||||
|
phoneList.addAll(testPhoneList);
|
||||||
|
try {
|
||||||
|
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.PRODUCT_BOT,
|
||||||
|
phoneList,
|
||||||
|
"==========开发任务更新==========" + "\n" + task.getTaskContent() + "\n" + "任务归档",
|
||||||
|
false);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new ServiceException("发送任务通知失败!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -386,6 +405,23 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|||||||
task.setToDeployTime(LocalDateTime.now()).setTestToFinishUrl(bo.getTestToFinishUrl()).setTaskStatus(8).setTaskItem(2);
|
task.setToDeployTime(LocalDateTime.now()).setTestToFinishUrl(bo.getTestToFinishUrl()).setTaskStatus(8).setTaskItem(2);
|
||||||
}
|
}
|
||||||
this.updateById(task);
|
this.updateById(task);
|
||||||
|
// 企微通知手机号
|
||||||
|
List<String> phoneList = new ArrayList<String>();
|
||||||
|
StaffInfoVo responsibleStaff = SpringUtils.getBean(StaffService.class).getStaffInfo(task.getResponsibleStaffId());
|
||||||
|
//字符串数组
|
||||||
|
String testStaffPhone = SpringUtils.getBean(RedisService.class).getCacheObject(OamConfigKey.OAM_CONFIG_KEY + OamConfigEnum.TEST_STAFF_PHONE.getKey());
|
||||||
|
phoneList.add(responsibleStaff.getPhoneNumber());
|
||||||
|
List<String> testPhoneList = Arrays.asList(testStaffPhone.split(","));
|
||||||
|
phoneList.addAll(testPhoneList);
|
||||||
|
try {
|
||||||
|
SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.PRODUCT_BOT,
|
||||||
|
phoneList,
|
||||||
|
"==========开发任务更新==========" + "\n" + task.getTaskContent() + "\n" +
|
||||||
|
(bo.getTaskItem() == 0 ? "开发转测试" : "测试转待部署"),
|
||||||
|
false);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new ServiceException("发送任务通知失败!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -534,6 +534,10 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
TaskWorkOrder workOrder = this.getById(bo.getWorkOrderId());
|
TaskWorkOrder workOrder = this.getById(bo.getWorkOrderId());
|
||||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||||
Task task = taskService.getById(workOrder.getTaskId());
|
Task task = taskService.getById(workOrder.getTaskId());
|
||||||
|
// 如果任务是在进行中没有逾期,重设定时任务
|
||||||
|
if (task.getTaskStatus() == 2) {
|
||||||
|
startOrUpdateWorkOrderOvertimeTask(bo.getWorkOrderId(), true, bo.getPauseExpireTime());
|
||||||
|
}
|
||||||
// 设定任务状态暂停
|
// 设定任务状态暂停
|
||||||
task.setTaskStatus(5);
|
task.setTaskStatus(5);
|
||||||
taskService.updateById(task);
|
taskService.updateById(task);
|
||||||
@ -557,10 +561,6 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException("发送消息通知失败!");
|
throw new ServiceException("发送消息通知失败!");
|
||||||
}
|
}
|
||||||
// 如果任务是在进行中没有逾期,重设定时任务
|
|
||||||
if (task.getTaskStatus() == 2) {
|
|
||||||
startOrUpdateWorkOrderOvertimeTask(bo.getWorkOrderId(), true, bo.getPauseExpireTime());
|
|
||||||
}
|
|
||||||
// 更新工单信息
|
// 更新工单信息
|
||||||
this.updateChain()
|
this.updateChain()
|
||||||
.set(TASK_WORK_ORDER.PAUSE_STAFF_ID, loginUserInfo.getString("id"))
|
.set(TASK_WORK_ORDER.PAUSE_STAFF_ID, loginUserInfo.getString("id"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user