Browse Source

积分规则 列表问题修改

dev_shibei_match
jianjun 5 years ago
parent
commit
f4f531aaa3
  1. 19
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java
  2. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java
  3. 2
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml

19
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.UserPointActionLogService;
import dto.form.SendPointFormDTO;
import lombok.extern.slf4j.Slf4j;
@ -41,11 +42,11 @@ public class MqPointCallbackController {
* @return
*/
@RequestMapping("activeSendPoint")
public String activeSendPoint(@RequestBody ReceiveMqMsg mqMsg) {
public Result<Boolean> activeSendPoint(@RequestBody ReceiveMqMsg mqMsg) {
log.debug("activeSendPoint receive mqMsg:{}", JSON.toJSONString(mqMsg));
if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) {
log.warn("activeSendPoint mqMsg is empty");
return "success";
return new Result<Boolean>().ok(true);
}
List<SendPointFormDTO> formDTO = JSON.parseArray(mqMsg.getMsg(), SendPointFormDTO.class);
try {
@ -55,7 +56,7 @@ public class MqPointCallbackController {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg());
}
log.info("activeSendPoint consumer success,formDTO:{}", JSON.toJSONString(formDTO));
return "success";
return new Result<Boolean>().ok(true);
}
/**
@ -65,11 +66,11 @@ public class MqPointCallbackController {
* @return
*/
@RequestMapping("registervolunteer")
public String registerVolunteer(@RequestBody ReceiveMqMsg mqMsg) {
public Result<Boolean> registerVolunteer(@RequestBody ReceiveMqMsg mqMsg) {
log.debug("registerVolunteer receive mqMsg:{}", JSON.toJSONString(mqMsg));
if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) {
log.warn("registerVolunteer mqMsg is empty");
return "success";
return new Result<Boolean>().ok(true);
}
BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class);
try {
@ -79,7 +80,7 @@ public class MqPointCallbackController {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg());
}
log.info("registerVolunteer consumer success,formDTO:{}", JSON.toJSONString(formDTO));
return "success";
return new Result<Boolean>().ok(true);
}
/**
@ -89,11 +90,11 @@ public class MqPointCallbackController {
* @return
*/
@RequestMapping("pubactivelive")
public String pubActiveLive(@RequestBody ReceiveMqMsg mqMsg) {
public Result<Boolean> pubActiveLive(@RequestBody ReceiveMqMsg mqMsg) {
log.debug("pubActiveLive receive mqMsg:{}", JSON.toJSONString(mqMsg));
if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) {
log.warn("pubActiveLive mqMsg is empty");
return "success";
return new Result<Boolean>().ok(true);
}
BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class);
try {
@ -103,7 +104,7 @@ public class MqPointCallbackController {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg());
}
log.info("pubActiveLive consumer success,formDTO:{}", JSON.toJSONString(formDTO));
return "success";
return new Result<Boolean>().ok(true);
}
}

4
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java

@ -52,8 +52,8 @@ public class PointRuleController {
* @return
*/
@PostMapping(value = "list")
public Result<List<PointRuleResultDTO>> list(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleListFormDTO formDTO) {
formDTO.setCustomerId(tokenDTO.getCustomerId());
public Result<List<PointRuleResultDTO>> list( @RequestBody PointRuleListFormDTO formDTO) {
formDTO.setCustomerId("3ef7e4bb195eb9e622d68b52509aa940");
ValidatorUtils.validateEntity(formDTO);
return new Result<List<PointRuleResultDTO>>().ok(pointRuleService.list(formDTO));
}

2
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml

@ -26,7 +26,7 @@
SELECT DISTINCT FUNCTION_ID FROM point_rule WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
</select>
<select id="selectListByFunctionId" resultMap="pointRuleMap">
SELECT ID,RULE_NAME,RULE_DESC,POINT,POINT_UNIT FROM point_rule WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
SELECT ID,RULE_NAME,RULE_DESC,POINT,POINT_UNIT,ENABLED_FLAG FROM point_rule WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND FUNCTION_ID = #{functionId,jdbcType=VARCHAR}
</select>
<update id="updateByCustomerId">
UPDATE point_rule

Loading…
Cancel
Save