Commit a2769275 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/dev' into dev

parents 3d0879b0 056f807f
......@@ -303,14 +303,29 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
}
public void deleteByMemberIds(Collection<Integer> userIds) {
Example example = new Example(AppUserRelation.class);
Example example = new Example(AppUserRelation.class);
Example.Criteria criteria = example.createCriteria();
criteria.andIn("parentId",userIds);
List<AppUserRelation> list=mapper.selectByExample(example);
for (AppUserRelation appUserRelation:list){
getMyBiz().delRelation(appUserRelation.getUserId());
}
mapper.deleteByExample(example);
Example example2 = new Example(AppUserRelation.class);
Example.Criteria criteria1 = example2.createCriteria();
criteria1.andIn("userId",userIds);
mapper.deleteByExample(example2);
for (Integer userId:userIds){
getMyBiz().delRelation(userId);
}
}
@CacheClear(key="user:relation{1}")
public void delRelation(Integer userId){
}
}
\ No newline at end of file
}
......@@ -7,11 +7,13 @@ import com.github.wxiaoqi.security.admin.biz.AppUserSellingWaterBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.feign.ActivityFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
import java.util.*;
/**
......@@ -20,10 +22,16 @@ import java.util.*;
* @description
* @data 2019/7/24 15:11
*/
@ConditionalOnProperty(prefix = "data.clean", name = "enable",havingValue = "true")
@RestController
@RequestMapping("/app/unauth/user_data")
public class DataController {
@PostConstruct
public void init(){
System.out.println("启动了****************************");
}
@Autowired
private AppUserLoginBiz appUserLoginBiz;
......@@ -55,12 +63,14 @@ public class DataController {
}
@GetMapping("/clear_relation_withphone")
public ObjectRestResponse<Void> clearRelation(@RequestParam("phones") List<String> phones){
Map<String, Integer> phoneAndUserIdMapByPhones = appUserLoginBiz.findPhoneAndUserIdMapByPhones(phones);
public ObjectRestResponse<Void> clearRelationphone(@RequestParam("phones") List<String> phons) {
Map<String, Integer> phoneAndUserIdMapByPhones = appUserLoginBiz.findPhoneAndUserIdMapByPhones(phons);
if (Objects.nonNull(phoneAndUserIdMapByPhones)){
Collection<Integer> userIds = phoneAndUserIdMapByPhones.values();
appUserRelationBiz.deleteByMemberIds(userIds);
appUserSellingWaterBiz.deleteByMemberIds(userIds);
}
return ObjectRestResponse.succ();
}
......
......@@ -12,9 +12,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication(scanBasePackages = {
"com.xxfc.platform",
"com.github.wxiaoqi.security.common.handler"
// ,
// "com.github.wxiaoqi.security.common.log"
"com.github.wxiaoqi.security.common.handler",
"com.github.wxiaoqi.security.common.log"
})
@EnableDiscoveryClient
@EnableScheduling
......
......@@ -435,24 +435,27 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
private void sendQueue(OrderMQDTO orderMQDTO, Integer sign) {
try {
orderMQDTO.setSign(sign);
SendMsgDTO sendMsgDTO = new SendMsgDTO(){{
setExchange(ORDER_TOPIC);
}};
sendMsgDTO.setJson(JSONUtil.toJsonStr(orderMQDTO));
// SendMsgDTO sendMsgDTO = new SendMsgDTO(){{
// setExchange(ORDER_TOPIC);
// }};
// sendMsgDTO.setJson(JSONUtil.toJsonStr(orderMQDTO));
switch (sign) {
case 2:
sendMsgDTO.setRoutKey(KEY_ORDER_CANCEL);
// sendMsgDTO.setRoutKey(KEY_ORDER_CANCEL);
mqSenderFeign.sendMessage(ORDER_TOPIC, KEY_ORDER_CANCEL, JSONUtil.toJsonStr(orderMQDTO));
break;
case 4:
sendMsgDTO.setRoutKey(KEY_ORDER_PAY);
// sendMsgDTO.setRoutKey(KEY_ORDER_PAY);
mqSenderFeign.sendMessage(ORDER_TOPIC, KEY_ORDER_PAY, JSONUtil.toJsonStr(orderMQDTO));
break;
case 6:
sendMsgDTO.setRoutKey(KEY_ORDER_FINLISH);
// sendMsgDTO.setRoutKey(KEY_ORDER_FINLISH);
mqSenderFeign.sendMessage(ORDER_TOPIC, KEY_ORDER_FINLISH, JSONUtil.toJsonStr(orderMQDTO));
break;
default:
break;
}
mqSenderFeign.postSendMessage(BeanUtil.beanToMap(sendMsgDTO, Boolean.FALSE, Boolean.TRUE));
// mqSenderFeign.postSendMessage(BeanUtil.beanToMap(sendMsgDTO, Boolean.FALSE, Boolean.TRUE));
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
......@@ -14,7 +14,7 @@ public class MQSenderController {
private MQServiceBiZ mqServiceBiZ;
@GetMapping(value = "/sendMessage")
public ObjectRestResponse sendMessage(String exchange, String routKey, String json) {
public ObjectRestResponse sendMessage(@RequestParam(value = "exchange") String exchange, @RequestParam(value = "routKey") String routKey, @RequestParam(value = "json") String json) {
return mqServiceBiZ.sendMessage(exchange, routKey, json);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment