Commit b0999bb8 by 蘑菇

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

parents 90f4ea0e b767cdb3
...@@ -235,10 +235,10 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -235,10 +235,10 @@ public class MessageApiServiceImpl implements MessageApiService {
String[] arr = parentChain.split("_"); String[] arr = parentChain.split("_");
int len = arr.length; int len = arr.length;
int startIndex = len - 2; int startIndex = len - 2;
if(dataType == GicDataType.STORE.getCode()){ if(dataType == GicDataType.STORE.getCode() || dataType == GicDataType.DEPARTMENT.getCode()){
startIndex = len - 1; startIndex = len - 1;
} }
for(int i = startIndex; i< len; i--){ for(int i = startIndex ; i>=0 && i< len; i--){
DepartmentDTO department = this.departmentService.getByRelatedId(arr[i]); DepartmentDTO department = this.departmentService.getByRelatedId(arr[i]);
if(department != null){ if(department != null){
return department; return department;
...@@ -248,4 +248,15 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -248,4 +248,15 @@ public class MessageApiServiceImpl implements MessageApiService {
DepartmentDTO departmentDTO = this.departmentService.getRootByEnterpriseId(wxEnterpriseId); DepartmentDTO departmentDTO = this.departmentService.getRootByEnterpriseId(wxEnterpriseId);
return departmentDTO; return departmentDTO;
} }
public static void main(String[] args){
String parentChain = "1_";
String[] arr = parentChain.split("_");
int len = arr.length;
int startIndex = len - 1;
System.out.println(len);
for(int i = startIndex ; i>=0 && i< len; i--){
System.out.println(i);
}
}
} }
...@@ -277,6 +277,7 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -277,6 +277,7 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override @Override
public void staffEdit(StaffDTO staffDTO, String departmentIds) { public void staffEdit(StaffDTO staffDTO, String departmentIds) {
TabHaobanStaff oldStaff = staffMapper.selectByPrimaryKey(staffDTO.getStaffId()); TabHaobanStaff oldStaff = staffMapper.selectByPrimaryKey(staffDTO.getStaffId());
logger.info("【员工修改】oldStaff={}",JSON.toJSONString(oldStaff));
//1、先更新staff //1、先更新staff
TabHaobanStaff tab = EntityUtil.changeEntityByJSON(TabHaobanStaff.class, staffDTO); TabHaobanStaff tab = EntityUtil.changeEntityByJSON(TabHaobanStaff.class, staffDTO);
staffService.updateByPrimaryKey(tab); staffService.updateByPrimaryKey(tab);
...@@ -313,7 +314,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -313,7 +314,8 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
logger.info("【员工修改】related={}",JSON.toJSONString(related)); logger.info("【员工修改】related={}",JSON.toJSONString(related));
if(org.apache.commons.lang3.StringUtils.isNoneBlank(related.getClerkCode())){ if(org.apache.commons.lang3.StringUtils.isNotBlank(related.getClerkCode())){
logger.info("【员工修改】oldName={},name={}",oldStaff.getStaffName(),staffDTO.getStaffName());
if(!staffDTO.getPhoneNumber().equals(related.getPhoneNumber())||!staffDTO.getStaffName().equals(oldStaff.getStaffName())){ if(!staffDTO.getPhoneNumber().equals(related.getPhoneNumber())||!staffDTO.getStaffName().equals(oldStaff.getStaffName())){
TabHaobanDepartment department = departmentService.selectById(addId); TabHaobanDepartment department = departmentService.selectById(addId);
String enterpriseId = ""; String enterpriseId = "";
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<dubbo:reference interface="com.gic.member.api.service.MemberService" id="memberService"/> <dubbo:reference interface="com.gic.member.api.service.MemberService" id="memberService"/>
<dubbo:reference interface="com.gic.enterprise.api.service.StoreService" id="storeService"/>
</beans> </beans>
\ No newline at end of file
...@@ -69,10 +69,10 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -69,10 +69,10 @@ public class DepartmentContoller extends WebBaseController{
} }
List<DepartmentDTO> result = page.getResult(); List<DepartmentDTO> result = page.getResult();
for (DepartmentDTO departmentDTO : result) { for (DepartmentDTO departmentDTO : result) {
String chainId = departmentDTO.getChainId(); String chainId = departmentDTO.getChainId() + Constant.ID_SEPARATOR + departmentDTO.getDepartmentId();
List<DepartmentDTO> sonList = departmentApiService.listByChainId(chainId,wxEnterpriseId); List<DepartmentDTO> sonList = departmentApiService.listByChainId(chainId,wxEnterpriseId);
int staffCount = 0; int staffCount = 0;
for (DepartmentDTO departmentDTO2 : result) { for (DepartmentDTO departmentDTO2 : sonList) {
staffCount += staffApiService.countByDepartmentId(departmentDTO2.getDepartmentId()); staffCount += staffApiService.countByDepartmentId(departmentDTO2.getDepartmentId());
} }
departmentDTO.setStaffCount(staffCount); departmentDTO.setStaffCount(staffCount);
......
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