|
@@ -19,6 +19,7 @@ import me.chanjar.weixin.cp.bean.WxCpDepart;
|
|
public class WxDepartService extends BaseService {
|
|
public class WxDepartService extends BaseService {
|
|
|
|
|
|
public void saveWxDeparts() throws Exception {
|
|
public void saveWxDeparts() throws Exception {
|
|
|
|
+ deleteAll();
|
|
List<WxCpDepart> departs = WXCpDepartUtil.getAllChildDeparts(WebConstants.TOP_DEPART);
|
|
List<WxCpDepart> departs = WXCpDepartUtil.getAllChildDeparts(WebConstants.TOP_DEPART);
|
|
for (WxCpDepart depart : departs) {
|
|
for (WxCpDepart depart : departs) {
|
|
if(selectById(depart.getId()) == null) {
|
|
if(selectById(depart.getId()) == null) {
|
|
@@ -29,6 +30,10 @@ public class WxDepartService extends BaseService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void deleteAll() throws Exception {
|
|
|
|
+ update("WxDepartMapper.deleteAll", null);
|
|
|
|
+ }
|
|
|
|
+
|
|
public List<WxDepart> findParentList(Long id) throws Exception {
|
|
public List<WxDepart> findParentList(Long id) throws Exception {
|
|
List<WxDepart> wxDeparts = new ArrayList<>();
|
|
List<WxDepart> wxDeparts = new ArrayList<>();
|
|
Collections.reverse(findParent(wxDeparts, id));
|
|
Collections.reverse(findParent(wxDeparts, id));
|