Commit 0541075a by fudahua

导购可编辑状态

parent cf6e0f08
......@@ -52,4 +52,5 @@ public interface MiniprogramSettingService {
*/
public boolean delMiniprogramSetting(String id);
}
......@@ -4,8 +4,13 @@ import java.io.InputStream;
import java.net.URL;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.service.entity.TabMiniprogramSetting;
import com.gic.haoban.manage.service.service.MiniprogramSettingService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -52,8 +57,11 @@ public class MaterialApiServiceImpl implements MaterialApiService {
@Autowired
private Config config;
private static Logger logger = LoggerFactory.getLogger(MaterialApiServiceImpl.class);
@Autowired
private MiniprogramSettingService miniprogramSettingService;
private static Logger logger = LoggerFactory.getLogger(MaterialApiServiceImpl.class);
@Override
public boolean hasCategoryNameExsit(String categoryName, String categoryParentId,String categoryId) {
......@@ -253,7 +261,16 @@ public class MaterialApiServiceImpl implements MaterialApiService {
Integer materialType,BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
com.github.pagehelper.Page<TabHaobanMaterial> page = materialService.listMaterial(wxEnterpriseId,keyword,categoryId,materialType);
return PageUtil.changePageHelperToCurrentPage(page,MaterialDTO.class);
List<TabHaobanMaterial> result = page.getResult();
List<TabMiniprogramSetting> settings = miniprogramSettingService.listMiniprogram(wxEnterpriseId);
if (CollectionUtils.isNotEmpty(result) && CollectionUtils.isNotEmpty(settings)) {
Map<String, TabMiniprogramSetting> settingMap = settings.stream().collect(Collectors.toMap(dto -> dto.getAppId(), dto -> dto));
result.forEach(dto -> {
TabMiniprogramSetting miniprogramSetting = settingMap.get(dto.getAppId());
dto.setMaterialDesc(miniprogramSetting == null ? "--" : miniprogramSetting.getMiniprogramName());
});
}
return PageUtil.changePageHelperToCurrentPage(page,MaterialDTO.class);
}
public static void main(String[] args) {
......
......@@ -82,14 +82,13 @@ public class ServiceTest {
// System.out.println(JSONObject.toJSONString(response));
}
@Test
public void test() {
List<String> staffIds = new ArrayList<>();
staffIds.add("0006ae5de6484cf9b55072d2d967c481");
public void sendMessage() {
List<String> staffIds = new ArrayList<>();
staffIds.add("0006ae5de6484cf9b55072d2d967c481");
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendMessage("haoban3OrderBackForFaceMq","11111");
clientInstance.sendMessage("haoban3OrderBackForFaceMq", "11111");
} catch (Exception e) {
e.printStackTrace();
}
......@@ -107,6 +106,13 @@ public class ServiceTest {
}
@Test
public void test() {
}
//// @Test
//// public void test1() {
//// String res = qywxUserApiService.leaveClerkExternal("ww9ede832a84b7ae5f"
......
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