Commit 6d4dfc54 by zhiwj

导购

parent 250f0fd7
......@@ -78,4 +78,6 @@ public interface TabClerkMapper {
@MapKey("clerkPositionId")
Map<Integer, Map<String, Object>> countMapByPosition(@Param("enterpriseId") Integer enterpriseId, @Param("ids") List<Integer> positionList);
void updatePosition(@Param("enterpriseId") Integer enterpriseId, @Param("positionId") Integer clerkPositionId, @Param("positionName") String positionName);
}
\ No newline at end of file
......@@ -123,4 +123,6 @@ public interface ClerkService {
TabClerk getClerkLeaderByStoreInfoId(Integer enterpriseId, Integer storeInfoId);
Map<Integer, Integer> countMapByPosition(Integer enterpriseId, List<Integer> positionList);
void updatePosition(Integer enterpriseId, Integer clerkPositionId, String positionName);
}
......@@ -172,4 +172,9 @@ public class ClerkServiceImpl implements ClerkService {
return resultMap;
}
@Override
public void updatePosition(Integer enterpriseId, Integer clerkPositionId, String positionName) {
tabClerkMapper.updatePosition(enterpriseId, clerkPositionId, positionName);
}
}
......@@ -66,6 +66,8 @@ public class ClerkApiServiceImpl implements ClerkApiService {
private WeimobStoreSiteService weimobStoreSiteService;
@Autowired
private WmStoreSyncLogApiService wmStoreSyncLogApiService;
@Autowired
private ClerkPositionService clerkPositionService;
@Override
public ServiceResponse saveOrUpdate(ClerkDTO clerkDTO) {
......@@ -97,6 +99,10 @@ public class ClerkApiServiceImpl implements ClerkApiService {
clerkDTO.getClerkId())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店下导购名称重复");
}
if (clerkDTO.getPositionId() == null) {
clerkDTO.setPositionId(com.gic.store.constant.Constants.CLERK_POSITION_ID);
}
// 店长逻辑
// 如果门店下已经存在有导购是店长, 并且当前导购是店长 则做替换
// 如果门店下没有导购是店长,将当前导购设置成店长
......@@ -109,6 +115,9 @@ public class ClerkApiServiceImpl implements ClerkApiService {
clerkDTO.setPositionId(com.gic.store.constant.Constants.CLERK_LEADER_POSITION_ID);
}
String positionName = this.clerkPositionService.getByClerkPositionId(clerkDTO.getPositionId()).getPositionName();
clerkDTO.setPositionName(positionName);
if (clerkDTO.getClerkId() == null) {
// Integer saveClerkLogBySaveClerk(Integer reason, Integer enterpriseId, Integer clerkId, String remark, Integer operatorId, String operatorName);
Integer id = clerkService.save(clerkDTO);
......
......@@ -51,6 +51,8 @@ public class ClerkPositionApiServiceImpl implements ClerkPositionApiService {
}
// 保存实体
clerkPositionService.update(clerkPositionDTO);
clerkService.updatePosition(clerkPositionDTO.getEnterpriseId(), clerkPositionDTO.getClerkPositionId(), clerkPositionDTO.getPositionName());
return ServiceResponse.success();
}
......
......@@ -357,4 +357,8 @@
</if>
group by position_id
</select>
<!-- void updatePosition(@Param("clerkPositionId") Integer clerkPositionId, @Param("positionName") String positionName);-->
<update id="updatePosition">
update tab_clerk set position_name = #{positionName} where position_id = #{positionId} and enterprise_id = #{enterpriseId}
</update>
</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