Commit 3c5a9dd1 by zhiwj

Merge branch 'developer' into 'master'

Developer

See merge request !30
parents 04f6e568 62caf571
......@@ -122,8 +122,12 @@ public class ClerkServiceImpl implements ClerkService {
public Integer updateClerkStatus(Integer enterpriseId, String clerkIds, Integer status) {
List<Integer> clerkIdList;
if (StringUtils.isNotBlank(clerkIds)) {
String[] split = clerkIds.split(GlobalInfo.FLAG_COMMA);
clerkIdList = Stream.of(split).map(Integer::parseInt).collect(Collectors.toList());
if (StringUtils.equals("all", clerkIds)) {
clerkIdList = null;
} else {
String[] split = clerkIds.split(GlobalInfo.FLAG_COMMA);
clerkIdList = Stream.of(split).map(Integer::parseInt).collect(Collectors.toList());
}
} else {
return 0;
}
......
......@@ -109,6 +109,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
TabClerk clerkLeader = clerkService.getClerkLeaderByStoreInfoId(clerkDTO.getEnterpriseId(), clerkDTO.getStoreInfoId());
if (clerkLeader != null && com.gic.store.constant.Constants.CLERK_LEADER_POSITION_ID.equals(clerkDTO.getPositionId())) {
clerkLeader.setPositionId(com.gic.store.constant.Constants.CLERK_POSITION_ID);
clerkLeader.setPositionName("导购");
clerkService.update(clerkLeader);
clerkDTO.setPositionId(com.gic.store.constant.Constants.CLERK_LEADER_POSITION_ID);
} else if (clerkLeader == null) {
......@@ -667,8 +668,8 @@ public class ClerkApiServiceImpl implements ClerkApiService {
TabClerk oldClerk = this.clerkService.getClerkLeaderByStoreInfoId(clerk.getEnterpriseId(), clerk.getStoreInfoId());
oldClerk.setPositionId(com.gic.store.constant.Constants.CLERK_POSITION_ID);
this.clerkService.update(clerk);
this.clerkService.update(oldClerk);
this.clerkService.update(clerk);
return EnterpriseServiceResponse.success();
}
......
......@@ -3,7 +3,6 @@ package com.gic.store.service.outer.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Constant;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.*;
......@@ -1635,7 +1634,9 @@ public class StoreApiServiceImpl implements StoreApiService {
ServiceResponse<JSONObject> jsonObjectServiceResponse = this.parseStoreSelectJson(storeWidget.getSearchParam());
if(jsonObjectServiceResponse.isSuccess()){
json = jsonObjectServiceResponse.getResult();
jsonObjectList.add(json);
if (json != null) {
jsonObjectList.add(json);
}
}
}
if(storeWidget.getAuthMode() != null && storeWidget.getAuthMode() == 1
......
......@@ -387,11 +387,13 @@
select
<include refid="Base_Column_List" />
from tab_clerk
<where>
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
<if test="positionId != null ">
and position_id = #{positionId}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -267,14 +267,20 @@ public class ClerkController extends DownloadUtils {
@RequestMapping("/update-clerk-status")
public RestResponse updateClerkStatus(String clerkIds, Integer status) {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<List<ClerkDTO>> listClerkByIds = clerkApiService.listClerkByIds(enterpriseId, clerkIds);
ServiceResponse serviceResponse = clerkApiService.updateClerkStatus(enterpriseId, clerkIds, status);
if (serviceResponse.isSuccess()) {
List<ClerkDTO> clerkList = listClerkByIds.getResult();
if (CollectionUtils.isNotEmpty(clerkList)) {
String clerkNames = clerkList.stream().map(ClerkDTO::getClerkName).reduce((x, y) -> x + "," + y).orElse("");
if (!StringUtils.equals("all", clerkIds)) {
ServiceResponse<List<ClerkDTO>> listClerkByIds = clerkApiService.listClerkByIds(enterpriseId, clerkIds);
List<ClerkDTO> clerkList = listClerkByIds.getResult();
if (CollectionUtils.isNotEmpty(clerkList)) {
String clerkNames = clerkList.stream().map(ClerkDTO::getClerkName).collect(Collectors.joining(","));
String statusName = (Constants.NORMAL_STATUS.equals(status)) ? "启用" : "禁用";
LogUtils.createLog("修改状态为" + statusName, clerkNames);
}
} else {
String statusName = (Constants.NORMAL_STATUS.equals(status)) ? "启用" : "禁用";
LogUtils.createLog("修改状态为" + statusName, clerkNames);
LogUtils.createLog("修改状态为" + statusName, "全部导购");
}
return RestResponse.success(serviceResponse.getResult());
} else {
......
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