Commit 79a62eaa by songyinghui

feat: 更改linux支持的字体

parent 57769c3c
...@@ -181,9 +181,9 @@ public interface StaffMapper { ...@@ -181,9 +181,9 @@ public interface StaffMapper {
/** /**
* 查询企业下所有成员ID * 查询企业下所有成员ID
* @param enterpriseId * @param wxEnterpriseIds
* @return * @return
*/ */
List<String> queryStaffIdsWithEnterpriseId(@Param("enterpriseId") String enterpriseId); List<String> queryStaffIdsWithEnterpriseId(@Param("wxEnterpriseIds") List<String> wxEnterpriseIds);
} }
\ No newline at end of file
...@@ -146,8 +146,8 @@ public interface StaffService { ...@@ -146,8 +146,8 @@ public interface StaffService {
/** /**
* 查询企业下所有成员id * 查询企业下所有成员id
* @param enterpriseId * @param wxEnterpriseIds
* @return * @return
*/ */
List<String> queryStaffIdsWithEnterpriseId(String enterpriseId); List<String> queryStaffIdsWithEnterpriseId(List<String> wxEnterpriseIds);
} }
...@@ -268,15 +268,15 @@ public class StaffServiceImpl implements StaffService { ...@@ -268,15 +268,15 @@ public class StaffServiceImpl implements StaffService {
/** /**
* 查询企业下所有成员id * 查询企业下所有成员id
* *
* @param enterpriseId * @param wxEnterpriseIds
* @return * @return
*/ */
@Override @Override
public List<String> queryStaffIdsWithEnterpriseId(String enterpriseId) { public List<String> queryStaffIdsWithEnterpriseId(List<String> wxEnterpriseIds) {
if (StringUtils.isBlank(enterpriseId)) { if (CollectionUtils.isEmpty(wxEnterpriseIds)) {
return Collections.emptyList(); return Collections.emptyList();
} }
return this.mapper.queryStaffIdsWithEnterpriseId(enterpriseId); return this.mapper.queryStaffIdsWithEnterpriseId(wxEnterpriseIds);
} }
} }
...@@ -123,13 +123,13 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic ...@@ -123,13 +123,13 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
return ServiceResponse.success(); return ServiceResponse.success();
} }
for (String enterpriseId : enterpriseIds) { for (String enterpriseId : enterpriseIds) {
List<String> wxEnterpriseIds = wxEnterpriseService.queryWxEnterpriseWithEnterpriseId(enterpriseId); List<String> wxEnterpriseIds = wxEnterpriseService.queryWxEnterpriseWithEnterpriseId(enterpriseId);
if (CollectionUtils.isEmpty(wxEnterpriseIds)) { if (CollectionUtils.isEmpty(wxEnterpriseIds)) {
log.info("企业 {}未关联企微", enterpriseId);
continue;
} }
List<String> staffIds = staffService.queryStaffIdsWithEnterpriseId(enterpriseId); List<String> staffIds = staffService.queryStaffIdsWithEnterpriseId(wxEnterpriseIds);
if (CollectionUtils.isEmpty(staffIds)) { if (CollectionUtils.isEmpty(staffIds)) {
log.info("企业 {} 不存在成员", enterpriseId); log.info("企业 {} 不存在成员", enterpriseId);
continue; continue;
......
...@@ -41,7 +41,7 @@ public class DrawImageUtils { ...@@ -41,7 +41,7 @@ public class DrawImageUtils {
Graphics2D pen = image.createGraphics(); Graphics2D pen = image.createGraphics();
pen.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); pen.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
pen.setColor(Color.WHITE); pen.setColor(Color.WHITE);
Font font = new Font("微软雅黑", Font.BOLD, 56); Font font = new Font("宋体", Font.BOLD, 56);
pen.setFont(font); pen.setFont(font);
FontMetrics metrics = pen.getFontMetrics(font); FontMetrics metrics = pen.getFontMetrics(font);
int startX = 40 + (260 - metrics.stringWidth(materialNum)) / 2; int startX = 40 + (260 - metrics.stringWidth(materialNum)) / 2;
...@@ -63,4 +63,12 @@ public class DrawImageUtils { ...@@ -63,4 +63,12 @@ public class DrawImageUtils {
} }
return null; return null;
} }
public static void main(String[] args) {
System.setProperty("gic.module.name", "haoban-manage3-service");
for (int i = 0; i < 50; i++) {
String url = DrawImageUtils.drawImage("jhdm", "102", "3.1万", "template/week_bkg.png");
System.out.println(url);
}
}
} }
...@@ -622,7 +622,11 @@ ...@@ -622,7 +622,11 @@
<select id="queryStaffIdsWithEnterpriseId" resultType="java.lang.String"> <select id="queryStaffIdsWithEnterpriseId" resultType="java.lang.String">
select staff_id select staff_id
from tab_haoban_staff from tab_haoban_staff
where status_flag = 1 and enterprise_id = #{enterpriseId} where status_flag = 1
and wx_enterprise_id in
<foreach collection="wxEnterpriseIds" item="wxEnterpriseId" open="(" close=")" separator=",">
#{wxEnterpriseId}
</foreach>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -512,7 +512,7 @@ ...@@ -512,7 +512,7 @@
from tab_haoban_wx_enterprise_related a from tab_haoban_wx_enterprise_related a
inner join tab_haoban_wx_enterprise b on a.wx_enterprise_id = b.wx_enterprise_id inner join tab_haoban_wx_enterprise b on a.wx_enterprise_id = b.wx_enterprise_id
where a.status_flag = 1 and b.status_flag = 1 where a.status_flag = 1 and b.status_flag = 1
and a.enterprise_id = #{enterprise_id} and a.enterprise_id = #{enterpriseId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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