新增 mq
This commit is contained in:
parent
5edb16da00
commit
efa1e480fd
|
|
@ -27,12 +27,12 @@ public abstract class MQTemplate {
|
|||
return existTraceId == null ? UUID.randomUUID().toString() : existTraceId;
|
||||
}
|
||||
|
||||
public void sendDelay(String destination, Object payload, long delayTime) {
|
||||
public void sendDelay(String destination, Object payload, int delayTime) {
|
||||
this.checkTopic(destination);
|
||||
this.sendDelayImpl(destination, payload, delayTime);
|
||||
}
|
||||
|
||||
protected abstract void sendDelayImpl(String destination, Object payload, long delayTime);
|
||||
protected abstract void sendDelayImpl(String destination, Object payload, int delayTime);
|
||||
|
||||
public void send(String destination, Object payload) {
|
||||
this.checkTopic(destination);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import java.lang.reflect.Type;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
//@Configuration
|
||||
@Configuration
|
||||
public class RabbitListenerConfiguration implements RabbitListenerConfigurer {
|
||||
private static final Logger log = LoggerFactory.getLogger(RabbitListenerConfiguration.class);
|
||||
public static final String REDELIVERED_TIMES_HEADER_NAME = "__redelivered_times";
|
||||
|
|
|
|||
|
|
@ -62,11 +62,6 @@ public class RabbitTemplate extends MQTemplate {
|
|||
this.sendInternal(false, destination, payload, (Map)null, (String)null, delayTime, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendDelayImpl(String destination, Object payload, long delayTime) {
|
||||
|
||||
}
|
||||
|
||||
public void sendImpl(String destination, Object payload) {
|
||||
this.sendInternal(true, destination, payload, (Map)null, (String)null, (Integer) null, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class TxCheckJobHandler extends IJobHandler {
|
|||
|
||||
if (transactionState == LocalTransactionState.COMMIT_MESSAGE) {
|
||||
if (message.getDelay() != null) {
|
||||
long time2Delay = LocalDateTime.now().until(message.getCreateTime().plus(message.getDelay(), ChronoUnit.MILLIS), ChronoUnit.MILLIS);
|
||||
int time2Delay = (int) LocalDateTime.now().until(message.getCreateTime().plus(message.getDelay(), ChronoUnit.MILLIS), ChronoUnit.MILLIS);
|
||||
if (time2Delay > 0L) {
|
||||
this.mqTemplate.sendDelay(message.getRoutingKey(), message.getPayload(), time2Delay);
|
||||
this.txMessageManager.afterSendSuccess(message.getId());
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class RocketTemplate extends MQTemplate {
|
|||
this.converter = messageConverter;
|
||||
}
|
||||
|
||||
public void sendDelayImpl(String destination, Object payload, long delayTime) {
|
||||
public void sendDelayImpl(String destination, Object payload, int delayTime) {
|
||||
Message<?> message = MessageBuilder.withPayload(payload).setHeader("X-Trace-Id", this.getTraceId()).build();
|
||||
SendResult sendResult = this.rocketMQTemplate.syncSendDelayTimeMills(destination, message, delayTime);
|
||||
if (sendResult.getSendStatus() != SendStatus.SEND_OK) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package com.bonus.core.allocation.advise.constants;
|
||||
|
||||
public enum AllocFunctionTypeEnum {
|
||||
FIRST_EDITION(1, "初版"),
|
||||
CUSTOM(2, "自定义");
|
||||
|
||||
private final Integer key;
|
||||
private final String value;
|
||||
|
||||
private AllocFunctionTypeEnum(Integer key, String value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Integer getKey(String value) {
|
||||
AllocFunctionTypeEnum[] enums = values();
|
||||
AllocFunctionTypeEnum[] var2 = enums;
|
||||
int var3 = enums.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
AllocFunctionTypeEnum temp = var2[var4];
|
||||
if (temp.getValue().equals(value)) {
|
||||
return temp.getKey();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getValue(Integer key) {
|
||||
AllocFunctionTypeEnum[] enums = values();
|
||||
AllocFunctionTypeEnum[] var2 = enums;
|
||||
int var3 = enums.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
AllocFunctionTypeEnum temp = var2[var4];
|
||||
if (temp.getKey().equals(key)) {
|
||||
return temp.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
package com.bonus.core.allocation.advise.controller;
|
||||
|
||||
import com.bonus.core.allocation.advise.dto.EvaluateAddDTO;
|
||||
import com.bonus.core.allocation.advise.model.AllocPageDecorationModel;
|
||||
import com.bonus.core.allocation.advise.service.AllocPageDecorationService;
|
||||
import com.bonus.core.allocation.advise.service.BasicsCanteenEvaluateService;
|
||||
import com.bonus.core.allocation.constants.CanteenConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/api/v1/canteen/evaluate"})
|
||||
@Api("食堂档口评价控制")
|
||||
public class BasicsCanteenEvaluateController {
|
||||
private static final Logger log = LoggerFactory.getLogger(BasicsCanteenEvaluateController.class);
|
||||
@Lazy
|
||||
@Autowired
|
||||
private BasicsCanteenEvaluateService basicsCanteenEvaluateService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private AllocPageDecorationService allocPageDecorationService;
|
||||
// @Autowired
|
||||
// @Lazy
|
||||
// protected ExportApi exportApi;
|
||||
|
||||
// @ApiOperation("分页查询评价信息")
|
||||
// @PostMapping({"/page"})
|
||||
// @RequiresAuthentication
|
||||
// public PageVO<EvaluateQueryVO> queryEvaluateByPage(@RequestBody @Valid LeRequest<EvaluateQueryDTO> request) {
|
||||
// return this.basicsCanteenEvaluateService.queryEvaluateByPage((EvaluateQueryDTO)request.getContent());
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("导出查询评价信息")
|
||||
// @PostMapping({"/export/page"})
|
||||
// public void exportEvaluateByPage(@RequestBody @Valid LeRequest<EvaluateQueryDTO> request, HttpServletResponse response) throws IOException {
|
||||
// ((EvaluateQueryDTO)request.getContent()).setSize(-1L);
|
||||
// PageVO<EvaluateQueryVO> evaluateQueryVOPage = this.basicsCanteenEvaluateService.queryEvaluateByPage((EvaluateQueryDTO)request.getContent());
|
||||
// EasyExcelUtil.writeExcelByDownLoad(response, "食堂评价", EvaluateQueryVO.class, "详情", evaluateQueryVOPage.getRecords(), Collections.singletonList(new CustomLocalDateConverter()));
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("查询单条食堂评价详情")
|
||||
// @PostMapping({"/get-evaluate-detail"})
|
||||
// public CanteenEvaluateDetailModel getEvaluateDetail(@RequestBody LeRequest<Long> request) {
|
||||
// return this.basicsCanteenEvaluateService.getEvaluateDetail((Long)request.getContent());
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("分页查询食堂评价统计")
|
||||
// @PostMapping({"/page-evaluate-count"})
|
||||
// public CanteenEvaluateCountModel pageEvaluateCount(@RequestBody LeRequest<EvaluateQueryDTO> request) {
|
||||
// return this.basicsCanteenEvaluateService.pageEvaluateCount((EvaluateQueryDTO)request.getContent());
|
||||
// }
|
||||
|
||||
@ApiOperation("新增食堂评价")
|
||||
@PostMapping({"/addEvaluate"})
|
||||
// @RequiresGuest
|
||||
public void addEvaluate(@RequestBody @Valid EvaluateAddDTO request) {
|
||||
this.basicsCanteenEvaluateService.addEvaluate(request);
|
||||
}
|
||||
|
||||
@ApiOperation("查询食堂评价页面装修")
|
||||
@PostMapping({"/query-page-decoration"})
|
||||
public List<AllocPageDecorationModel> queryPageDecoration() {
|
||||
return this.allocPageDecorationService.queryPageDecoration(CanteenConstants.PAGE_CANTEEN_EVALUATE);
|
||||
}
|
||||
|
||||
// @ApiOperation("查询食堂评价页面装修初版数据")
|
||||
// @PostMapping({"/query-init-page-first"})
|
||||
// public List<AllocPageDecorationModel> queryFirstPageDecoration(@RequestBody LeRequest<Void> request) {
|
||||
// return this.allocPageDecorationService.queryFirstPageDecoration(CanteenConstants.PAGE_CANTEEN_EVALUATE);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("保存食堂评价页面装修")
|
||||
// @PostMapping({"/save-page-decoration"})
|
||||
// public void savePageDecoration(@RequestBody @Valid LeRequest<List<AllocPageDecorationModel>> request) {
|
||||
// this.allocPageDecorationService.savePageDecoration((List)request.getContent());
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("食堂评价异步导出")
|
||||
// @PostMapping({"/export/async"})
|
||||
// public LeResponse<Object> backStaffEmployeeExport(@RequestBody @Valid LeRequest<EvaluateQueryDTO> request) {
|
||||
// PageDTO page = (PageDTO)request.getContent();
|
||||
// EvaluateQueryDTO evaluateQueryDTO = (EvaluateQueryDTO)request.getContent();
|
||||
// this.exportApi.startExcelExportTaskByPage("评价管理", "食堂评价", EvaluateQueryVO.class, evaluateQueryDTO.getExportCols(), page, (Object)null, () -> {
|
||||
// return this.basicsCanteenEvaluateService.queryEvaluateByPage((EvaluateQueryDTO)request.getContent());
|
||||
// });
|
||||
// return LeResponse.succ();
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
package com.bonus.core.allocation.advise.dto;
|
||||
|
||||
import com.bonus.core.allocation.advise.model.BasicsCanteenEvaluate;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("食堂评价入参")
|
||||
public class EvaluateAddDTO {
|
||||
@ApiModelProperty("人员id")
|
||||
private @NotNull(
|
||||
message = "人员id, 不能为空"
|
||||
) Long custId;
|
||||
@ApiModelProperty("食堂id")
|
||||
private @NotNull(
|
||||
message = "食堂id, 不能为空"
|
||||
) Long canteenId;
|
||||
@ApiModelProperty("档口id")
|
||||
private @NotNull(
|
||||
message = "档口id, 不能为空"
|
||||
) Long shopstallId;
|
||||
@ApiModelProperty("食堂评价详情集合")
|
||||
private List<AddCanteenEvaluateDetailDTO> evaluateDetailList;
|
||||
@ApiModelProperty("意见和建议")
|
||||
private String proposal;
|
||||
|
||||
public void convertData(BasicsCanteenEvaluate basicsCanteenEvaluate) {
|
||||
Iterator var2 = this.getEvaluateDetailList().iterator();
|
||||
|
||||
while(var2.hasNext()) {
|
||||
AddCanteenEvaluateDetailDTO detailModel = (AddCanteenEvaluateDetailDTO)var2.next();
|
||||
switch (detailModel.getFunctionId()) {
|
||||
case 1:
|
||||
basicsCanteenEvaluate.setAppearance(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 2:
|
||||
basicsCanteenEvaluate.setAttitude(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 3:
|
||||
basicsCanteenEvaluate.setTaste(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 4:
|
||||
basicsCanteenEvaluate.setVarieties(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 5:
|
||||
basicsCanteenEvaluate.setHygiene(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 6:
|
||||
basicsCanteenEvaluate.setPrice(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 7:
|
||||
basicsCanteenEvaluate.setWeight(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 8:
|
||||
basicsCanteenEvaluate.setCustomize1(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 9:
|
||||
basicsCanteenEvaluate.setCustomize2(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 10:
|
||||
basicsCanteenEvaluate.setCustomize3(new BigDecimal(detailModel.getContent()));
|
||||
break;
|
||||
case 11:
|
||||
basicsCanteenEvaluate.setCustomizeText1(detailModel.getContent());
|
||||
break;
|
||||
case 12:
|
||||
basicsCanteenEvaluate.setCustomizeText2(detailModel.getContent());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public Long getCanteenId() {
|
||||
return this.canteenId;
|
||||
}
|
||||
|
||||
public Long getShopstallId() {
|
||||
return this.shopstallId;
|
||||
}
|
||||
|
||||
public List<AddCanteenEvaluateDetailDTO> getEvaluateDetailList() {
|
||||
return this.evaluateDetailList;
|
||||
}
|
||||
|
||||
public String getProposal() {
|
||||
return this.proposal;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setCanteenId(final Long canteenId) {
|
||||
this.canteenId = canteenId;
|
||||
}
|
||||
|
||||
public void setShopstallId(final Long shopstallId) {
|
||||
this.shopstallId = shopstallId;
|
||||
}
|
||||
|
||||
public void setEvaluateDetailList(final List<AddCanteenEvaluateDetailDTO> evaluateDetailList) {
|
||||
this.evaluateDetailList = evaluateDetailList;
|
||||
}
|
||||
|
||||
public void setProposal(final String proposal) {
|
||||
this.proposal = proposal;
|
||||
}
|
||||
|
||||
|
||||
@ApiModel("食堂评价详情 Model")
|
||||
public static class AddCanteenEvaluateDetailDTO {
|
||||
@ApiModelProperty("功能标识")
|
||||
private Integer functionId;
|
||||
@ApiModelProperty("内容")
|
||||
private String content;
|
||||
|
||||
public Integer getFunctionId() {
|
||||
return this.functionId;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return this.content;
|
||||
}
|
||||
|
||||
public void setFunctionId(final Integer functionId) {
|
||||
this.functionId = functionId;
|
||||
}
|
||||
|
||||
public void setContent(final String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.bonus.core.allocation.advise.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.allocation.advise.model.AllocPageDecoration;
|
||||
import com.bonus.core.allocation.advise.model.AllocPageDecorationModel;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AllocPageDecorationMapper extends BaseMapper<AllocPageDecoration> {
|
||||
@Select({"SELECT position_id, function_id, function_name, content_type FROM alloc_page_decoration WHERE apply_page = #{applyPage} AND function_type = #{functionType}"})
|
||||
List<AllocPageDecorationModel> queryPageDecoration(@Param("applyPage") Integer applyPage, @Param("functionType") Integer functionType);
|
||||
|
||||
@Delete({"DELETE FROM alloc_page_decoration WHERE apply_page = #{applyPage} AND function_type = #{functionType}"})
|
||||
void removeByApplyPage(@Param("applyPage") Integer applyPage, @Param("functionType") Integer functionType);
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.core.allocation.advise.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bonus.core.allocation.advise.model.BasicsCanteenEvaluate;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface BasicsCanteenEvaluateMapper extends BaseMapper<BasicsCanteenEvaluate> {
|
||||
// @LeNiuDataPermission(
|
||||
// alias = "t4",
|
||||
// permissionType = DataPermissionTypeEnum.PERMISSION_CANTEEN_STALL
|
||||
// )
|
||||
// List<EvaluateQueryVO> queryEvaluateByPage(@Param("dto") EvaluateQueryDTO evaluateQueryDTO);
|
||||
//
|
||||
// @LeNiuDataPermission(
|
||||
// alias = "t3",
|
||||
// permissionType = DataPermissionTypeEnum.PERMISSION_CANTEEN_STALL
|
||||
// )
|
||||
// Page<CanteenEvaluateCountVO> pageEvaluateCount(Page page, @Param("dto") EvaluateQueryDTO pageDTO);
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
package com.bonus.core.allocation.advise.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("alloc_page_decoration")
|
||||
@ApiModel("页面装修表")
|
||||
public class AllocPageDecoration {
|
||||
@TableId
|
||||
@ApiModelProperty("主键id")
|
||||
private Long decorationId;
|
||||
@ApiModelProperty("位置id")
|
||||
private Integer positionId;
|
||||
@ApiModelProperty("功能标识")
|
||||
private Integer functionId;
|
||||
@ApiModelProperty("功能名称")
|
||||
private String functionName;
|
||||
@ApiModelProperty("数据类型")
|
||||
private Integer functionType;
|
||||
@ApiModelProperty("内容类型")
|
||||
private Integer contentType;
|
||||
@ApiModelProperty("适用页面")
|
||||
private Integer applyPage;
|
||||
@ApiModelProperty("创建人")
|
||||
private String crby;
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime crtime;
|
||||
@ApiModelProperty("更新人")
|
||||
private String upby;
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime uptime;
|
||||
|
||||
public Long getDecorationId() {
|
||||
return this.decorationId;
|
||||
}
|
||||
|
||||
public Integer getPositionId() {
|
||||
return this.positionId;
|
||||
}
|
||||
|
||||
public Integer getFunctionId() {
|
||||
return this.functionId;
|
||||
}
|
||||
|
||||
public String getFunctionName() {
|
||||
return this.functionName;
|
||||
}
|
||||
|
||||
public Integer getFunctionType() {
|
||||
return this.functionType;
|
||||
}
|
||||
|
||||
public Integer getContentType() {
|
||||
return this.contentType;
|
||||
}
|
||||
|
||||
public Integer getApplyPage() {
|
||||
return this.applyPage;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public void setDecorationId(final Long decorationId) {
|
||||
this.decorationId = decorationId;
|
||||
}
|
||||
|
||||
public void setPositionId(final Integer positionId) {
|
||||
this.positionId = positionId;
|
||||
}
|
||||
|
||||
public void setFunctionId(final Integer functionId) {
|
||||
this.functionId = functionId;
|
||||
}
|
||||
|
||||
public void setFunctionName(final String functionName) {
|
||||
this.functionName = functionName;
|
||||
}
|
||||
|
||||
public void setFunctionType(final Integer functionType) {
|
||||
this.functionType = functionType;
|
||||
}
|
||||
|
||||
public void setContentType(final Integer contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
public void setApplyPage(final Integer applyPage) {
|
||||
this.applyPage = applyPage;
|
||||
}
|
||||
|
||||
public void setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.bonus.core.allocation.advise.model;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public class AllocPageDecorationModel {
|
||||
@ApiModelProperty("位置id")
|
||||
private @NotNull(
|
||||
message = "位置id 不能为空"
|
||||
) Integer positionId;
|
||||
@ApiModelProperty("功能标识")
|
||||
private @NotNull(
|
||||
message = "功能标识 不能为空"
|
||||
) Integer functionId;
|
||||
@ApiModelProperty("功能名称")
|
||||
private @NotBlank(
|
||||
message = "功能名称 不能为空"
|
||||
) String functionName;
|
||||
@ApiModelProperty("内容类型")
|
||||
private Integer contentType;
|
||||
|
||||
public Integer getPositionId() {
|
||||
return this.positionId;
|
||||
}
|
||||
|
||||
public Integer getFunctionId() {
|
||||
return this.functionId;
|
||||
}
|
||||
|
||||
public String getFunctionName() {
|
||||
return this.functionName;
|
||||
}
|
||||
|
||||
public Integer getContentType() {
|
||||
return this.contentType;
|
||||
}
|
||||
|
||||
public void setPositionId(final Integer positionId) {
|
||||
this.positionId = positionId;
|
||||
}
|
||||
|
||||
public void setFunctionId(final Integer functionId) {
|
||||
this.functionId = functionId;
|
||||
}
|
||||
|
||||
public void setFunctionName(final String functionName) {
|
||||
this.functionName = functionName;
|
||||
}
|
||||
|
||||
public void setContentType(final Integer contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,260 @@
|
|||
package com.bonus.core.allocation.advise.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("basics_canteen_evaluate")
|
||||
@ApiModel("食堂评价")
|
||||
public class BasicsCanteenEvaluate {
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
@ApiModelProperty("评价ID")
|
||||
private Long evaluateId;
|
||||
@ApiModelProperty("人员ID")
|
||||
private Long custId;
|
||||
@ApiModelProperty("食堂ID")
|
||||
private Long canteenId;
|
||||
@ApiModelProperty("档口ID")
|
||||
private Long shopstallId;
|
||||
@ApiModelProperty("评价日期")
|
||||
private LocalDate evaluateDate;
|
||||
@ApiModelProperty(" 仪容仪表评分")
|
||||
private BigDecimal appearance;
|
||||
@ApiModelProperty("员工服务态度评分")
|
||||
private BigDecimal attitude;
|
||||
@ApiModelProperty("菜品口味评分")
|
||||
private BigDecimal taste;
|
||||
@ApiModelProperty("菜肴花色品种评分")
|
||||
private BigDecimal varieties;
|
||||
@ApiModelProperty("菜肴食品卫生评分")
|
||||
private BigDecimal hygiene;
|
||||
@ApiModelProperty("饭菜价格评分")
|
||||
private BigDecimal price;
|
||||
@ApiModelProperty("饭菜份量评分")
|
||||
private BigDecimal weight;
|
||||
@ApiModelProperty("自定义评分1")
|
||||
private BigDecimal customize1;
|
||||
@ApiModelProperty("自定义评分2")
|
||||
private BigDecimal customize2;
|
||||
@ApiModelProperty("自定义评分3")
|
||||
private BigDecimal customize3;
|
||||
@ApiModelProperty("自定义文本1")
|
||||
private String customizeText1;
|
||||
@ApiModelProperty("自定义文本2")
|
||||
private String customizeText2;
|
||||
@ApiModelProperty("意见和建议")
|
||||
private String proposal;
|
||||
private Integer revision;
|
||||
@TableField(
|
||||
value = "crby",
|
||||
fill = FieldFill.INSERT
|
||||
)
|
||||
private String crby;
|
||||
private LocalDateTime crtime;
|
||||
@TableField(
|
||||
value = "upby",
|
||||
fill = FieldFill.UPDATE
|
||||
)
|
||||
private String upby;
|
||||
private LocalDateTime uptime;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getEvaluateId() {
|
||||
return this.evaluateId;
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public Long getCanteenId() {
|
||||
return this.canteenId;
|
||||
}
|
||||
|
||||
public Long getShopstallId() {
|
||||
return this.shopstallId;
|
||||
}
|
||||
|
||||
public LocalDate getEvaluateDate() {
|
||||
return this.evaluateDate;
|
||||
}
|
||||
|
||||
public BigDecimal getAppearance() {
|
||||
return this.appearance;
|
||||
}
|
||||
|
||||
public BigDecimal getAttitude() {
|
||||
return this.attitude;
|
||||
}
|
||||
|
||||
public BigDecimal getTaste() {
|
||||
return this.taste;
|
||||
}
|
||||
|
||||
public BigDecimal getVarieties() {
|
||||
return this.varieties;
|
||||
}
|
||||
|
||||
public BigDecimal getHygiene() {
|
||||
return this.hygiene;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return this.price;
|
||||
}
|
||||
|
||||
public BigDecimal getWeight() {
|
||||
return this.weight;
|
||||
}
|
||||
|
||||
public BigDecimal getCustomize1() {
|
||||
return this.customize1;
|
||||
}
|
||||
|
||||
public BigDecimal getCustomize2() {
|
||||
return this.customize2;
|
||||
}
|
||||
|
||||
public BigDecimal getCustomize3() {
|
||||
return this.customize3;
|
||||
}
|
||||
|
||||
public String getCustomizeText1() {
|
||||
return this.customizeText1;
|
||||
}
|
||||
|
||||
public String getCustomizeText2() {
|
||||
return this.customizeText2;
|
||||
}
|
||||
|
||||
public String getProposal() {
|
||||
return this.proposal;
|
||||
}
|
||||
|
||||
public Integer getRevision() {
|
||||
return this.revision;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setEvaluateId(final Long evaluateId) {
|
||||
this.evaluateId = evaluateId;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setCanteenId(final Long canteenId) {
|
||||
this.canteenId = canteenId;
|
||||
}
|
||||
|
||||
public void setShopstallId(final Long shopstallId) {
|
||||
this.shopstallId = shopstallId;
|
||||
}
|
||||
|
||||
public void setEvaluateDate(final LocalDate evaluateDate) {
|
||||
this.evaluateDate = evaluateDate;
|
||||
}
|
||||
|
||||
public void setAppearance(final BigDecimal appearance) {
|
||||
this.appearance = appearance;
|
||||
}
|
||||
|
||||
public void setAttitude(final BigDecimal attitude) {
|
||||
this.attitude = attitude;
|
||||
}
|
||||
|
||||
public void setTaste(final BigDecimal taste) {
|
||||
this.taste = taste;
|
||||
}
|
||||
|
||||
public void setVarieties(final BigDecimal varieties) {
|
||||
this.varieties = varieties;
|
||||
}
|
||||
|
||||
public void setHygiene(final BigDecimal hygiene) {
|
||||
this.hygiene = hygiene;
|
||||
}
|
||||
|
||||
public void setPrice(final BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public void setWeight(final BigDecimal weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setCustomize1(final BigDecimal customize1) {
|
||||
this.customize1 = customize1;
|
||||
}
|
||||
|
||||
public void setCustomize2(final BigDecimal customize2) {
|
||||
this.customize2 = customize2;
|
||||
}
|
||||
|
||||
public void setCustomize3(final BigDecimal customize3) {
|
||||
this.customize3 = customize3;
|
||||
}
|
||||
|
||||
public void setCustomizeText1(final String customizeText1) {
|
||||
this.customizeText1 = customizeText1;
|
||||
}
|
||||
|
||||
public void setCustomizeText2(final String customizeText2) {
|
||||
this.customizeText2 = customizeText2;
|
||||
}
|
||||
|
||||
public void setProposal(final String proposal) {
|
||||
this.proposal = proposal;
|
||||
}
|
||||
|
||||
public void setRevision(final Integer revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public void setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.bonus.core.allocation.advise.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.core.allocation.advise.constants.AllocFunctionTypeEnum;
|
||||
import com.bonus.core.allocation.advise.mapper.AllocPageDecorationMapper;
|
||||
import com.bonus.core.allocation.advise.model.AllocPageDecoration;
|
||||
import com.bonus.core.allocation.advise.model.AllocPageDecorationModel;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.invoke.SerializedLambda;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AllocPageDecorationService extends ServiceImpl<AllocPageDecorationMapper, AllocPageDecoration> {
|
||||
private static final Logger log = LoggerFactory.getLogger(AllocPageDecorationService.class);
|
||||
|
||||
public List<AllocPageDecorationModel> queryPageDecoration(Integer applyPage) {
|
||||
List<AllocPageDecorationModel> decorationModelList = ((AllocPageDecorationMapper)this.baseMapper)
|
||||
.queryPageDecoration(applyPage, AllocFunctionTypeEnum.CUSTOM.getKey());
|
||||
return CollUtil.isNotEmpty(decorationModelList) ? decorationModelList : this.getInitModelList(applyPage, true);
|
||||
}
|
||||
|
||||
// public List<AllocPageDecorationModel> queryFirstPageDecoration(Integer applyPage) {
|
||||
// return this.getInitModelList(applyPage, false);
|
||||
// }
|
||||
|
||||
private List<AllocPageDecorationModel> getInitModelList(Integer applyPage, boolean filterFlag) {
|
||||
List<AllocPageDecorationModel> initModelList = ((AllocPageDecorationMapper)this.baseMapper)
|
||||
.queryPageDecoration(applyPage, AllocFunctionTypeEnum.FIRST_EDITION.getKey());
|
||||
if (!filterFlag) {
|
||||
return initModelList;
|
||||
} else {
|
||||
initModelList.removeIf((decorationModel) -> {
|
||||
return decorationModel.getFunctionName().contains("自定义");
|
||||
});
|
||||
return initModelList;
|
||||
}
|
||||
}
|
||||
//
|
||||
// public void savePageDecoration(List<AllocPageDecorationModel> decorationModelList) {
|
||||
// if (CollUtil.isEmpty(decorationModelList)) {
|
||||
// throw new LeException(I18n.getMessage("alloc_page_decoration_no_content", new Object[0]));
|
||||
// } else {
|
||||
// ((AllocPageDecorationMapper)this.baseMapper).removeByApplyPage(CanteenConstants.PAGE_CANTEEN_EVALUATE, AllocFunctionTypeEnum.CUSTOM.getKey());
|
||||
// List<AllocPageDecoration> addList = Lists.newArrayList();
|
||||
// Iterator var3 = decorationModelList.iterator();
|
||||
//
|
||||
// while(var3.hasNext()) {
|
||||
// AllocPageDecorationModel decorationModel = (AllocPageDecorationModel)var3.next();
|
||||
// AllocPageDecoration addDecoration = new AllocPageDecoration();
|
||||
// LeBeanUtil.copyProperties(decorationModel, addDecoration);
|
||||
// addDecoration.setDecorationId(Id.next());
|
||||
// addDecoration.setFunctionType(AllocFunctionTypeEnum.CUSTOM.getKey());
|
||||
// addList.add(addDecoration);
|
||||
// this.update((Wrapper)((LambdaUpdateWrapper)((LambdaUpdateWrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(AllocPageDecoration.class).set(AllocPageDecoration::getFunctionName, decorationModel.getFunctionName())).eq(AllocPageDecoration::getApplyPage, CanteenConstants.PAGE_CANTEEN_EVALUATE)).eq(AllocPageDecoration::getFunctionType, AllocFunctionTypeEnum.FIRST_EDITION.getKey())).eq(AllocPageDecoration::getFunctionId, decorationModel.getFunctionId()));
|
||||
// }
|
||||
//
|
||||
// this.saveBatch(addList);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.core.allocation.advise.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bonus.core.allocation.advise.dto.EvaluateAddDTO;
|
||||
import com.bonus.core.allocation.advise.model.BasicsCanteenEvaluate;
|
||||
|
||||
public interface BasicsCanteenEvaluateService extends IService<BasicsCanteenEvaluate> {
|
||||
// PageVO<EvaluateQueryVO> queryEvaluateByPage(EvaluateQueryDTO evaluateQueryDTO);
|
||||
//
|
||||
// CanteenEvaluateDetailModel getEvaluateDetail(Long evaluateId);
|
||||
//
|
||||
// CanteenEvaluateCountModel pageEvaluateCount(EvaluateQueryDTO pageDTO);
|
||||
|
||||
void addEvaluate(EvaluateAddDTO addDTO);
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.bonus.core.allocation.advise.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.core.allocation.advise.dto.EvaluateAddDTO;
|
||||
import com.bonus.core.allocation.advise.mapper.BasicsCanteenEvaluateMapper;
|
||||
import com.bonus.core.allocation.advise.model.BasicsCanteenEvaluate;
|
||||
import com.bonus.core.allocation.advise.service.BasicsCanteenEvaluateService;
|
||||
import com.bonus.utils.id.Id;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.invoke.SerializedLambda;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class BasicsCanteenEvaluateServiceImpl extends ServiceImpl<BasicsCanteenEvaluateMapper, BasicsCanteenEvaluate> implements BasicsCanteenEvaluateService {
|
||||
private static final Logger log = LoggerFactory.getLogger(BasicsCanteenEvaluateServiceImpl.class);
|
||||
// @Autowired
|
||||
// @Lazy
|
||||
// private AllocPageDecorationService allocPageDecorationService;
|
||||
// @ApiModelProperty
|
||||
// @Autowired
|
||||
// private AllocCanteenApi allocCanteenApi;
|
||||
|
||||
// public PageVO<EvaluateQueryVO> queryEvaluateByPage(EvaluateQueryDTO evaluateQueryDTO) {
|
||||
// if (CollUtil.isNotEmpty(evaluateQueryDTO.getAreaIdList()) && ObjectUtil.isEmpty(evaluateQueryDTO.getCanteenIdList())) {
|
||||
// evaluateQueryDTO.setCanteenIdList(this.allocCanteenApi.getCanteenIdListByAreaIdList((List)evaluateQueryDTO.getAreaIdList()));
|
||||
// }
|
||||
//
|
||||
// PageHelper.startPage(evaluateQueryDTO);
|
||||
// List<EvaluateQueryVO> resultList = ((BasicsCanteenEvaluateMapper)this.baseMapper).queryEvaluateByPage(evaluateQueryDTO);
|
||||
// return PageVO.of(resultList);
|
||||
// }
|
||||
//
|
||||
// public CanteenEvaluateDetailModel getEvaluateDetail(Long evaluateId) {
|
||||
// BasicsCanteenEvaluate canteenEvaluate = (BasicsCanteenEvaluate)this.getOne((Wrapper)Wrappers.lambdaQuery(BasicsCanteenEvaluate.class).eq(BasicsCanteenEvaluate::getEvaluateId, evaluateId));
|
||||
// List<AllocPageDecorationModel> decorationList = this.allocPageDecorationService.queryPageDecoration(CanteenConstants.PAGE_CANTEEN_EVALUATE);
|
||||
// CanteenEvaluateDetailModel detailModel = new CanteenEvaluateDetailModel();
|
||||
// detailModel.convertTitle(decorationList);
|
||||
// detailModel.convertData(canteenEvaluate);
|
||||
// return detailModel;
|
||||
// }
|
||||
//
|
||||
// public CanteenEvaluateCountModel pageEvaluateCount(EvaluateQueryDTO pageDTO) {
|
||||
// if (CollUtil.isNotEmpty(pageDTO.getAreaIdList()) && ObjectUtil.isEmpty(pageDTO.getCanteenIdList())) {
|
||||
// List<Long> canteenIdListByAreaIdList = this.allocCanteenApi.getCanteenIdListByAreaIdList((List)pageDTO.getAreaIdList());
|
||||
// if (ObjectUtil.isEmpty(canteenIdListByAreaIdList)) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// pageDTO.setCanteenIdList(this.allocCanteenApi.getCanteenIdListByAreaIdList((List)pageDTO.getAreaIdList()));
|
||||
// }
|
||||
//
|
||||
// Page page = new Page(pageDTO.getCurrent(), pageDTO.getSize());
|
||||
// Page<CanteenEvaluateCountVO> countVOPage = ((BasicsCanteenEvaluateMapper)this.baseMapper).pageEvaluateCount(page, pageDTO);
|
||||
// CanteenEvaluateCountModel countModel = new CanteenEvaluateCountModel();
|
||||
// if (CollUtil.isEmpty(countVOPage.getRecords())) {
|
||||
// return countModel;
|
||||
// } else {
|
||||
// List<AllocPageDecorationModel> decorationList = this.allocPageDecorationService.queryPageDecoration(CanteenConstants.PAGE_CANTEEN_EVALUATE);
|
||||
// Iterator<AllocPageDecorationModel> it = decorationList.iterator();
|
||||
//
|
||||
// while(it.hasNext()) {
|
||||
// AllocPageDecorationModel decorationModel = (AllocPageDecorationModel)it.next();
|
||||
// if (LeConstants.COMMON_NO.equals(decorationModel.getContentType())) {
|
||||
// it.remove();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// countModel.convertTitle(decorationList);
|
||||
// countModel.convertData(countVOPage);
|
||||
// return countModel;
|
||||
// }
|
||||
// }
|
||||
|
||||
public void addEvaluate(EvaluateAddDTO addDTO) {
|
||||
BasicsCanteenEvaluate basicsCanteenEvaluate = new BasicsCanteenEvaluate();
|
||||
BeanUtils.copyProperties(addDTO, basicsCanteenEvaluate);
|
||||
basicsCanteenEvaluate.setEvaluateId(Id.next());
|
||||
basicsCanteenEvaluate.setEvaluateDate(LocalDate.now());
|
||||
addDTO.convertData(basicsCanteenEvaluate);
|
||||
this.save(basicsCanteenEvaluate);
|
||||
}
|
||||
|
||||
// $FF: synthetic method
|
||||
// private static Object $deserializeLambda$(SerializedLambda lambda) {
|
||||
// switch (lambda.getImplMethodName()) {
|
||||
// case "getEvaluateId":
|
||||
// if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/allocation/advise/model/BasicsCanteenEvaluate") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
||||
// return BasicsCanteenEvaluate::getEvaluateId;
|
||||
// }
|
||||
// default:
|
||||
// throw new IllegalArgumentException("Invalid lambda deserialization");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.bonus.core.allocation.constants;
|
||||
|
||||
public interface CanteenConstants {
|
||||
String INIT_NUM = "01";
|
||||
String LINE_THROUGH = "-";
|
||||
Integer PAGE_CANTEEN_EVALUATE = 1;
|
||||
String DEFAULT_AREA_NUM = "99";
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
package com.bonus.core.data.dataset;
|
||||
|
||||
import com.bonus.core.data.dataset.rule.RoutingRule;
|
||||
import com.bonus.core.data.dataset.rule.loader.RouterLoader;
|
||||
import com.bonus.core.data.dataset.tx.XDataSourceTransactionManager;
|
||||
import com.bonus.core.data.dataset.tx.XJdbcTransactionManager;
|
||||
import com.bonus.core.tenant.TenantLoader;
|
||||
import com.google.common.collect.Sets;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
//@AutoConfiguration(
|
||||
// before = {DataSourceAutoConfiguration.class}
|
||||
//)
|
||||
//@EnableConfigurationProperties({RoutingDataSourceProperties.class})
|
||||
@Configuration
|
||||
public class RoutingDataSourceAutoConfiguration implements ApplicationContextAware {
|
||||
private static ApplicationContext applicationContext;
|
||||
|
||||
public RoutingDataSourceAutoConfiguration(ObjectProvider<RouterLoader> routerLoaderProvider,
|
||||
ObjectProvider<TenantLoader> tenantLoaderObjectProvider
|
||||
) {
|
||||
RoutingRule.setRouterLoader(routerLoaderProvider.getIfAvailable(() -> {
|
||||
return (key) -> {
|
||||
return null;
|
||||
};
|
||||
}));
|
||||
Executors.tenantLoader = tenantLoaderObjectProvider.getIfAvailable(() -> {
|
||||
return () -> {
|
||||
return Sets.newHashSetWithExpectedSize(0);
|
||||
};
|
||||
});
|
||||
// DatasetMigration.redissonClient = redissonClient;
|
||||
}
|
||||
|
||||
// @ConditionalOnMissingBean
|
||||
// @Bean
|
||||
// public RoutingDataSource routingDataSource(RoutingDataSourceProperties routingDataSourceProperties, ObjectProvider<DataSourceLoader> dataSourceLoaderProviderLoaderProvider, ObjectProvider<MigrationProvider> migrationProviderObjectProvider, ObjectProvider<List<AbstractDataMigrator>> dataMigrateObjectProvider) {
|
||||
// RoutingDataSource routingDataSource = new RoutingDataSource(routingDataSourceProperties.systemDatasource(), routingDataSourceProperties.globalTsDatasource(), routingDataSourceProperties.businessDatasource(), routingDataSourceProperties.getDynamicBusinessConfig(), (DataSourceLoader)dataSourceLoaderProviderLoaderProvider.getIfAvailable(() -> {
|
||||
// return null;
|
||||
// }));
|
||||
// DatasetMigration.routingDataSource = routingDataSource;
|
||||
// DatasetMigration.migrationProvider = (MigrationProvider)migrationProviderObjectProvider.getIfUnique(DefaultMigrationProvider::new);
|
||||
// DatasetMigration.locationRefDataMigrates = dataMigrateObjectProvider.getIfAvailable() == null ? Collections.emptyMap() : (Map)((List)dataMigrateObjectProvider.getIfAvailable()).stream().collect(Collectors.groupingBy(AbstractDataMigrator::getLocation));
|
||||
// return routingDataSource;
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// @ConditionalOnMissingBean({TransactionManager.class})
|
||||
// public DataSourceTransactionManager transactionManager(Environment environment, DataSource dataSource, ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
|
||||
// return this.newTransactionManager(environment, dataSource, transactionManagerCustomizers);
|
||||
// }
|
||||
|
||||
private DataSourceTransactionManager newTransactionManager(Environment environment, DataSource dataSource, ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
|
||||
DataSourceTransactionManager transactionManager = this.createTransactionManager(environment, dataSource);
|
||||
transactionManagerCustomizers.ifAvailable((customizers) -> {
|
||||
customizers.customize(transactionManager);
|
||||
});
|
||||
return transactionManager;
|
||||
}
|
||||
|
||||
private DataSourceTransactionManager createTransactionManager(Environment environment, DataSource dataSource) {
|
||||
return environment.getProperty("spring.dao.exceptiontranslation.enabled", Boolean.class, Boolean.TRUE)
|
||||
? new XJdbcTransactionManager(dataSource) : new XDataSourceTransactionManager(dataSource);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public TransactionTemplate transactionTemplate(DataSourceTransactionManager transactionManager) {
|
||||
TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager);
|
||||
transactionTemplate.setPropagationBehavior(3);
|
||||
transactionTemplate.setIsolationLevel(2);
|
||||
transactionTemplate.setTimeout(transactionManager.getDefaultTimeout());
|
||||
Executors.transactionTemplate = transactionTemplate;
|
||||
return transactionTemplate;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TransactionTemplate notSupportedTransactionTemplate(Environment environment, DataSource dataSource, ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
|
||||
DataSourceTransactionManager transactionManager = this.newTransactionManager(environment, dataSource, transactionManagerCustomizers);
|
||||
transactionManager.setTransactionSynchronization(2);
|
||||
TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager);
|
||||
transactionTemplate.setPropagationBehavior(4);
|
||||
transactionTemplate.setTimeout(transactionManager.getDefaultTimeout());
|
||||
Executors.notSupportedTransactionTemplate = transactionTemplate;
|
||||
return transactionTemplate;
|
||||
}
|
||||
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
RoutingDataSourceAutoConfiguration.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.bonus.core.data.dataset.tx;
|
||||
|
||||
import com.bonus.core.data.dataset.rule.RoutingRule;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
public class XDataSourceTransactionManager extends DataSourceTransactionManager {
|
||||
public XDataSourceTransactionManager(DataSource dataSource) {
|
||||
super(dataSource);
|
||||
}
|
||||
|
||||
protected void doBegin(Object transaction, TransactionDefinition definition) {
|
||||
RoutingRule.accessMaster();
|
||||
super.doBegin(transaction, definition);
|
||||
}
|
||||
|
||||
protected void doCleanupAfterCompletion(Object transaction) {
|
||||
try {
|
||||
super.doCleanupAfterCompletion(transaction);
|
||||
} finally {
|
||||
RoutingRule.resetAccess();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.bonus.core.data.dataset.tx;
|
||||
|
||||
import com.bonus.core.data.dataset.rule.RoutingRule;
|
||||
import org.springframework.jdbc.support.JdbcTransactionManager;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
public class XJdbcTransactionManager extends JdbcTransactionManager {
|
||||
public XJdbcTransactionManager(DataSource dataSource) {
|
||||
super(dataSource);
|
||||
}
|
||||
|
||||
protected void doBegin(Object transaction, TransactionDefinition definition) {
|
||||
RoutingRule.accessMaster();
|
||||
super.doBegin(transaction, definition);
|
||||
}
|
||||
|
||||
protected void doCleanupAfterCompletion(Object transaction) {
|
||||
try {
|
||||
super.doCleanupAfterCompletion(transaction);
|
||||
} finally {
|
||||
RoutingRule.resetAccess();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.bonus.core.common.encrypt.LeNiuDecryptDataProcess;
|
||||
import com.bonus.core.common.encrypt.LeNiuDecryptField;
|
||||
import com.bonus.core.common.utils.CustomLocalDateTimeConverter;
|
||||
import com.bonus.core.common.utils.DishesConverter;
|
||||
import com.bonus.core.common.utils.SysUtil;
|
||||
|
|
@ -15,7 +17,7 @@ import java.time.LocalDateTime;
|
|||
import java.util.List;
|
||||
|
||||
@ApiModel("获取评价列表(pc端)")
|
||||
//@LeNiuDecryptDataProcess
|
||||
@LeNiuDecryptDataProcess
|
||||
public class MenuEvaluateOrderPageVO {
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("评价id")
|
||||
|
|
@ -31,7 +33,7 @@ public class MenuEvaluateOrderPageVO {
|
|||
order = 1
|
||||
)
|
||||
@ApiModelProperty("用户姓名")
|
||||
// @LeNiuDecryptField
|
||||
@LeNiuDecryptField
|
||||
private String custName;
|
||||
@ExcelProperty(
|
||||
value = {"所属区域"},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.bonus.core.merchant.constant;
|
||||
|
||||
public enum MerchantStatusEnum {
|
||||
NORMAL(1, "正常"),
|
||||
PULL_BLACK(2, "拉黑"),
|
||||
MATURITY(3, "到期"),
|
||||
UNAUDITED(4, "未审核"),
|
||||
INITIALIZING(5, "初始化中");
|
||||
|
||||
private final Integer key;
|
||||
private final String value;
|
||||
|
||||
private MerchantStatusEnum(Integer key, String value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Integer getKey(String value) {
|
||||
MerchantStatusEnum[] enums = values();
|
||||
MerchantStatusEnum[] var2 = enums;
|
||||
int var3 = enums.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
MerchantStatusEnum item = var2[var4];
|
||||
if (item.value().equals(value)) {
|
||||
return item.key();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getValue(Integer key) {
|
||||
MerchantStatusEnum[] enums = values();
|
||||
MerchantStatusEnum[] var2 = enums;
|
||||
int var3 = enums.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
MerchantStatusEnum item = var2[var4];
|
||||
if (item.key().equals(key)) {
|
||||
return item.value();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer key() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
// $FF: synthetic method
|
||||
private static MerchantStatusEnum[] $values() {
|
||||
return new MerchantStatusEnum[]{NORMAL, PULL_BLACK, MATURITY, UNAUDITED, INITIALIZING};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,255 @@
|
|||
package com.bonus.core.merchant.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("merc_merchant")
|
||||
public class MercMerchantInSystem extends Model<MercMerchantInSystem> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId
|
||||
@ApiModelProperty("商家id")
|
||||
private Long tenantId;
|
||||
@ApiModelProperty("第三方商户id")
|
||||
private String thirdMerchantId;
|
||||
@ApiModelProperty("公司名称")
|
||||
private String merchantName;
|
||||
@ApiModelProperty("食堂或餐厅名称")
|
||||
private String canteenName;
|
||||
@ApiModelProperty("联系人姓名")
|
||||
private String linkman;
|
||||
@ApiModelProperty("手机号")
|
||||
private String linkmanNumber;
|
||||
@ApiModelProperty("登录密码")
|
||||
private String password;
|
||||
@ApiModelProperty("区域省市区详细地址")
|
||||
private String address;
|
||||
@ApiModelProperty("入驻日期")
|
||||
private LocalDateTime startTime;
|
||||
@ApiModelProperty("授权用户数")
|
||||
private Integer userCount;
|
||||
@ApiModelProperty("授权截止日期")
|
||||
private LocalDateTime endTime;
|
||||
@ApiModelProperty("管理员名称")
|
||||
private String adminName;
|
||||
@ApiModelProperty("邮箱")
|
||||
private String email;
|
||||
@ApiModelProperty("微信")
|
||||
private String wechat;
|
||||
@ApiModelProperty("状态")
|
||||
private Integer status;
|
||||
@ApiModelProperty("乐观锁")
|
||||
private Integer revision;
|
||||
@ApiModelProperty("创建人")
|
||||
private String crby;
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime crtime;
|
||||
@ApiModelProperty("更新人")
|
||||
private String upby;
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime uptime;
|
||||
private String dataset;
|
||||
@TableField("`schema`")
|
||||
private String schema;
|
||||
@ApiModelProperty("人员id限制标识,1:开启,2:关闭")
|
||||
private Integer limitFlag;
|
||||
@ApiModelProperty("展示服务器信息,1:开启,2:关闭")
|
||||
private Integer serverFlag;
|
||||
|
||||
public Long getTenantId() {
|
||||
return this.tenantId;
|
||||
}
|
||||
|
||||
public String getThirdMerchantId() {
|
||||
return this.thirdMerchantId;
|
||||
}
|
||||
|
||||
public String getMerchantName() {
|
||||
return this.merchantName;
|
||||
}
|
||||
|
||||
public String getCanteenName() {
|
||||
return this.canteenName;
|
||||
}
|
||||
|
||||
public String getLinkman() {
|
||||
return this.linkman;
|
||||
}
|
||||
|
||||
public String getLinkmanNumber() {
|
||||
return this.linkmanNumber;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return this.address;
|
||||
}
|
||||
|
||||
public LocalDateTime getStartTime() {
|
||||
return this.startTime;
|
||||
}
|
||||
|
||||
public Integer getUserCount() {
|
||||
return this.userCount;
|
||||
}
|
||||
|
||||
public LocalDateTime getEndTime() {
|
||||
return this.endTime;
|
||||
}
|
||||
|
||||
public String getAdminName() {
|
||||
return this.adminName;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return this.email;
|
||||
}
|
||||
|
||||
public String getWechat() {
|
||||
return this.wechat;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public Integer getRevision() {
|
||||
return this.revision;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public String getDataset() {
|
||||
return this.dataset;
|
||||
}
|
||||
|
||||
public String getSchema() {
|
||||
return this.schema;
|
||||
}
|
||||
|
||||
public Integer getLimitFlag() {
|
||||
return this.limitFlag;
|
||||
}
|
||||
|
||||
public Integer getServerFlag() {
|
||||
return this.serverFlag;
|
||||
}
|
||||
|
||||
public void setTenantId(final Long tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public void setThirdMerchantId(final String thirdMerchantId) {
|
||||
this.thirdMerchantId = thirdMerchantId;
|
||||
}
|
||||
|
||||
public void setMerchantName(final String merchantName) {
|
||||
this.merchantName = merchantName;
|
||||
}
|
||||
|
||||
public void setCanteenName(final String canteenName) {
|
||||
this.canteenName = canteenName;
|
||||
}
|
||||
|
||||
public void setLinkman(final String linkman) {
|
||||
this.linkman = linkman;
|
||||
}
|
||||
|
||||
public void setLinkmanNumber(final String linkmanNumber) {
|
||||
this.linkmanNumber = linkmanNumber;
|
||||
}
|
||||
|
||||
public void setPassword(final String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public void setAddress(final String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public void setStartTime(final LocalDateTime startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public void setUserCount(final Integer userCount) {
|
||||
this.userCount = userCount;
|
||||
}
|
||||
|
||||
public void setEndTime(final LocalDateTime endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public void setAdminName(final String adminName) {
|
||||
this.adminName = adminName;
|
||||
}
|
||||
|
||||
public void setEmail(final String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public void setWechat(final String wechat) {
|
||||
this.wechat = wechat;
|
||||
}
|
||||
|
||||
public void setStatus(final Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setRevision(final Integer revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public void setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
public void setDataset(final String dataset) {
|
||||
this.dataset = dataset;
|
||||
}
|
||||
|
||||
public void setSchema(final String schema) {
|
||||
this.schema = schema;
|
||||
}
|
||||
|
||||
public void setLimitFlag(final Integer limitFlag) {
|
||||
this.limitFlag = limitFlag;
|
||||
}
|
||||
|
||||
public void setServerFlag(final Integer serverFlag) {
|
||||
this.serverFlag = serverFlag;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.bonus.core.merchant.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.merchant.entity.MercMerchantInSystem;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MercMerchantInSystemMapper extends BaseMapper<MercMerchantInSystem> {
|
||||
@Select({"select tenant_id from merc_merchant where status = #{status}"})
|
||||
List<Long> selectAllMerchantId(@Param("status") Integer status);
|
||||
|
||||
@Select({"select tenant_id, merchant_name from merc_merchant ${ew.customSqlSegment}"})
|
||||
List<MercMerchantInSystem> selectMerchantIdAndNameListByWrapper(@Param("ew") Wrapper<MercMerchantInSystem> wrapper);
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.core.nutrition.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.nutrition.common.model.HealthCustMedicalReport;
|
||||
import com.bonus.core.nutrition.common.vo.HealthCustMedicalReportVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface HealthCustMedicalReportMapper extends BaseMapper<HealthCustMedicalReport> {
|
||||
List<HealthCustMedicalReportVO> listMedicalReport(@Param("custId") Long custId);
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.core.nutrition.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.nutrition.common.model.HealthMedicalReportTemplate;
|
||||
import com.bonus.core.nutrition.common.vo.HealthMedicalReportTmplVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface HealthMedicalReportTmplMapper extends BaseMapper<HealthMedicalReportTemplate> {
|
||||
List<HealthMedicalReportTmplVO> listTemplate();
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
package com.bonus.core.nutrition.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("health_cust_medical_report")
|
||||
@ApiModel("人员体检报告表")
|
||||
public class HealthCustMedicalReport implements Serializable {
|
||||
@TableId
|
||||
@ApiModelProperty("主键自增")
|
||||
private Long id;
|
||||
@ApiModelProperty("体检id")
|
||||
private Long medicalId;
|
||||
@ApiModelProperty("人员id")
|
||||
private Long custId;
|
||||
@ApiModelProperty("体检日期")
|
||||
private LocalDate medicalDate;
|
||||
@ApiModelProperty("体检机构")
|
||||
private String medicalMechanism;
|
||||
@ApiModelProperty("体检模板id")
|
||||
private Long medicalTemplateId;
|
||||
@ApiModelProperty("创建人")
|
||||
private String crby;
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime crtime;
|
||||
@ApiModelProperty("更新人")
|
||||
private String upby;
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime uptime;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getMedicalId() {
|
||||
return this.medicalId;
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public LocalDate getMedicalDate() {
|
||||
return this.medicalDate;
|
||||
}
|
||||
|
||||
public String getMedicalMechanism() {
|
||||
return this.medicalMechanism;
|
||||
}
|
||||
|
||||
public Long getMedicalTemplateId() {
|
||||
return this.medicalTemplateId;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setMedicalId(final Long medicalId) {
|
||||
this.medicalId = medicalId;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setMedicalDate(final LocalDate medicalDate) {
|
||||
this.medicalDate = medicalDate;
|
||||
}
|
||||
|
||||
public void setMedicalMechanism(final String medicalMechanism) {
|
||||
this.medicalMechanism = medicalMechanism;
|
||||
}
|
||||
|
||||
public void setMedicalTemplateId(final Long medicalTemplateId) {
|
||||
this.medicalTemplateId = medicalTemplateId;
|
||||
}
|
||||
|
||||
public void setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.bonus.core.nutrition.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("health_medical_report_template")
|
||||
@ApiModel("体检报告模板")
|
||||
public class HealthMedicalReportTemplate implements Serializable {
|
||||
@TableId
|
||||
@ApiModelProperty("主键自增")
|
||||
private Long id;
|
||||
@ApiModelProperty("体检模板id")
|
||||
private Long medicalTemplateId;
|
||||
@ApiModelProperty("体检模板名称")
|
||||
private String medicalTemplateName;
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
@ApiModelProperty("创建人")
|
||||
private String crby;
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime crtime;
|
||||
@ApiModelProperty("更新人")
|
||||
private String upby;
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime uptime;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getMedicalTemplateId() {
|
||||
return this.medicalTemplateId;
|
||||
}
|
||||
|
||||
public String getMedicalTemplateName() {
|
||||
return this.medicalTemplateName;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return this.remark;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setMedicalTemplateId(final Long medicalTemplateId) {
|
||||
this.medicalTemplateId = medicalTemplateId;
|
||||
}
|
||||
|
||||
public void setMedicalTemplateName(final String medicalTemplateName) {
|
||||
this.medicalTemplateName = medicalTemplateName;
|
||||
}
|
||||
|
||||
public void setRemark(final String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public void setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.core.nutrition.common.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.core.customer.api.CustCasualApi;
|
||||
import com.bonus.core.nutrition.common.mapper.HealthCustMedicalReportMapper;
|
||||
import com.bonus.core.nutrition.common.vo.HealthCustMedicalReportVO;
|
||||
import com.bonus.i18n.I18n;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.invoke.SerializedLambda;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class HealthCustMedicalReportService {
|
||||
@Autowired
|
||||
private CustCasualApi custCasualApi;
|
||||
@Resource
|
||||
private HealthCustMedicalReportMapper healthCustMedicalReportMapper;
|
||||
|
||||
public List<HealthCustMedicalReportVO> listMedicalReport(String openid, Integer sourceType) {
|
||||
Long custId = this.custCasualApi.getCustIdByOpenidAndSourceType(openid, sourceType);
|
||||
if (ObjectUtil.isEmpty(custId)) {
|
||||
throw new ServiceException(I18n.getMessage("nutrition.no-cust", new Object[0]));
|
||||
} else {
|
||||
List<HealthCustMedicalReportVO> reportVOList = this.healthCustMedicalReportMapper.listMedicalReport(custId);
|
||||
return reportVOList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.bonus.core.nutrition.common.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bonus.core.nutrition.common.mapper.HealthMedicalReportTmplMapper;
|
||||
import com.bonus.core.nutrition.common.vo.HealthMedicalReportTmplVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.invoke.SerializedLambda;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
public class HealthMedicalReportTmplService {
|
||||
@Resource
|
||||
private HealthMedicalReportTmplMapper healthMedicalReportTmplMapper;
|
||||
|
||||
public List<HealthMedicalReportTmplVO> listTemplate() {
|
||||
return this.healthMedicalReportTmplMapper.listTemplate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.bonus.core.nutrition.common.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ApiModel("人员体检报告结果")
|
||||
public class HealthCustMedicalReportDetailVO {
|
||||
@ApiModelProperty("体检项目明细id")
|
||||
private Long medicalProjectDetailId;
|
||||
@ApiModelProperty("体检项目明细名称")
|
||||
private String medicalProjectDetailName;
|
||||
@ApiModelProperty("检查结果")
|
||||
private String result;
|
||||
@ApiModelProperty("单位")
|
||||
private String medicalProjectDetailUnit;
|
||||
@ApiModelProperty("参考值")
|
||||
private String medicalProjectDetailReference;
|
||||
|
||||
public Long getMedicalProjectDetailId() {
|
||||
return this.medicalProjectDetailId;
|
||||
}
|
||||
|
||||
public String getMedicalProjectDetailName() {
|
||||
return this.medicalProjectDetailName;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public String getMedicalProjectDetailUnit() {
|
||||
return this.medicalProjectDetailUnit;
|
||||
}
|
||||
|
||||
public String getMedicalProjectDetailReference() {
|
||||
return this.medicalProjectDetailReference;
|
||||
}
|
||||
|
||||
public void setMedicalProjectDetailId(final Long medicalProjectDetailId) {
|
||||
this.medicalProjectDetailId = medicalProjectDetailId;
|
||||
}
|
||||
|
||||
public void setMedicalProjectDetailName(final String medicalProjectDetailName) {
|
||||
this.medicalProjectDetailName = medicalProjectDetailName;
|
||||
}
|
||||
|
||||
public void setResult(final String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public void setMedicalProjectDetailUnit(final String medicalProjectDetailUnit) {
|
||||
this.medicalProjectDetailUnit = medicalProjectDetailUnit;
|
||||
}
|
||||
|
||||
public void setMedicalProjectDetailReference(final String medicalProjectDetailReference) {
|
||||
this.medicalProjectDetailReference = medicalProjectDetailReference;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.bonus.core.nutrition.common.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("人员体检报告项目")
|
||||
public class HealthCustMedicalReportProjectVO {
|
||||
@ApiModelProperty("体检项目id")
|
||||
private Long medicalProjectId;
|
||||
@ApiModelProperty("体检项目名称")
|
||||
private String medicalProjectName;
|
||||
@ApiModelProperty("体检项目结果")
|
||||
private List<HealthCustMedicalReportDetailVO> medicalReportDetailVOList;
|
||||
|
||||
public Long getMedicalProjectId() {
|
||||
return this.medicalProjectId;
|
||||
}
|
||||
|
||||
public String getMedicalProjectName() {
|
||||
return this.medicalProjectName;
|
||||
}
|
||||
|
||||
public List<HealthCustMedicalReportDetailVO> getMedicalReportDetailVOList() {
|
||||
return this.medicalReportDetailVOList;
|
||||
}
|
||||
|
||||
public void setMedicalProjectId(final Long medicalProjectId) {
|
||||
this.medicalProjectId = medicalProjectId;
|
||||
}
|
||||
|
||||
public void setMedicalProjectName(final String medicalProjectName) {
|
||||
this.medicalProjectName = medicalProjectName;
|
||||
}
|
||||
|
||||
public void setMedicalReportDetailVOList(final List<HealthCustMedicalReportDetailVO> medicalReportDetailVOList) {
|
||||
this.medicalReportDetailVOList = medicalReportDetailVOList;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.bonus.core.nutrition.common.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("人员体检报告详情")
|
||||
public class HealthCustMedicalReportVO {
|
||||
@ApiModelProperty("体检id")
|
||||
private Long medicalId;
|
||||
@ApiModelProperty("人员id")
|
||||
private Long custId;
|
||||
@ApiModelProperty("体检日期")
|
||||
private LocalDate medicalDate;
|
||||
@ApiModelProperty("体检机构")
|
||||
private String medicalMechanism;
|
||||
@ApiModelProperty("体检模板id")
|
||||
private Long medicalTemplateId;
|
||||
@ApiModelProperty("体检项目结果")
|
||||
private List<HealthCustMedicalReportProjectVO> reportProjectVOS;
|
||||
|
||||
public Long getMedicalId() {
|
||||
return this.medicalId;
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public LocalDate getMedicalDate() {
|
||||
return this.medicalDate;
|
||||
}
|
||||
|
||||
public String getMedicalMechanism() {
|
||||
return this.medicalMechanism;
|
||||
}
|
||||
|
||||
public Long getMedicalTemplateId() {
|
||||
return this.medicalTemplateId;
|
||||
}
|
||||
|
||||
public List<HealthCustMedicalReportProjectVO> getReportProjectVOS() {
|
||||
return this.reportProjectVOS;
|
||||
}
|
||||
|
||||
public void setMedicalId(final Long medicalId) {
|
||||
this.medicalId = medicalId;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setMedicalDate(final LocalDate medicalDate) {
|
||||
this.medicalDate = medicalDate;
|
||||
}
|
||||
|
||||
public void setMedicalMechanism(final String medicalMechanism) {
|
||||
this.medicalMechanism = medicalMechanism;
|
||||
}
|
||||
|
||||
public void setMedicalTemplateId(final Long medicalTemplateId) {
|
||||
this.medicalTemplateId = medicalTemplateId;
|
||||
}
|
||||
|
||||
public void setReportProjectVOS(final List<HealthCustMedicalReportProjectVO> reportProjectVOS) {
|
||||
this.reportProjectVOS = reportProjectVOS;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.bonus.core.nutrition.common.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ApiModel("体检报告模板出参")
|
||||
public class HealthMedicalReportTmplVO {
|
||||
@ApiModelProperty("体检模板id")
|
||||
private Long medicalTemplateId;
|
||||
@ApiModelProperty("体检模板名称")
|
||||
private String medicalTemplateName;
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
public Long getMedicalTemplateId() {
|
||||
return this.medicalTemplateId;
|
||||
}
|
||||
|
||||
public String getMedicalTemplateName() {
|
||||
return this.medicalTemplateName;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return this.remark;
|
||||
}
|
||||
|
||||
public void setMedicalTemplateId(final Long medicalTemplateId) {
|
||||
this.medicalTemplateId = medicalTemplateId;
|
||||
}
|
||||
|
||||
public void setMedicalTemplateName(final String medicalTemplateName) {
|
||||
this.medicalTemplateName = medicalTemplateName;
|
||||
}
|
||||
|
||||
public void setRemark(final String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.bonus.core.nutrition.mobile.controller;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.core.common.utils.HeaderFetchUtil;
|
||||
import com.bonus.core.nutrition.common.service.HealthCustMedicalReportService;
|
||||
import com.bonus.core.nutrition.common.service.HealthMedicalReportTmplService;
|
||||
import com.bonus.core.nutrition.common.vo.HealthCustMedicalReportVO;
|
||||
import com.bonus.core.nutrition.common.vo.HealthMedicalReportTmplVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/health/mobile/medicalreport"})
|
||||
@Api(
|
||||
tags = {"mobile-移动端人员体检报告"}
|
||||
)
|
||||
public class HealthMobileMedicalReportController {
|
||||
@Autowired
|
||||
@Lazy
|
||||
private HealthCustMedicalReportService healthCustMedicalReportService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private HealthMedicalReportTmplService healthMedicalReportTmplService;
|
||||
|
||||
@PostMapping({"/list-medicalreport"})
|
||||
// @RequiresGuest
|
||||
@ApiOperation("查询人员体检报告记录")
|
||||
public List<HealthCustMedicalReportVO> listMedicalReport(@RequestHeader Map<String, String> headers) {
|
||||
return this.healthCustMedicalReportService.listMedicalReport(this.getOpenidByHeaders(headers), this.getSourceTypeByHeaders(headers));
|
||||
}
|
||||
|
||||
@PostMapping({"/list-template"})
|
||||
// @RequiresGuest
|
||||
@ApiOperation("查询体检报告模板")
|
||||
public List<HealthMedicalReportTmplVO> listTemplate() {
|
||||
return this.healthMedicalReportTmplService.listTemplate();
|
||||
}
|
||||
|
||||
protected String getOpenidByHeaders(Map<String, String> headers) {
|
||||
return HeaderFetchUtil.getValueFromHeadersIgnoreCase(headers, "openid");
|
||||
}
|
||||
|
||||
protected Integer getSourceTypeByHeaders(Map<String, String> headers) {
|
||||
String value = HeaderFetchUtil.getValueFromHeadersIgnoreCase(headers, "source-type");
|
||||
return CharSequenceUtil.isNotBlank(value) ? Integer.valueOf(value) : null;
|
||||
}
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ public class MqUtil {
|
|||
log.info("发送延迟消息,topic:{},delayMileSecond:{}", topic.getKey(), delayMileSecond);
|
||||
LogUtil.printArgs("消息体", data);
|
||||
String routing = topic.getKey();
|
||||
mqTemplate.sendDelay(routing, MqPayload.of(data, topic, routing), (long)delayMileSecond);
|
||||
mqTemplate.sendDelay(routing, MqPayload.of(data, topic, routing), (int)delayMileSecond);
|
||||
} catch (Exception var4) {
|
||||
log.error("发送事务MQ消息失败", var4);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
package com.bonus.core.starter.data;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.core.data.dataset.Executors;
|
||||
import com.bonus.core.data.dataset.rule.loader.RouterLoader;
|
||||
import com.bonus.core.merchant.constant.MerchantStatusEnum;
|
||||
import com.bonus.core.merchant.entity.MercMerchantInSystem;
|
||||
import com.bonus.core.merchant.mapper.MercMerchantInSystemMapper;
|
||||
import com.bonus.core.tenant.TenantLoader;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
//public class DefaultDataSourceLoader implements RouterLoader, DataSourceLoader, TenantLoader {
|
||||
@Component
|
||||
public class DefaultDataSourceLoader implements RouterLoader, TenantLoader {
|
||||
// @Autowired
|
||||
// @Lazy
|
||||
// DataSetMapper dataSetMapper;
|
||||
@Autowired
|
||||
@Lazy
|
||||
MercMerchantInSystemMapper mercMerchantInSystemMapper;
|
||||
// @Value("${system.dataset:dataset}")
|
||||
// private String dataset;
|
||||
|
||||
public RouterLoader.Router load(Object key) {
|
||||
MercMerchantInSystem merchant = (MercMerchantInSystem)Executors.readInSystem(() -> {
|
||||
return (MercMerchantInSystem)this.mercMerchantInSystemMapper.selectById((Long)key);
|
||||
});
|
||||
if (merchant == null) {
|
||||
throw new ServiceException("商户[" + String.valueOf(key) + "]不存在");
|
||||
} else {
|
||||
return new RouterLoader.Router(merchant.getDataset(), merchant.getSchema());
|
||||
}
|
||||
}
|
||||
|
||||
// public DataSourceLoader.DataSet load(String name) {
|
||||
// DS dset = (DS)Executors.readInSystem(() -> {
|
||||
// return this.dataSetMapper.queryById(this.dataset, name);
|
||||
// });
|
||||
// List<MercMerchantInSystem> mercMerchantInSystems = (List)Executors.readInSystem(() -> {
|
||||
// return this.mercMerchantInSystemMapper.selectList((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MercMerchantInSystem.class).eq(MercMerchantInSystem::getDataset, name)).eq(MercMerchantInSystem::getStatus, MerchantStatusEnum.NORMAL.key()));
|
||||
// });
|
||||
// Map<String, Long> schemas = null;
|
||||
// if (CollectionUtil.isNotEmpty(mercMerchantInSystems)) {
|
||||
// schemas = (Map)mercMerchantInSystems.stream().collect(Collectors.toMap(MercMerchantInSystem::getSchema, MercMerchantInSystem::getTenantId));
|
||||
// }
|
||||
//
|
||||
// return new DataSourceLoader.DataSet(name, dset.getMaster(), schemas, dset.getSlave());
|
||||
// }
|
||||
//
|
||||
// public List<DataSourceLoader.DataSet> load() {
|
||||
// List<DS> dset = (List)Executors.readInSystem(() -> {
|
||||
// return this.dataSetMapper.list(this.dataset);
|
||||
// });
|
||||
// List<MercMerchantInSystem> mercMerchantInSystems = (List)Executors.readInSystem(() -> {
|
||||
// return this.mercMerchantInSystemMapper.selectList((Wrapper)Wrappers.lambdaQuery(MercMerchantInSystem.class).eq(MercMerchantInSystem::getStatus, MerchantStatusEnum.NORMAL.key()));
|
||||
// });
|
||||
// Map<String, Map<String, Long>> ds_schemas = Maps.newHashMap();
|
||||
// if (CollectionUtil.isNotEmpty(mercMerchantInSystems)) {
|
||||
// ds_schemas = (Map)mercMerchantInSystems.stream().collect(Collectors.groupingBy(MercMerchantInSystem::getDataset, Collectors.toMap(MercMerchantInSystem::getSchema, MercMerchantInSystem::getTenantId)));
|
||||
// }
|
||||
//
|
||||
// return (List)dset.stream().map((ds) -> {
|
||||
// return new DataSourceLoader.DataSet(ds.getName(), ds.getMaster(), (Map)ds_schemas.get(ds.getName()), ds.getSlave());
|
||||
// }).collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
public Set listTenant() {
|
||||
return Executors.readInSystem(() -> {
|
||||
return (Set)this.mercMerchantInSystemMapper
|
||||
.selectList(Wrappers.lambdaQuery(MercMerchantInSystem.class)
|
||||
.select(MercMerchantInSystem::getTenantId)
|
||||
.eq(MercMerchantInSystem::getStatus, MerchantStatusEnum.NORMAL.key()))
|
||||
.stream().mapToLong(MercMerchantInSystem::getTenantId).boxed().collect(Collectors.toSet());
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?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.bonus.core.nutrition.common.mapper.HealthCustMedicalReportMapper">
|
||||
<select id="listMedicalReport" resultType="com.bonus.core.nutrition.common.vo.HealthCustMedicalReportVO">
|
||||
SELECT medical_id,
|
||||
cust_id,
|
||||
medical_date,
|
||||
medical_mechanism,
|
||||
medical_template_id
|
||||
FROM health_cust_medical_report
|
||||
WHERE cust_id = #{custId}
|
||||
ORDER BY medical_date DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?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.bonus.core.nutrition.common.mapper.HealthMedicalReportTmplMapper">
|
||||
<select id="listTemplate" resultType="com.bonus.core.nutrition.common.vo.HealthMedicalReportTmplVO">
|
||||
SELECT
|
||||
medical_template_id,
|
||||
medical_template_name,
|
||||
remark
|
||||
FROM
|
||||
health_medical_report_template
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue