Commit 68dedd4d authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 6b6e04e7 23a5a6dd
package com.mortals.xhx.common.utils;
import com.mortals.framework.util.HttpUtil;
import com.mortals.xhx.feign.skin.ISkinFillFeign;
import com.mortals.xhx.feign.skin.ISkinSampleFeign;
import com.mortals.xhx.utils.SpringUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;
import static com.mortals.framework.util.HttpUtil.HEADER_CONTENT_TYPE;
/**
* 发通知第三方
*
* @author: zxfei
* @date: 2022/4/28 10:56
* @description:
**/
@Slf4j
public class SendSkinRefreshTask implements Runnable {
private ISkinSampleFeign skinSampleFeign;
private ISkinFillFeign skinFillFeign;
public SendSkinRefreshTask() {
skinSampleFeign = SpringUtils.getBean(ISkinSampleFeign.class);
skinFillFeign = SpringUtils.getBean(ISkinFillFeign.class);
}
@Override
public void run() {
String resp = null;
try {
Thread.sleep(2000L);
skinSampleFeign.refreshSkin();
skinFillFeign.refreshSkin();
} catch (Exception e) {
log.error("异常:", e);
}
}
}
......@@ -11,12 +11,14 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.FiletypeEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.common.utils.FreeMarkerUtils;
import com.mortals.xhx.common.utils.SendSkinRefreshTask;
import com.mortals.xhx.feign.skin.ISkinFillFeign;
import com.mortals.xhx.feign.skin.ISkinSampleFeign;
import com.mortals.xhx.module.product.model.ProductEntity;
......@@ -167,9 +169,9 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
});
skinFieldService.save(entity.getSkinFieldList(), context);
}
//通知子系统同步皮肤数据
skinSampleFeign.refreshSkin();
skinFillFeign.refreshSkin();
SendSkinRefreshTask sendSkinRefreshTask = new SendSkinRefreshTask();
ThreadPool.getInstance().execute(sendSkinRefreshTask);
}
@Override
......@@ -188,13 +190,16 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
super.removeAfter(ids, context, result);
SkinFieldQuery skinFieldQuery = new SkinFieldQuery();
skinFieldQuery.setSkinIdList(Arrays.asList(ids));
Long[] skinFieldIds = skinFieldService.find(skinFieldQuery, context).stream().map(item -> item.getId()).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(skinFieldIds)) {
skinFieldService.remove(skinFieldIds, context);
}
super.removeAfter(ids, context, result);
SendSkinRefreshTask sendSkinRefreshTask = new SendSkinRefreshTask();
ThreadPool.getInstance().execute(sendSkinRefreshTask);
}
private void genTemplateCss(SkinBaseEntity entity, Context context) {
......
......@@ -23,9 +23,12 @@ client.global.set("authToken", JSON.parse(response.body).data.token);
POST {{baseUrl}}/app/list
Content-Type: application/json
{"siteId":"22",appTypeList,"page":1,"size":-1}
{
"siteId": 1,
"appTypeNotList": [4],
"page": 1,
"size": -1
}
###自助终端应用更新与保存
......
......@@ -4,7 +4,7 @@ POST {{baseUrl}}/skin/base/list
Content-Type: application/json
{
"fieldName": "背景大图",
"productName": "样表机",
"page": 1,
"size": 10
}
......
......@@ -77,7 +77,7 @@ public interface IApiAreaFeign extends IFeign {
* @param
* @return
*/
@PostMapping(value = "/usr/refreshUser")
@PostMapping(value = "/user/refreshUser")
Rest<Void> refreshUser();
// /**
......
......@@ -75,7 +75,7 @@ public interface IDeviceFeign extends IFeign {
* @param
* @return
*/
@PostMapping(value = "/usr/refreshUser")
@PostMapping(value = "/user/refreshUser")
Rest<Void> refreshUser();
......
......@@ -33,7 +33,7 @@ public interface ISkinFillFeign extends IFeign {
* @param
* @return
*/
@PostMapping(value = "/usr/refreshUser")
@PostMapping(value = "/user/refreshUser")
Rest<Void> refreshUser();
......
......@@ -34,7 +34,7 @@ public interface ISkinSampleFeign extends IFeign {
* @param
* @return
*/
@PostMapping(value = "/usr/refreshUser")
@PostMapping(value = "/user/refreshUser")
Rest<Void> refreshUser();
}
......
......@@ -4,6 +4,7 @@ import com.mortals.xhx.feign.area.IApiAreaFeign;
import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.feign.skin.ISkinFillFeign;
import com.mortals.xhx.feign.skin.ISkinSampleFeign;
import com.mortals.xhx.utils.SpringUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
......@@ -24,12 +25,18 @@ public class SendSubSystemTask implements Runnable {
private ISkinSampleFeign skinSampleFeign;
private ISkinFillFeign skinFillFeign;
public SendSubSystemTask() {
apiAreaFeign= SpringUtils.getBean(IApiAreaFeign.class);
deviceFeign= SpringUtils.getBean(IDeviceFeign.class);
skinSampleFeign= SpringUtils.getBean(ISkinSampleFeign.class);
skinFillFeign= SpringUtils.getBean(ISkinFillFeign.class);
}
@Override
public void run() {
String resp = null;
try {
Thread.sleep(2000);
apiAreaFeign.refreshUser();
Thread.sleep(2000);
deviceFeign.refreshUser();
......
......@@ -407,7 +407,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
private void noticeSubSystemRefresh() {
//用户新增修改,推送消息给子系统进行数据同步
SendSubSystemTask sendSubSystemTask = new SendSubSystemTask(apiAreaFeign, deviceFeign, skinSampleFeign, skinFillFeign);
SendSubSystemTask sendSubSystemTask = new SendSubSystemTask();
ThreadPool.getInstance().execute(sendSubSystemTask);
}
......
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